Bläddra i källkod

Add config option (cls_timeout = 0) to disable screen flush

Donn Morrison 7 år sedan
förälder
incheckning
ce591969b0
3 ändrade filer med 11 tillägg och 9 borttagningar
  1. 1 1
      docs/source/configuration.rst
  2. 5 4
      pwman/ui/baseui.py
  3. 5 4
      pwman/ui/win.py

+ 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.
     ---------------------    -----------

+ 5 - 4
pwman/ui/baseui.py

@@ -473,12 +473,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 = flushtimeout or 10
 
-        print("Type Enter to flush screen or wait %s sec. " % flushtimeout)
+        if int(flushtimeout) != 0:
+            flushtimeout = flushtimeout or 10
+            print("Type Enter to flush screen or wait %s sec. " % flushtimeout)
 
-        _wait_until_enter(_heard_enter, float(flushtimeout))
-        self.do_cls('')
+            _wait_until_enter(_heard_enter, float(flushtimeout))
+            self.do_cls('')
 
     def do_delete(self, args):
 

+ 5 - 4
pwman/ui/win.py

@@ -94,12 +94,13 @@ 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
 
-        print("Type Enter to flush screen or wait %s sec. " % flushtimeout)
+        if int(flushtimeout) != 0:
+            flushtimeout = flushtimeout or 10
+            print("Type Enter to flush screen or wait %s sec. " % flushtimeout)
 
-        _wait_until_enter(heardEnterWin, float(flushtimeout))
-        self.do_cls('')
+            _wait_until_enter(heardEnterWin, float(flushtimeout))
+            self.do_cls('')
 
     def do_copy(self, args):
         ids = self._get_ids(args)