summaryrefslogtreecommitdiff
path: root/examples/subcommands.py
diff options
context:
space:
mode:
authorkotfu <jared@kotfu.net>2018-05-24 19:07:45 -0600
committerGitHub <noreply@github.com>2018-05-24 19:07:45 -0600
commitcad21a60fa92ebe4a7c177142d273f9f7497967b (patch)
tree3cfa590653af8b7570bd4073384467d2ca736fa0 /examples/subcommands.py
parent5d64ebee348aeffb02fc385f903c9af431e3721b (diff)
parent190fecb34ac91e25f64615f378d6d59ef6d77de8 (diff)
downloadcmd2-git-cad21a60fa92ebe4a7c177142d273f9f7497967b.tar.gz
Merge pull request #413 from python-cmd2/speedup_import
Defer certain imports
Diffstat (limited to 'examples/subcommands.py')
-rwxr-xr-xexamples/subcommands.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/subcommands.py b/examples/subcommands.py
index 55be7711..356c2e09 100755
--- a/examples/subcommands.py
+++ b/examples/subcommands.py
@@ -52,8 +52,7 @@ except ImportError:
# Intentionally below the bash completion code to reduce tab completion lag
-from cmd2 import cmd2
-from cmd2.cmd2 import with_argparser
+import cmd2
class SubcommandsExample(cmd2.Cmd):
@@ -83,7 +82,7 @@ class SubcommandsExample(cmd2.Cmd):
parser_bar.set_defaults(func=base_bar)
parser_sport.set_defaults(func=base_sport)
- @with_argparser(base_parser)
+ @cmd2.with_argparser(base_parser)
def do_base(self, args):
"""Base command help"""
func = getattr(args, 'func', None)