66
77import argparse
88
9- from cmd2 . cmd2 import Cmd , categorize , __version__ , with_argparser , with_category
9+ import cmd2
1010
11-
12- class HelpCategories (Cmd ):
11+ class HelpCategories (cmd2 .Cmd ):
1312 """ Example cmd2 application. """
1413
1514 # Command categories
@@ -28,7 +27,7 @@ def do_connect(self, _):
2827 # Tag the above command functions under the category Connecting
2928 categorize (do_connect , CMD_CAT_CONNECTING )
3029
31- @with_category (CMD_CAT_CONNECTING )
30+ @cmd2 . with_category (CMD_CAT_CONNECTING )
3231 def do_which (self , _ ):
3332 """Which command"""
3433 self .poutput ('Which' )
@@ -58,8 +57,8 @@ def do_redeploy(self, _):
5857 choices = ['now' , 'later' , 'sometime' , 'whenever' ],
5958 help = 'Specify when to restart' )
6059
61- @with_argparser (restart_parser )
62- @with_category (CMD_CAT_APP_MGMT )
60+ @cmd2 . with_argparser (restart_parser )
61+ @cmd2 . with_category (CMD_CAT_APP_MGMT )
6362 def do_restart (self , _ ):
6463 """Restart command"""
6564 self .poutput ('Restart' )
@@ -123,12 +122,12 @@ def do_vminfo(self, _):
123122 self .poutput ('VM Info' )
124123
125124 # Tag the above command functions under the category Server Information
126- categorize (do_resources , CMD_CAT_SERVER_INFO )
127- categorize (do_status , CMD_CAT_SERVER_INFO )
128- categorize (do_serverinfo , CMD_CAT_SERVER_INFO )
129- categorize (do_thread_dump , CMD_CAT_SERVER_INFO )
130- categorize (do_sslconnectorciphers , CMD_CAT_SERVER_INFO )
131- categorize (do_vminfo , CMD_CAT_SERVER_INFO )
125+ cmd2 . categorize (do_resources , CMD_CAT_SERVER_INFO )
126+ cmd2 . categorize (do_status , CMD_CAT_SERVER_INFO )
127+ cmd2 . categorize (do_serverinfo , CMD_CAT_SERVER_INFO )
128+ cmd2 . categorize (do_thread_dump , CMD_CAT_SERVER_INFO )
129+ cmd2 . categorize (do_sslconnectorciphers , CMD_CAT_SERVER_INFO )
130+ cmd2 . categorize (do_vminfo , CMD_CAT_SERVER_INFO )
132131
133132 # The following command functions don't have the HELP_CATEGORY attribute set
134133 # and show up in the 'Other' group
0 commit comments