-
Notifications
You must be signed in to change notification settings - Fork 1.8k
change --reload-extra-file option to get multiple files at once #1846
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
Conversation
| meta = "FILES" | ||
| validator = validate_list_of_existing_files | ||
| default = [] | ||
| default = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the correct default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@firekim2 bump on this question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bump firekim2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So really sorry for not following up about this for this long time.
Yes, it is. Since, we are changing the type to str, and parse it. it should be the empty string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just reviewed the ArgumentParser documentation and tried this a bit in my REPL. Using nargs='+' causes the value to a be a list, so I think we want [] as the default.
|
I like this PR. I'm sorry I missed it before. I want to be sure it works correctly and haven't had a chance to test. My argparse knowledge is weak, but I've been reading the docs lately. If it works correctly, I support it. |
|
The other thing I would check is that everything works correctly when this is the last flag. In other words, I would hope that it does not eat the required Python app module argument.
|
|
This is useful. Thanks! |
|
@firekim2 do you have time or interest to rebase this? |
Yes, I have. Let me try it. |
|
@tilgovi rebased it |
|
@firekim2 thanks! there i still one last question to answer but otherise the change is OK for me :) |
|
Hi, As for your question regarding the default value - I tested Argparse by default treats all arguments as strings so having This also solves #1643 because |
|
Is there a blocker for this PR? Would really love to have this, or alternatively some kind of workaround as this covers quite a common case. |
|
Any updates on this? |
|
Please merge! |
|
It's necessary when we pass a directory that is applied recursively |
|
Anything I can do for merging this? |
|
Anything specifically holding this up? Would love to see this functionality merged |
|
In the meantime, you can use a little bash script: It tracks changes in every html file in the templates folder (or its subfolder) |
|
The documentation can cause confusion about the theme while doing reference of reload_extra_files (on plural) for the singular parameter --reload-extra-file. |
|
Great suggestion! In my case specifically for reloading on changes to template files, CSS, JS and such. |
|
no activity since awhile. closing feel free to create a new ticket if needed. Thanks for the patch! |
|
Is this patch being applied, or the one in #3124 ? |
If I want to reload when templates changes, I should do like this right now:
--reload-extra-file path/to/templates/file1 --reload-extra-file path/to/templates/file2 ......
add every file by file.
I changed config.py to get files like:
--reload-extra-file path/to/templates/*
or
--reload-extra-file path/to/templates/file1 path/to/templates/file2