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

Close all file pointers, make esptool callable from another python script #341

Closed
wants to merge 2 commits into from

Conversation

borro0
Copy link

@borro0 borro0 commented Aug 2, 2018

Linked to issue #340

AASHIMA-NL\boris.blokland added 2 commits August 2, 2018 08:18
…rg[..]).

In this way it still works standalone from commandline aswell.
projectgus pushed a commit that referenced this pull request Jan 9, 2019
Closes #340

(From #341 with minor changes.)
projectgus pushed a commit that referenced this pull request Jan 9, 2019
…rg[..]).

In this way it still works standalone from commandline aswell.

(From #341)
projectgus added a commit that referenced this pull request Jan 9, 2019
…nal API compatible

As I know at least one uset who is setting sys.argv and then calling
esptool.main()

Modifies #341
@marcelstoer
Copy link
Contributor

Since v2.6 is out now this could be closed I guess.

@projectgus
Copy link
Contributor

projectgus commented Jan 9, 2019

Sorry for the long time addressing this. Cherry-picked with commits linked above, with some minor tweaks:

  • Changed the way address/offset pairs are cleaned up, so it's done from main() only. If callers of specific module functions have opened these files, they're responsible for closing them (and they may not want to, for example if the file is an IOStream).
  • Changed main() so it can still be called as main() (to use sys.argv) or main(xyz) (to use xyz)

Still want to devote some time to improving the Python-level API. Maybe for v3.0 (as may will break some of the people relying on the current not-very-nice API.)

@projectgus projectgus closed this Jan 9, 2019
@marcelstoer
Copy link
Contributor

Thanks for this great improvement anyhow. Can't wait to integrate it into my GUI tool.

@marcelstoer
Copy link
Contributor

Anyone coming across this issue pls take note of #406.

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.

3 participants