-
Notifications
You must be signed in to change notification settings - Fork 238
FW import/export #1278
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
FW import/export #1278
Conversation
dc9ce3c to
adfbfe8
Compare
cf88cf2 to
2859f86
Compare
src/firmware_import_export.py
Outdated
| def main(): | ||
| args = _parse_args() | ||
| if args.command == 'export': | ||
| FwExporter(args.output).export_files(args.uids) |
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.
AttributeError: 'Namespace' object has no attribute 'uids'
"uids" is unknown because it is called "UIDs" in line 175. We should use a consistent spelling
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.
fixed
src/firmware_import_export.py
Outdated
| except json.JSONDecodeError as error: | ||
| logging.error(f'Error: data.json is not a valid JSON file: {error}') | ||
| return | ||
| if not all(k in data for k in ['db_revision', 'files', 'firmware', 'uid']): |
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.
Perhaps we should explain in the description that a data.json is mandatory and which keys it must contain. Otherwise, users who want to use the tool to import firmware (which has not been exported before) will have to look at the code to find out which keys are needed
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 added an message to the first error that explicitly states that the script is only for importing files that were previously exported by this script
2859f86 to
b013f43
Compare
b013f43 to
bef1471
Compare
resolves #1250, resolves #446