diff options
Diffstat (limited to 'libbe/ui')
-rwxr-xr-x | libbe/ui/command_line.py | 10 | ||||
-rw-r--r-- | libbe/ui/util/user.py | 2 |
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() |