]> granicus.if.org Git - python/commitdiff
When reading from stdin (with the dialog box) use any partial line on
authorJack Jansen <jack.jansen@cwi.nl>
Sat, 26 May 2001 20:01:41 +0000 (20:01 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Sat, 26 May 2001 20:01:41 +0000 (20:01 +0000)
stdout as the prompt. This makes raw_input() and print "xxx", ; sys.stdin.readline() work a bit more palatable.

Mac/Tools/IDE/PyConsole.py

index fb8b439a6940cee186d08d62632dac6db9c6f28e..ea2cf834fb6a87b8bf7cf9d6b50d37d38a7c205f 100644 (file)
@@ -340,8 +340,15 @@ class SimpleStdin:
        
        def readline(self):
                import EasyDialogs
+               # A trick to make the input dialog box a bit more palatable
+               if hasattr(sys.stdout, '_buf'):
+                       prompt = sys.stdout._buf
+               else:
+                       prompt = ""
+               if not prompt:
+                       prompt = "Stdin input:"
                sys.stdout.flush()
-               rv = EasyDialogs.AskString("")
+               rv = EasyDialogs.AskString(prompt)
                if rv is None:
                        return ""
                return rv + '\n'