Преглед изворни кода

Fix for pull request, cast to int directly from config.get_value)

Donn Morrison пре 7 година
родитељ
комит
0f620a90d4
2 измењених фајлова са 8 додато и 8 уклоњено
  1. 4 4
      pwman/ui/baseui.py
  2. 4 4
      pwman/ui/win.py

+ 4 - 4
pwman/ui/baseui.py

@@ -472,13 +472,13 @@ class BaseCommands(HelpUIMixin, AliasesMixin, BaseUtilsMixin):
 
         node = self._db_entries_to_nodes(nodes)[0]
         print(node)
-        flushtimeout = self.config.get_value('Global', 'cls_timeout')
+        flushtimeout = int(self.config.get_value('Global', 'cls_timeout'))
 
-        if int(flushtimeout) != 0:
+        if flushtimeout > 0:
             flushtimeout = flushtimeout or 10
-            print("Type Enter to flush screen or wait %s sec. " % flushtimeout)
+            print("Type Enter to flush screen or wait %d sec. " % flushtimeout)
 
-            _wait_until_enter(_heard_enter, float(flushtimeout))
+            _wait_until_enter(_heard_enter, flushtimeout)
             self.do_cls('')
 
     def do_delete(self, args):

+ 4 - 4
pwman/ui/win.py

@@ -93,13 +93,13 @@ class PwmanCliWin(PwmanCli):
         nodes = self._db.getnodes([args])
         node = self._db_entries_to_nodes(nodes)[0]
         print(node)
-        flushtimeout = self.config.get_value('Global', 'cls_timeout')
+        flushtimeout = int(self.config.get_value('Global', 'cls_timeout'))
 
-        if int(flushtimeout) != 0:
+        if flushtimeout > 0:
             flushtimeout = flushtimeout or 10
-            print("Type Enter to flush screen or wait %s sec. " % flushtimeout)
+            print("Type Enter to flush screen or wait %d sec. " % flushtimeout)
 
-            _wait_until_enter(heardEnterWin, float(flushtimeout))
+            _wait_until_enter(heardEnterWin, flushtimeout)
             self.do_cls('')
 
     def do_copy(self, args):