37 DebugClientInstance = None |
37 DebugClientInstance = None |
38 |
38 |
39 ############################################################################### |
39 ############################################################################### |
40 |
40 |
41 |
41 |
42 def DebugClientInput(prompt=""): |
42 def DebugClientInput(prompt="", echo=True): |
43 """ |
43 """ |
44 Replacement for the standard input() builtin. |
44 Replacement for the standard input() builtin. |
45 |
45 |
46 This function works with the split debugger. |
46 This function works with the split debugger. |
47 |
47 |
48 @param prompt prompt to be shown |
48 @param prompt prompt to be shown |
49 @type str |
49 @type str |
|
50 @param echo flag indicating echoing of the input |
|
51 @type bool |
50 @return result of the input() call |
52 @return result of the input() call |
51 @rtype str |
53 @rtype str |
52 """ |
54 """ |
53 if DebugClientInstance is None or not DebugClientInstance.redirect: |
55 if DebugClientInstance is None or not DebugClientInstance.redirect: |
54 return DebugClientOrigInput(prompt) |
56 return DebugClientOrigInput(prompt) |
55 else: |
57 else: |
56 return DebugClientInstance.input(prompt) |
58 return DebugClientInstance.input(prompt, echo=echo) |
57 |
59 |
58 # Use our own input(). |
60 # Use our own input(). |
59 try: |
61 try: |
60 DebugClientOrigInput = __builtins__.__dict__['input'] |
62 DebugClientOrigInput = __builtins__.__dict__['input'] |
61 __builtins__.__dict__['input'] = DebugClientInput |
63 __builtins__.__dict__['input'] = DebugClientInput |
223 |
225 |
224 def input(self, prompt, echo=True): |
226 def input(self, prompt, echo=True): |
225 """ |
227 """ |
226 Public method to implement input() using the event loop. |
228 Public method to implement input() using the event loop. |
227 |
229 |
228 @param prompt the prompt to be shown (string) |
230 @param prompt prompt to be shown |
229 @param echo Flag indicating echoing of the input (boolean) |
231 @type str |
|
232 @param echo flag indicating echoing of the input |
|
233 @type bool |
230 @return the entered string |
234 @return the entered string |
|
235 @rtype str |
231 """ |
236 """ |
232 self.sendJsonCommand("RequestRaw", { |
237 self.sendJsonCommand("RequestRaw", { |
233 "prompt": prompt, |
238 "prompt": prompt, |
234 "echo": echo, |
239 "echo": echo, |
235 }) |
240 }) |