More `pecan.commands` documentation.

This commit is contained in:
Ryan Petrello
2012-03-22 17:25:54 -04:00
parent 75a6aeab19
commit d05677eed8
4 changed files with 59 additions and 1 deletions

View File

@@ -109,7 +109,33 @@ class CommandRunner(object):
class BaseCommand(object):
""" Base class for Pecan commands. """
"""
A base interface for Pecan commands.
Can be extended to support ``pecan`` command extensions in individual Pecan
projects, e.g.,
$ ``pecan my-custom-command config.py``
::
# myapp/myapp/custom_command.py
class CustomCommand(pecan.commands.base.BaseCommand):
'''
(First) line of the docstring is used to summarize the command.
'''
arguments = ({
'command': '--extra_arg',
'help': 'an extra command line argument',
'optional': True
})
def run(self, args):
super(SomeCommand, self).run(args)
print args.extra_arg
print self.load_app()
"""
class __metaclass__(type):
@property