Skip to content
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

Wrap get.py's "if __name__ == '__main__':" into a function so it can be externally called #4475

Merged
merged 5 commits into from Feb 7, 2019

Conversation

CarlosRDomin
Copy link
Contributor

Adding the Arduino repo as a git submodule can be very useful for dependency and version control. However, git submodule update is not enough, as the tools need to be downloaded through python get.py. Wrapping the main code in that script into its own function allows an external Python script to import the module and execute its functionality without relying on the unsafe execfile (or Popen). The main advantage would be easy flow control in case of error (eg: issue #4464).

CarlosRDomin and others added 2 commits March 6, 2018 18:48
…be externally called

Adding the Arduino repo as a git submodule can be very useful for version control. However, `git submodule update` is not enough, as the tools need to be downloaded through `get.py`. Wrapping the main code in that script into its own function allows an external Python script to import the module and execute its functionality without relying on the unsafe `execfile` (or `Popen`). The main advantage would be easy flow control in case of error (eg: issue esp8266#4464).
@earlephilhower earlephilhower added this to the 2.6.0 milestone Jan 25, 2019
Copy link
Collaborator

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems harmless and is in keeping with good Python style.

@earlephilhower earlephilhower merged commit 82be4d0 into esp8266:master Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants