zipfly icon indicating copy to clipboard operation
zipfly copied to clipboard

Progress indicator

Open me21 opened this issue 2 years ago • 3 comments

Is it possible to get any progress information while looping through the generator?

me21 avatar Aug 25 '23 12:08 me21

Yes, what is the use case?

sandes avatar Sep 23 '23 03:09 sandes

I create a big zip file which I then save to disk. I would like to show a progress indicator while the file is saving. I'd like a real progress indicator, not a spinner.

me21 avatar Sep 23 '23 05:09 me21

For future reference: I used the code like

    counter = itertools.count()  # https://stackoverflow.com/a/6309645/2404492
    zipfly_object.paths = (i for i, v in zip(zipfly_paths, counter))

i.e. I made Zipfly paths list a generator from real paths list zipped with a counter. So whenever generator consumes an element, the counter value is incremented.

me21 avatar Oct 01 '25 12:10 me21