Skip to content

Instantly share code, notes, and snippets.

@anaselli
Created April 10, 2017 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anaselli/7a84baa6b7d53d733edcfee525feb904 to your computer and use it in GitHub Desktop.
Save anaselli/7a84baa6b7d53d733edcfee525feb904 to your computer and use it in GitHub Desktop.
Possible workaround to max recursion in progress bar set value and libyui gtk bindings
diff --git a/dnfdragora/progress_ui.py b/dnfdragora/progress_ui.py
index 3096142..9840862 100644
--- a/dnfdragora/progress_ui.py
+++ b/dnfdragora/progress_ui.py
@@ -74,7 +74,10 @@ class ProgressBar:
def set_progress(self, frac, label=None) :
if label is not None:
self.progressbar.setLabel(label)
- self.progressbar.setValue(int(100*frac))
+ val = self.progressbar.value()
+ newval = int(100*frac)
+ if (val != newval) :
+ self.progressbar.setValue(newval)
#self.__flush()
def reset_all(self) :
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment