summaryrefslogtreecommitdiff
path: root/examples/example.py
diff options
context:
space:
mode:
authorkotfu <kotfu@kotfu.net>2018-05-23 21:16:17 -0600
committerkotfu <kotfu@kotfu.net>2018-05-23 21:16:17 -0600
commit6780baa83457f7e99ba3a9c4f6a3c27701326ac5 (patch)
treec130136619c740645c45326a2ada0fcffa9f65a2 /examples/example.py
parent1a70b90f375997751bc7df16b5e3f58c6194c71b (diff)
downloadcmd2-git-6780baa83457f7e99ba3a9c4f6a3c27701326ac5.tar.gz
Standardize cmd2 imports in tests and examples
Diffstat (limited to 'examples/example.py')
-rwxr-xr-xexamples/example.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/example.py b/examples/example.py
index f07b9c74..264abd84 100755
--- a/examples/example.py
+++ b/examples/example.py
@@ -14,10 +14,10 @@ the transcript.
import random
import argparse
-from cmd2.cmd2 import Cmd, with_argparser
+import cmd2
-class CmdLineApp(Cmd):
+class CmdLineApp(cmd2.Cmd):
""" Example cmd2 application. """
# Setting this true makes it run a shell command if a cmd2/cmd command doesn't exist
@@ -43,7 +43,7 @@ class CmdLineApp(Cmd):
speak_parser.add_argument('-r', '--repeat', type=int, help='output [n] times')
speak_parser.add_argument('words', nargs='+', help='words to say')
- @with_argparser(speak_parser)
+ @cmd2.with_argparser(speak_parser)
def do_speak(self, args):
"""Repeats what you tell me to."""
words = []
@@ -65,7 +65,7 @@ class CmdLineApp(Cmd):
mumble_parser.add_argument('-r', '--repeat', type=int, help='how many times to repeat')
mumble_parser.add_argument('words', nargs='+', help='words to say')
- @with_argparser(mumble_parser)
+ @cmd2.with_argparser(mumble_parser)
def do_mumble(self, args):
"""Mumbles what you tell me to."""
repetitions = args.repeat or 1