summaryrefslogtreecommitdiff
path: root/examples/pirate.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-05-25 12:35:24 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-05-25 12:35:24 -0400
commit4c67d3372db924e87be920d89aadecb946584b31 (patch)
treebf57a15570248a2e3fbfb058a817d6c743cc9167 /examples/pirate.py
parent0e4131ba2616bd33c9cb5e93105dbd6d511a71ab (diff)
parentcad21a60fa92ebe4a7c177142d273f9f7497967b (diff)
downloadcmd2-git-4c67d3372db924e87be920d89aadecb946584b31.tar.gz
Merge branch 'master' into pyshell_readline
Diffstat (limited to 'examples/pirate.py')
-rwxr-xr-xexamples/pirate.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/pirate.py b/examples/pirate.py
index f6f4c629..34906a9f 100755
--- a/examples/pirate.py
+++ b/examples/pirate.py
@@ -7,15 +7,16 @@ 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
self.multiline_commands = ['sing']
- self.terminators = Cmd.terminators + ['...']
+ self.terminators = self.terminators + ['...']
self.songcolor = 'blue'
# Add stuff to settable and/or shortcuts before calling base class initializer
@@ -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)
+ @cmd2.with_argparser(yo_parser)
def do_yo(self, args):
"""Compose a yo-ho-ho type chant with flexible options."""
chant = ['yo'] + ['ho'] * args.ho