summaryrefslogtreecommitdiff
path: root/examples/pirate.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/pirate.py
parent1a70b90f375997751bc7df16b5e3f58c6194c71b (diff)
downloadcmd2-git-6780baa83457f7e99ba3a9c4f6a3c27701326ac5.tar.gz
Standardize cmd2 imports in tests and examples
Diffstat (limited to 'examples/pirate.py')
-rwxr-xr-xexamples/pirate.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/pirate.py b/examples/pirate.py
index f6f4c629..9da634aa 100755
--- a/examples/pirate.py
+++ b/examples/pirate.py
@@ -7,10 +7,11 @@ presented as part of her PyCon 2010 talk.
It demonstrates many features of cmd2.
"""
import argparse
-from cmd2.cmd2 import Cmd, with_argparser
+import cmd2
-class Pirate(Cmd):
+
+class Pirate(cmd2.Cmd):
"""A piratical example cmd2 application involving looting and drinking."""
def __init__(self):
self.default_to_shell = True
@@ -74,7 +75,7 @@ class Pirate(Cmd):
yo_parser.add_argument('-c', '--commas', action='store_true', help='Intersperse commas')
yo_parser.add_argument('beverage', help='beverage to drink with the chant')
- @with_argparser(yo_parser)
+ @cmd.with_argparser(yo_parser)
def do_yo(self, args):
"""Compose a yo-ho-ho type chant with flexible options."""
chant = ['yo'] + ['ho'] * args.ho