Add the option to remove unparsable fonts#11
Merged
whtsky merged 9 commits intowhtsky:masterfrom May 12, 2021
Zopolis4:master
Merged
Add the option to remove unparsable fonts#11whtsky merged 9 commits intowhtsky:masterfrom Zopolis4:master
whtsky merged 9 commits intowhtsky:masterfrom
Zopolis4:master
Conversation
This commit adds the option to remove unparsable fonts (not collections)
Removes the (currently) unused atexit module, which was a remnant from my attempts to support removing unparseable .otc/.ttc files
whtsky
requested changes
Apr 6, 2021
|
|
||
| parser.add_argument("-ru", "--remove-unparsable", dest="ru", action="store_true", help="When this option is enabled, unparsable fonts are removed instead of ignored") | ||
|
|
||
| args, unknown = parser.parse_known_args() |
Owner
There was a problem hiding this comment.
Can you put argparse related code into the main function?
putting it on top-level means importing font_rename will execute these code too -- might cause some unexpected error
Contributor
Author
There was a problem hiding this comment.
When I tried that, it broke the script
Owner
There was a problem hiding this comment.
it broke the script
Can you provide more info?
Contributor
Author
There was a problem hiding this comment.
Owner
There was a problem hiding this comment.
I think rename_font should accept a new argument remove_unparsable instead of referring to global variable args
Contributor
Author
There was a problem hiding this comment.
I am not sure how to do that
Replaces the sys.argv path input with a positional argparse argument.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit adds the option to remove unparsable fonts as opposed to printing an error message (not collections, due to the way the script handles them. working on that). It also adds support for creating further argparse arguments while keeping the sys.argv path variable intact.