Procházet zdrojové kódy

fix some bugs related to the window client

this still needs a lot of work, hence, consider
windows client broken ...
However this commit does fix issue #17
U-w7x64\admin před 11 roky
rodič
revize
08b71b0f37
3 změnil soubory, kde provedl 10 přidání a 8 odebrání
  1. 1 1
      pwman/ui/cli.py
  2. 6 6
      pwman/ui/tools.py
  3. 3 1
      scripts/pwman3

+ 1 - 1
pwman/ui/cli.py

@@ -759,7 +759,7 @@ class PwmanCliNew(PwmanCli):
 
         try:
             readline.read_history_file(self._historyfile)
-        except IOError, e:
+        except NameError, e:
             pass
 
         self.prompt = "pwman> "

+ 6 - 6
pwman/ui/tools.py

@@ -157,16 +157,16 @@ def gettermsize():
 
 
 def getinput(question, default="", completer=None, width=_defaultwidth):
-    if (not _readline_available):
+    if not _readline_available:
         return raw_input(question.ljust(width))
     else:
         def defaulter():
             """define default behavior startup"""
-            readline.insert_text(default)
-
-        readline.set_startup_hook(defaulter)
-        oldcompleter = readline.get_completer()
-        readline.set_completer(completer)
+            if _readline_available:
+                readline.insert_text(default)
+            readline.set_startup_hook(defaulter)
+            oldcompleter = readline.get_completer()
+            readline.set_completer(completer)
 
         x = raw_input(question.ljust(width))
 

+ 3 - 1
scripts/pwman3

@@ -58,7 +58,9 @@ if 'darwin' in sys.platform:
     from pwman.ui.mac import PwmanCliMacNew as PwmanCliNew
     OSX = True
 elif 'win' in sys.platform:
-    from pwman.ui.win import PwmanCliWinNew as PwmanCliNew
+    print 2
+    from pwman.ui.win import PwmanCliWinNew as PwmanCli
+    OSX = False
 else:
     from pwman.ui.cli import PwmanCli
     from pwman.ui.cli import PwmanCliNew