aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-27 16:50:36 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-27 16:50:36 -0500
commitcfebc238cbda9b6338ec57d5c215c4cbf0246f8b (patch)
tree30efcc0f354a175220814ea5d4e74dd2d71fa2fb /libbe/command
parentdff704764d77bffbf6cc94c5ba4bb03309da45f8 (diff)
downloadbugseverywhere-cfebc238cbda9b6338ec57d5c215c4cbf0246f8b.tar.gz
Moved InvalidStorageVersion from libbe.command to libbe.storage
Also added ConnectionError pretty-print to ui.command_line, storage version checking to BugDir.duplicate_bugdir(), and optional revision argument to Storage.storage_version().
Diffstat (limited to 'libbe/command')
-rw-r--r--libbe/command/__init__.py4
-rw-r--r--libbe/command/base.py12
2 files changed, 2 insertions, 14 deletions
diff --git a/libbe/command/__init__.py b/libbe/command/__init__.py
index ab9d2db..916b5ce 100644
--- a/libbe/command/__init__.py
+++ b/libbe/command/__init__.py
@@ -19,7 +19,6 @@ import base
UserError = base.UserError
UnknownCommand = base.UnknownCommand
-InvalidStorageVersion = base.InvalidStorageVersion
get_command = base.get_command
get_command_class = base.get_command_class
commands = base.commands
@@ -27,6 +26,5 @@ Option = base.Option
Argument = base.Argument
Command = base.Command
-__all__ = [UserError, UnknownCommand, InvalidStorageVersion,
- get_command, get_command_class,
+__all__ = [UserError, UnknownCommand, get_command, get_command_class,
commands, Option, Argument, Command]
diff --git a/libbe/command/base.py b/libbe/command/base.py
index 1409c74..ac6a58b 100644
--- a/libbe/command/base.py
+++ b/libbe/command/base.py
@@ -19,16 +19,6 @@ class UnknownCommand(UserError):
Exception.__init__(self, "Unknown command '%s'" % cmd)
self.cmd = cmd
-class InvalidStorageVersion(UserError):
- def __init__(self, active_version, expected_version=None):
- if expected_version == None:
- expected_version = libbe.storage.STORAGE_VERSION
- msg = 'Storage in "%s" not the expected "%s"' \
- % (active_version, expected_version)
- UserError.__init__(self, msg)
- self.active_version = active_version
- self.expected_version = expected_version
-
def get_command(command_name):
"""Retrieves the module for a user command
@@ -366,7 +356,7 @@ class Command (object):
self._storage.connect()
version = self._storage.storage_version()
if version != libbe.storage.STORAGE_VERSION:
- raise InvalidStorageVersion(version)
+ raise libbe.storage.InvalidStorageVersion(version)
return self._storage
def _get_bugdir(self):