Fulfills the same role for Hooke that a software package does for
an operating system.
"""
- name = "base plugin"
+ def __init__(self, name):
+ self.name = name
def dependencies(self):
"""Return a list of Plugins we require."""
ITEM:
Success
"""
- def __init__(self, name, arguments=[], aliases=None, help=''):
+ def __init__(self, name, aliases=None, arguments=[], help=''):
self.name = name
+ if aliases == None:
+ aliases = []
+ self.aliases = aliases
self.arguments = [
Argument(name='help', type='bool', default=False, count=1,
callback=StoreValue(True), help='Print a help message.'),
] + arguments
- if aliases == None:
- aliases = []
- self.aliases = aliases
self._help = help
def run(self, inqueue=None, outqueue=None, **kwargs):
TODO: ranges for `count`?
"""
- def __init__(self, name, type='string', metavar=None, default=None,
- optional=True, count=1, completion_callback=None,
- callback=None, aliases=None, help=''):
+ def __init__(self, name, aliases=None, type='string', metavar=None,
+ default=None, optional=True, count=1,
+ completion_callback=None, callback=None, help=''):
self.name = name
+ if aliases == None:
+ aliases = []
+ self.aliases = aliases
self.type = type
if metavar == None:
- metavar = name.upper()
+ metavar = type.upper()
self.metavar = metavar
self.default = default
self.optional = optional
self.count = count
self.completion_callback = completion_callback
self.callback = callback
- if aliases == None:
- aliases = []
- self.aliases = aliases
self._help = help
def __str__(self):