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.
It would be cool if I could write:
With
pbar.start()andpbar.finish()sequestered intopbar.__enter__andpbar.__exit__respectively.