Add options: format/style/rebuild into generate.py#6
Open
yuezheng wants to merge 1 commit intoint32bit:masterfrom
Open
Add options: format/style/rebuild into generate.py#6yuezheng wants to merge 1 commit intoint32bit:masterfrom
yuezheng wants to merge 1 commit intoint32bit:masterfrom
Conversation
yuezheng
commented
Mar 19, 2018
- Add format option;
- Add style option;
- Add rebuild option to skip exist output file.
1. Add format option; 2. Add style option; 3. Add rebuild option to skip exist output file.
int32bit
requested changes
Mar 21, 2018
|
|
||
| parser = OptionParser() | ||
| parser.add_option("-r", "--rebuild", dest="rebuild", default=False, | ||
| help="Rebuild exist output image") |
Owner
There was a problem hiding this comment.
I think this option don't need any additional argument, so is it better to set it action to store_true ?
|
|
||
| work_path = os.getcwd() + "/" | ||
| output_file_name = src_file[:src_file.rindex('.') + 1] + format | ||
| target_full_path = work_path + target_path + "/" + output_file_name |
Owner
There was a problem hiding this comment.
You don't need get absolute path again, you can use os.path.abspath or os.path.realpath to convert to absolute path.
abspath = os.path.abspath(target_path + output_file)
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.