#NEWLINE# def define_commands_from_module( subparsers , command_module , cmd_mapper ) : #NEWLINE# #INDENT# 'Add *do_* methods in a module and add as commands into a subparsers.' #NEWLINE# for method_name in ( command_module for a in dir ( command_module ) if a . startswith ( 'do_' ) ) : #NEWLINE# #INDENT# command = method_name [ 3 : ] . replace ( '_' , '-' ) #NEWLINE# callback = getattr ( command_module , method_name ) #NEWLINE# define_command ( subparsers , command , callback , cmd_mapper )