aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/ui
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/ui
parent1bec5c0d3880a1cd848d765365104e221f390e71 (diff)
downloadbugseverywhere-2f0ceedba5b6619faf476cd1aa67e826e91d5c7c.tar.gz
Transitioned init to Command format
Diffstat (limited to 'libbe/ui')
-rwxr-xr-xlibbe/ui/command_line.py10
-rw-r--r--libbe/ui/util/user.py2
2 files changed, 7 insertions, 5 deletions
diff --git a/libbe/ui/command_line.py b/libbe/ui/command_line.py
index 60741f5..c59a302 100755
--- a/libbe/ui/command_line.py
+++ b/libbe/ui/command_line.py
@@ -255,16 +255,18 @@ def main():
Class = getattr(module, command_name.capitalize())
command = Class()
parser = CmdOptionParser(command)
+ storage = None
+ bugdir = None
if command.requires_bugdir == True:
+ assert command.requires_unconnected_storage == False
storage = libbe.storage.get_storage(options['repo'])
storage.connect()
bugdir = libbe.bugdir.BugDir(storage, from_storage=True)
- else:
- storage = None
- bugdir = None
+ elif: command.requires_unconnected_storage == True:
+ storage = libbe.storage.get_storage(options['repo'])
try:
options,args = parser.parse_args(args[1:])
- command.run(bugdir, options, args)
+ command.run(storage, bugdir, options, args)
except CallbackExit:
if storage != None: storage.disconnect()
return 0
diff --git a/libbe/ui/util/user.py b/libbe/ui/util/user.py
index 5b16b73..d6af89b 100644
--- a/libbe/ui/util/user.py
+++ b/libbe/ui/util/user.py
@@ -75,7 +75,7 @@ def get_user_id(storage=None):
if user != None:
return user
if storage != None and hasattr(storage, 'get_user_id'):
- user = vcs.get_user_id()
+ user = storage.get_user_id()
if user != None:
return user
name = get_fallback_username()