changeset 2368:3865a772c360

jp (base): fixed CommandAnswering and progress bar
author Goffi <goffi@goffi.org>
date Sun, 01 Oct 2017 12:21:23 +0200
parents 9878635586f3
children cdaa58e14553
files frontends/src/jp/base.py
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/jp/base.py	Sun Oct 01 12:21:23 2017 +0200
+++ b/frontends/src/jp/base.py	Sun Oct 01 12:21:23 2017 +0200
@@ -719,14 +719,14 @@
                 return False
             if self.host.pbar is None:
                 #first answer, we must construct the bar
-                self.host.pbar = progressbar.ProgressBar(int(size),
-                                                    [_(u"Progress: "),progressbar.Percentage(),
-                                                     " ",
-                                                     progressbar.Bar(),
-                                                     " ",
-                                                     progressbar.FileTransferSpeed(),
-                                                     " ",
-                                                     progressbar.ETA()])
+                self.host.pbar = progressbar.ProgressBar(max_value=int(size),
+                                                         widgets=[_(u"Progress: "),progressbar.Percentage(),
+                                                         " ",
+                                                         progressbar.Bar(),
+                                                         " ",
+                                                         progressbar.FileTransferSpeed(),
+                                                         " ",
+                                                         progressbar.ETA()])
                 self.host.pbar.start()
 
             self.host.pbar.update(int(data['position']))
@@ -901,7 +901,7 @@
         """Auto reply to confirmations requests"""
         self.need_loop = True
         super(CommandAnswering, self).connected()
-        self.host.bridge.register("actionNew", self.onActionNew)
+        self.host.bridge.register_signal("actionNew", self.onActionNew)
         actions = self.host.bridge.actionsGet(self.profile)
         for action_data, action_id, security_limit in actions:
             self.onActionNew(action_data, action_id, security_limit, self.profile)