فهرست منبع

Replace getonechar with raw_input(...)[0]

This solves the problem that Enter always stays in buffer
in Windows.
oz123 10 سال پیش
والد
کامیت
21a41ecb90
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      pwman/ui/tools.py

+ 2 - 2
pwman/ui/tools.py

@@ -261,7 +261,7 @@ class CMDLoop(object):  # pragma: no cover
 
                 print ("%s - %s: %s" % (i, x.name, currentstr))
             print("X - Finish editing")
-            option = getonechar("Enter your choice:")
+            option = raw_input("Enter your choice:")[0]
             try:
                 print ("Selection, ", option)
                 # substract 1 because array subscripts start at 0
@@ -301,7 +301,7 @@ class CMDLoop(object):  # pragma: no cover
                 if (option.upper() == 'X'):
                     break
                 print("Invalid selection")
-
+            
 
 def getonechar(question, width=_defaultwidth):  # pragma: no cover
     question = "%s " % (question)