summaryrefslogtreecommitdiff
path: root/example/example.py
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2017-01-06 12:23:48 +0000
committerGitHub <noreply@github.com>2017-01-06 12:23:48 +0000
commit46d1028a330ffe4d344b99739d1d4b607654ade5 (patch)
treea9d266360cc23d383335c69195a2b65cc8cba77f /example/example.py
parentef074cc2ffb64b2c5281757820f6904bd368d51e (diff)
parent01a8ab20a7ce3544da7c3e69dfc5d4cb0ad257ae (diff)
downloadcmd2-git-46d1028a330ffe4d344b99739d1d4b607654ade5.tar.gz
Merge pull request #29 from tleonhardt/master
Refactored to create a unified Python 2/3 codebase based on six which doesn't require 2to3
Diffstat (limited to 'example/example.py')
-rwxr-xr-xexample/example.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/example/example.py b/example/example.py
index 9d17bbb7..863084cd 100755
--- a/example/example.py
+++ b/example/example.py
@@ -1,4 +1,4 @@
-
+# coding=utf-8
"""A sample application for cmd2.
"""
@@ -15,7 +15,7 @@ class CmdLineApp(Cmd):
@options([make_option('-p', '--piglatin', action="store_true", help="atinLay"),
make_option('-s', '--shout', action="store_true", help="N00B EMULATION MODE"),
make_option('-r', '--repeat', type="int", help="output [n] times")
- ], arg_desc = '(text to say)')
+ ], arg_desc='(text to say)')
def do_speak(self, arg, opts=None):
"""Repeats what you tell me to."""
arg = ''.join(arg)
@@ -30,8 +30,9 @@ class CmdLineApp(Cmd):
# self.stdout.write is better than "print", because Cmd can be
# initialized with a non-standard output destination
- do_say = do_speak # now "say" is a synonym for "speak"
- do_orate = do_speak # another synonym, but this one takes multi-line input
+ do_say = do_speak # now "say" is a synonym for "speak"
+ do_orate = do_speak # another synonym, but this one takes multi-line input
+
c = CmdLineApp()
c.cmdloop()