Skip to content

Commit

Permalink
Fix progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Bouni committed Dec 13, 2024
1 parent cdbdd7b commit 60c23be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 60c23be

Please sign in to comment.