Explorar o código

Merge branch 'develop' of github.com:pwman3/pwman3 into develop

Oz N Tiram %!s(int64=7) %!d(string=hai) anos
pai
achega
066efe95f0
Modificáronse 4 ficheiros con 15 adicións e 11 borrados
  1. 2 2
      README.md
  2. 1 1
      docs/source/configuration.rst
  3. 6 4
      pwman/ui/baseui.py
  4. 6 4
      pwman/ui/win.py

+ 2 - 2
README.md

@@ -67,12 +67,12 @@ You can also install PWMAN3 using python pip:
       ...
       cls_timeout = 10
       ```
-      To disable the automatic 'clear screen' functionality set `cls_timeout` to a negative integer. 
+      To disable the automatic 'clear screen' functionality set `cls_timeout` to 0. 
 
       ```
       [Global]
       ...
-      cls_timeout = -1
+      cls_timeout = 0
       ```
  * making a password from the numeric character and the alphabet character ([A-Za-z0-9]).
 

+ 1 - 1
docs/source/configuration.rst

@@ -54,7 +54,7 @@ Following is a table describing the parameters and their meanings:
     ---------------------    -----------
     cp_timeout               Number of seconds before the clipboard is erased.
     ---------------------    -----------
-    cls_timeout              Number of seconds before the screen is clean after a print.
+    cls_timeout              Number of seconds before the screen is clean after a print. Set to 0 to disable.
     ---------------------    -----------
     umask                    The umask in which database and configuration files are written.
     ---------------------    -----------

+ 6 - 4
pwman/ui/baseui.py

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

+ 6 - 4
pwman/ui/win.py

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