From bf9b0b538b163ef1f05391511d0c01516ad9f2a0 Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Sat, 12 Mar 2022 20:20:34 +0100 Subject: More docstrings --- hazwaz/command.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hazwaz/command.py b/hazwaz/command.py index 2bfa2b9..28c3fa5 100644 --- a/hazwaz/command.py +++ b/hazwaz/command.py @@ -33,7 +33,11 @@ class MainCommand: if __name__ == "__main__": MyCommand().run() ''' + commands = () + """ + The subcommands: a tuple of :py:class:`Command` subclasses. + """ def __init__(self): desc = _get_first_docstring_line(self) @@ -86,6 +90,11 @@ class MainCommand: ) def run(self): + """ + Run the command. + + This is the method called to start running the command. + """ self.args = self.parser.parse_args() if getattr(self.args, "debug", False): @@ -105,7 +114,14 @@ class Command: Every subcommand of your script will be a subclass of this, added to the :py:attr:`MainCommand.subcommands`. """ + name = None + """ + The name used to call this subcommand from the command line. + + If this property is none, the default is the name of the class set + to lowercase. + """ def __init__(self): if self.name is None: -- cgit v1.2.3