Sfoglia il codice sorgente

Fix bug in reader

The reader did not respect the default value
oz123 11 anni fa
parent
commit
3ca5b66c89
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      pwman/ui/tools.py

+ 3 - 1
pwman/ui/tools.py

@@ -140,7 +140,7 @@ def getpassword(question, argsgiven=None,
                 reader=getpass.getpass, numerics=False, leetify=False,
                 symbols=False, special_signs=False,
                 length=None):  # pragma: no cover
-    # TODO: getpassword should recieve a config insatce
+    # TODO: getpassword should recieve a config insatnce
     #       and generate the policy according to it,
     #       so that getpassword in cli would be simplified
     if argsgiven == 1 or length:
@@ -205,6 +205,8 @@ def getinput(question, default="", reader=raw_input,
             x = raw_input(question.ljust(width))
             readline.set_completer(completer)
             readline.set_startup_hook()
+            if not x:
+                return default
             return x
     else:
         return reader()