summaryrefslogtreecommitdiffstats
path: root/Lib/cmd.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-03-17 06:49:51 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-03-17 06:49:51 (GMT)
commitce96f69d69a6020c780145c89a17a8391b63624b (patch)
tree7325a9bfaddf191e49910532df1fa4210c335196 /Lib/cmd.py
parent9e2b9665ae9f94a07da54156c48e2cd411a23746 (diff)
downloadcpython-ce96f69d69a6020c780145c89a17a8391b63624b.zip
cpython-ce96f69d69a6020c780145c89a17a8391b63624b.tar.gz
cpython-ce96f69d69a6020c780145c89a17a8391b63624b.tar.bz2
Get rid of a bunch more raw_input references
Diffstat (limited to 'Lib/cmd.py')
-rw-r--r--Lib/cmd.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/cmd.py b/Lib/cmd.py
index 3f82b48..23dc5b2 100644
--- a/Lib/cmd.py
+++ b/Lib/cmd.py
@@ -40,18 +40,20 @@ The data members `self.doc_header', `self.misc_header', and
`self.undoc_header' set the headers used for the help function's
listings of documented functions, miscellaneous topics, and undocumented
functions respectively.
-
-These interpreters use raw_input; thus, if the readline module is loaded,
-they automatically support Emacs-like command history and editing features.
"""
-import string
+import string, sys
__all__ = ["Cmd"]
PROMPT = '(Cmd) '
IDENTCHARS = string.ascii_letters + string.digits + '_'
+def raw_input(prompt):
+ sys.stdout.write(prompt)
+ sys.stdout.flush()
+ return sys.stdin.readline()
+
class Cmd:
"""A simple framework for writing line-oriented command interpreters.