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

Update upload.py #6781

Closed
wants to merge 2 commits into from
Closed

Update upload.py #6781

wants to merge 2 commits into from

Conversation

gnu-emu
Copy link

@gnu-emu gnu-emu commented Nov 15, 2019

May another solution to:
#6777

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.

Looks like a good way to make things work w/o requiring people to update the plugins. A little concerned about the duplication of the if-condition. Maybe we can safely eat --end in the updated code and avoid the outer if-else.

@gnu-emu gnu-emu marked this pull request as ready for review November 16, 2019 20:58
@gnu-emu
Copy link
Author

gnu-emu commented Nov 17, 2019

How about that ^

@gnu-emu
Copy link
Author

gnu-emu commented Nov 17, 2019

Only eating the '--end' is not working because ['write_flash', '0x0'] is appended and the binary is moved to the end. Also if another unknown plugin should use upload.py with two '--end' in one command esptool would not execute twice or (n-) times. As I'm a python beginner I did not know nesting if..else statements is a bad thing. What could happen while using the outer if-else (other than an ugly diff)?

@gnu-emu gnu-emu closed this Nov 17, 2019
@gnu-emu
Copy link
Author

gnu-emu commented Nov 17, 2019

Did not see your solution before. Thanks to your solution I learned about the if..elif statement :)

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.

2 participants