Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re.match expecting a string but getting a list #2

Closed
Olivier-Berg opened this issue Oct 10, 2021 · 4 comments
Closed

re.match expecting a string but getting a list #2

Olivier-Berg opened this issue Oct 10, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Olivier-Berg
Copy link

Olivier-Berg commented Oct 10, 2021

in handle_when_file

matches = re.match(
        r"^([~?\.\/\w].*)\/(\w+\.pyw?)$|^(\w+\.pyw?)$", args.path
)

args.path is an instance of a list not a string. This causes len8 to no longer work...
if i pass multiple files into args.path

$ len8 -f file1.py file2.py

the list would be ["file1.py", "file2".py].
(this is because of #1)

@parafoxia parafoxia added the bug Something isn't working label Oct 10, 2021
@parafoxia parafoxia self-assigned this Oct 10, 2021
@parafoxia
Copy link
Owner

The help text does specifically say a single file, so may be better to lock the command to just checking a single file rather than attempting to make it work for multiple. Thoughts @Jonxslays?

@Olivier-Berg
Copy link
Author

Maybe just remove the entire -f option all together. Just use the path argument for everything...

@Jonxslays
Copy link
Collaborator

Jonxslays commented Oct 10, 2021

Good find here @IkBenOlie5 . For now I have pushed a band-aid fix up to the develop branch to restore functionality to the -f flag if you only want to parse a single file.
Feel free to install that with pip install git+https://github.com/parafoxia/len8@develop if you need it.

This requires more thought and planning I think. There are some design flaws that need to be ironed out. Note: -f will still only accept a single file for now.

The help text does specifically say a single file, so may be better to lock the command to just checking a single file rather than attempting to make it work for multiple. Thoughts @Jonxslays?

Personally I would like to keep the greedy path argument, and maybe we could just do away with -f. Give me time to ponder this.

@Jonxslays
Copy link
Collaborator

Jonxslays commented Oct 10, 2021

This issue is now resolved in the v0.2.1 release. You can update to the latest version with pip install -U len8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants