Segmenting the Command methods better.

This commit is contained in:
Andrew Bastien 2020-01-14 09:25:45 -05:00
parent 69d85bd184
commit 77bf8f4eb7
2 changed files with 15 additions and 0 deletions

View file

@ -408,6 +408,15 @@ class Command(object, metaclass=CommandMeta):
module for which object properties are available (beyond those module for which object properties are available (beyond those
set in self.parse()) set in self.parse())
"""
self.get_command_info()
def get_command_info(self):
"""
This is the default output of func() if no func() overload is done.
Provided here as a separate method so that it can be called for debugging
purposes when making commands.
""" """
variables = "\n".join( variables = "\n".join(
" |w{}|n ({}): {}".format(key, type(val), val) for key, val in self.__dict__.items() " |w{}|n ({}): {}".format(key, type(val), val) for key, val in self.__dict__.items()

View file

@ -208,6 +208,12 @@ class MuxCommand(Command):
by the cmdhandler right after self.parser() finishes, and so has access by the cmdhandler right after self.parser() finishes, and so has access
to all the variables defined therein. to all the variables defined therein.
""" """
self.get_command_info()
def get_command_info(self):
"""
Update of parent class's get_command_info() for MuxCommand.
"""
variables = "\n".join( variables = "\n".join(
" |w{}|n ({}): {}".format(key, type(val), val) for key, val in self.__dict__.items() " |w{}|n ({}): {}".format(key, type(val), val) for key, val in self.__dict__.items()
) )