diff --git a/library.py b/library.py index 41d7073..36ea69e 100644 --- a/library.py +++ b/library.py @@ -12,7 +12,7 @@ import requests # pylint: disable=import-error import wx # pylint: disable=import-error -from .events import MessageEvent, PopulateFootprintListEvent, ResetGaugeEvent +from .events import MessageEvent, PopulateFootprintListEvent, ResetGaugeEvent, UpdateGaugeEvent from .helpers import PLUGIN_PATH, dict_factory, natural_sort_collation from .unzip_parts import unzip_parts @@ -488,6 +488,8 @@ def download(self): ) for data in r.iter_content(chunk_size=4096): f.write(data) + progress = f.tell() / size * 100 + wx.PostEvent(self.parent, UpdateGaugeEvent(value=progress)) self.logger.debug("Chunk %d downloaded successfully.", chunk_index) # Update progress file after successful download