summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJared Crapo <jared@kotfu.net>2017-08-21 21:44:35 -0600
committerJared Crapo <jared@kotfu.net>2017-08-21 21:44:35 -0600
commit886ff04fb841db140799de4c9ad683adf5093384 (patch)
tree37148667d6acc302593cfbb29335bf5fbc9feda1
parent6f14013a26d2c394d77f6da0682a68947d6dbb05 (diff)
downloadcmd2-git-886ff04fb841db140799de4c9ad683adf5093384.tar.gz
Updates to CmdLineApp()
-rw-r--r--tests/test_transcript.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_transcript.py b/tests/test_transcript.py
index 12d539ea..320ad1b6 100644
--- a/tests/test_transcript.py
+++ b/tests/test_transcript.py
@@ -54,15 +54,15 @@ class CmdLineApp(Cmd):
"""Repeats what you tell me to."""
arg = ''.join(arg)
if opts.piglatin:
- arg = '%s%say' % (arg[1:].rstrip(), arg[0])
+ arg = '%s%say' % (arg[1:], arg[0])
if opts.shout:
arg = arg.upper()
repetitions = opts.repeat or 1
for i in range(min(repetitions, self.maxrepeats)):
- self.stdout.write(arg)
- self.stdout.write('\n')
- # self.stdout.write is better than "print", because Cmd can be
- # initialized with a non-standard output destination
+ self.poutput(arg)
+ # recommend using the poutput function instead of
+ # self.stdout.write or "print", because Cmd allows the user
+ # to redirect output
do_say = do_speak # now "say" is a synonym for "speak"
do_orate = do_speak # another synonym, but this one takes multi-line input