Skip to content

Commit 886ff04

Browse files
committed
Updates to CmdLineApp()
1 parent 6f14013 commit 886ff04

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/test_transcript.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ def do_speak(self, arg, opts=None):
5454
"""Repeats what you tell me to."""
5555
arg = ''.join(arg)
5656
if opts.piglatin:
57-
arg = '%s%say' % (arg[1:].rstrip(), arg[0])
57+
arg = '%s%say' % (arg[1:], arg[0])
5858
if opts.shout:
5959
arg = arg.upper()
6060
repetitions = opts.repeat or 1
6161
for i in range(min(repetitions, self.maxrepeats)):
62-
self.stdout.write(arg)
63-
self.stdout.write('\n')
64-
# self.stdout.write is better than "print", because Cmd can be
65-
# initialized with a non-standard output destination
62+
self.poutput(arg)
63+
# recommend using the poutput function instead of
64+
# self.stdout.write or "print", because Cmd allows the user
65+
# to redirect output
6666

6767
do_say = do_speak # now "say" is a synonym for "speak"
6868
do_orate = do_speak # another synonym, but this one takes multi-line input

0 commit comments

Comments
 (0)