Fixed an issue with our replacement 'input()' and 'getpass()' functions. eric7

Sun, 13 Feb 2022 15:41:58 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 13 Feb 2022 15:41:58 +0100
branch
eric7
changeset 8948
9ddea4f0ad87
parent 8947
579e286300d1
child 8949
bab82fd15a6b

Fixed an issue with our replacement 'input()' and 'getpass()' functions.

eric7/DebugClients/Python/DebugClientBase.py file | annotate | diff | comparison | revisions
eric7/DebugClients/Python/getpass.py file | annotate | diff | comparison | revisions
--- a/eric7/DebugClients/Python/DebugClientBase.py	Sun Feb 13 15:00:25 2022 +0100
+++ b/eric7/DebugClients/Python/DebugClientBase.py	Sun Feb 13 15:41:58 2022 +0100
@@ -39,7 +39,7 @@
 ###############################################################################
 
 
-def DebugClientInput(prompt=""):
+def DebugClientInput(prompt="", echo=True):
     """
     Replacement for the standard input() builtin.
     
@@ -47,13 +47,15 @@
     
     @param prompt prompt to be shown
     @type str
+    @param echo flag indicating echoing of the input
+    @type bool
     @return result of the input() call
     @rtype str
     """
     if DebugClientInstance is None or not DebugClientInstance.redirect:
         return DebugClientOrigInput(prompt)
     else:
-        return DebugClientInstance.input(prompt)
+        return DebugClientInstance.input(prompt, echo=echo)
 
 # Use our own input().
 try:
@@ -225,9 +227,12 @@
         """
         Public method to implement input() using the event loop.
         
-        @param prompt the prompt to be shown (string)
-        @param echo Flag indicating echoing of the input (boolean)
+        @param prompt prompt to be shown
+        @type str
+        @param echo flag indicating echoing of the input
+        @type bool
         @return the entered string
+        @rtype str
         """
         self.sendJsonCommand("RequestRaw", {
             "prompt": prompt,
--- a/eric7/DebugClients/Python/getpass.py	Sun Feb 13 15:00:25 2022 +0100
+++ b/eric7/DebugClients/Python/getpass.py	Sun Feb 13 15:41:58 2022 +0100
@@ -26,7 +26,7 @@
     @return username
     @rtype str
     """
-    # this is copied from the oroginal getpass.py
+    # this is copied from the original getpass.py
     
     import os
 
@@ -40,17 +40,19 @@
     return pwd.getpwuid(os.getuid())[0]
 
 
-def getpass(prompt='Password: '):
+def getpass(prompt='Password: ', stream=None):
     """
     Function to prompt for a password, with echo turned off.
     
     @param prompt Prompt to be shown to the user
     @type str
+    @param stream input stream to read from (ignored)
+    @type file
     @return Password entered by the user
     @rtype str
     """
     return input(prompt, False)     # secok
-    
+
 
 unix_getpass = getpass
 win_getpass = getpass

eric ide

mercurial