Skip to content

Commit

Permalink
fix bug file size 0 (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
chStaiger authored Aug 29, 2024
1 parent d416e6f commit be7ab7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ibridgesgui/popup_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ def _finish_upload(self):

def _upload_status(self, state):
up_size, transferred_size, obj_count, num_objs, obj_failed = state
self.progress_bar.setValue(int(transferred_size*100/up_size))
if up_size > 0:
self.progress_bar.setValue(int(transferred_size*100/up_size))
text = f"{obj_count} of {num_objs} files; failed: {obj_failed}."
self.error_label.setText(text)

Expand Down Expand Up @@ -559,7 +560,8 @@ def _finish_download(self):

def _download_status(self, state):
down_size, transferred_size, obj_count, num_objs, obj_failed = state
self.progress_bar.setValue(int(transferred_size*100/down_size))
if down_size > 0:
self.progress_bar.setValue(int(transferred_size*100/down_size))
text = f"{obj_count} of {num_objs} files; failed: {obj_failed}."
self.error_label.setText(text)

Expand Down
3 changes: 2 additions & 1 deletion ibridgesgui/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ def _sync_data_end(self, thread_output: dict):

def _sync_data_status(self, state):
up_size, transferred_size, obj_count, num_objs, obj_failed = state
self.progress_bar.setValue(int(transferred_size*100/up_size))
if up_size > 0:
self.progress_bar.setValue(int(transferred_size*100/up_size))
text = f"{obj_count} of {num_objs} files; failed: {obj_failed}."
self.error_label.setText(text)

Expand Down

0 comments on commit be7ab7f

Please sign in to comment.