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

with #70

Open
kousu opened this issue Jun 29, 2020 · 3 comments · May be fixed by #71
Open

with #70

kousu opened this issue Jun 29, 2020 · 3 comments · May be fixed by #71

Comments

@kousu
Copy link
Contributor

kousu commented Jun 29, 2020

It would be cool if I could write:

        with ProgressBar(widgets=widgets, maxval=os.stat(fname).st_size) as pbar:
            fp = open(fname, 'rb')
            fp = ProgressFile(fp, pbar.update)
            client.uploadFile(dataset, fp, posixpath.join(dir, file))

With pbar.start() and pbar.finish() sequestered into pbar.__enter__ and pbar.__exit__ respectively.

@kousu kousu linked a pull request Jun 29, 2020 that will close this issue
@NiltonVolpato
Copy link
Owner

Yeah, that's a good idea. I like it. I think it's convenient

@thorwhalen
Copy link

I just pushed a pull request that does this.

@thorwhalen
Copy link

Here: #78.
If it's not merged, you can simply use the fork: https://github.com/thorwhalen/python-progressbar

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 a pull request may close this issue.

3 participants