From 6780baa83457f7e99ba3a9c4f6a3c27701326ac5 Mon Sep 17 00:00:00 2001 From: kotfu Date: Wed, 23 May 2018 21:16:17 -0600 Subject: Standardize cmd2 imports in tests and examples --- examples/example.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/example.py') 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 -- cgit v1.2.1