aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/base.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-14 03:29:20 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-14 03:29:20 -0500
commit2f0ceedba5b6619faf476cd1aa67e826e91d5c7c (patch)
tree09fa80c735c20a40e466b5139a878038bd46b33c /libbe/command/base.py
parent1bec5c0d3880a1cd848d765365104e221f390e71 (diff)
downloadbugseverywhere-2f0ceedba5b6619faf476cd1aa67e826e91d5c7c.tar.gz
Transitioned init to Command format
Diffstat (limited to 'libbe/command/base.py')
-rw-r--r--libbe/command/base.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/libbe/command/base.py b/libbe/command/base.py
index 2cf75bd..b27e188 100644
--- a/libbe/command/base.py
+++ b/libbe/command/base.py
@@ -145,6 +145,7 @@ class Command (object):
self.status = None
self.result = None
self.requires_bugdir = False
+ self.requires_unconnected_storage = False
self.input_encoding = None
self.output_encoding = None
self.options = [
@@ -157,7 +158,7 @@ class Command (object):
]
self.args = []
- def run(self, bugdir, options=None, args=None):
+ def run(self, storage=None, bugdir=None, options=None, args=None):
if options == None:
options = {}
if args == None:
@@ -175,7 +176,7 @@ class Command (object):
if 'user-id' in options:
params['user-id'] = options.pop('user-id')
else:
- params['user-id'] = libbe.ui.util.user.get_user_id(bugdir.storage)
+ params['user-id'] = libbe.ui.util.user.get_user_id(storage)
if len(options) > 0:
raise UserError, 'Invalid option passed to command %s:\n %s' \
% (self.name, '\n '.join(['%s: %s' % (k,v)
@@ -213,10 +214,10 @@ class Command (object):
params.pop('complete')
self._setup_io(self.input_encoding, self.output_encoding)
- self.status = self._run(bugdir, **params)
+ self.status = self._run(storage, bugdir, **params)
return self.status
- def _run(self, bugdir, **kwargs):
+ def _run(self, storage, bugdir, **kwargs):
pass
def _setup_io(self, input_encoding=None, output_encoding=None):