On Fri, Sep 01, 2017 at 01:50:13PM +0200, Tarek Ziad?? email@example.com wrote:
For large archives, I want to display a progress bar while the archive is being extracted with:
I could write my own version of extractall() to do this, or maybe we could introduce a callback option that gets called everytime .extract() is called in extractall()
The callback can receive the tarinfo object and where it's being extracted. This is enough to plug a progress bar and avoid reinventing .extractall()
What is "where" here? I think it should be 2 parameters -- position in the file (in bytes) and total file size; the total could be None if the size is unknown (the tar is piped from network or a (g/bz)zip subprocess).
I can add a ticket and maybe a patch if people think this is a good little enhancement
Definitely a good idea!