-
Notifications
You must be signed in to change notification settings - Fork 3k
Copy static files only #4804
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
Copy static files only #4804
Conversation
Signed-off-by: Johan Stokking <[email protected]>
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.
This misses the True part of the
if zip_proj
conditional. Could you change that branch to account for the new static_files
too?
That's not really what I meant. It's meaningless to copy files around when the export product is the zip file. I meant something like: if zip_proj:
for resource in resource_dict.values():
for label, res in resource.features.iteritems():
if label not in toolchain.target.features:
resource.add(res)
if isinstance(zip_proj, basestring):
zip_export(join(export_path, zip_proj), name, resource_dict, files + exporter.static_files,
inc_repos)
else:
zip_export(zip_proj, name, resource_dict, files + exporter.static_files, inc_repos) Which would add the static files to the zip |
Hi! First of all, thank you for your contribution! As part of my "improve mbed's Python code quality" quest, I will kindly ask you to rewrite in favour of a more pythonic way: (the trailing coma on line 3 is intentional, and we can use self.static_files = (
join(self.TEMPLATE_DIR, "GettingStarted.html"),
join(self.TEMPLATE_DIR, ".mbed"),
) instead of self.static_files = [join(self.TEMPLATE_DIR, "GettingStarted.html"),
join(self.TEMPLATE_DIR, ".mbed")] Thank you :) |
Signed-off-by: Johan Stokking <[email protected]>
Signed-off-by: Johan Stokking <[email protected]>
@theotherjimmy got it, makes totally sense @Nodraak these are my first lines of Python, thanks for the education 😉 |
The trailing coma is not required to use |
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.
Looks good. Thanks for the fix!
/morph export-build |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
Outputmbed Build Number: 93 All exports and builds passed! |
Thanks for the fix @johanstokking! It's a big improvement. |
Signed-off-by: Johan Stokking [email protected] (ARM mbed OS developer site username johanstokking)
Description
Closes #4802
Replaces #4803
Status
READY