aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/bugdir.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-29 19:00:40 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-29 19:00:40 -0500
commit4372a17b4215df25b3da0b68daf4d6b490a8955c (patch)
tree4464d284fe0653701e43b3dc5a465dd14da056b3 /libbe/bugdir.py
parentd0fdc606a0420807cfbde0519d1807bd16f14c37 (diff)
downloadbugseverywhere-4372a17b4215df25b3da0b68daf4d6b490a8955c.tar.gz
Fixed up the completion helpers in libbe.command.util
This entailed a fairly thorough cleanup of libbe.util.id. Remaining unimplemented completion helpers: * complete_assigned() * complete_extra_strings() Since these would require scanning all (active?) bugs to compile lists, and I was feeling lazy...
Diffstat (limited to 'libbe/bugdir.py')
-rw-r--r--libbe/bugdir.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/libbe/bugdir.py b/libbe/bugdir.py
index cec1e3b..737dacf 100644
--- a/libbe/bugdir.py
+++ b/libbe/bugdir.py
@@ -39,6 +39,7 @@ import libbe.storage.util.settings_object as settings_object
import libbe.storage.util.mapfile as mapfile
import libbe.bug as bug
import libbe.util.utility as utility
+import libbe.util.id
if libbe.TESTING == True:
import doctest
@@ -73,11 +74,13 @@ class MultipleBugMatches(ValueError):
self.shortname = shortname
self.matches = matches
-class NoBugMatches(KeyError):
- def __init__(self, shortname):
- msg = "No bug matches %s" % shortname
- KeyError.__init__(self, msg)
- self.shortname = shortname
+class NoBugMatches(libbe.util.id.NoIDMatches):
+ def __init__(self, *args, **kwargs):
+ libbe.util.id.NoIDMatches.__init__(self, *args, **kwargs)
+ def __str__(self):
+ if self.msg == None:
+ return 'No bug matches %s' % self.id
+ return self.msg
class DiskAccessRequired (Exception):
def __init__(self, goal):
@@ -270,8 +273,9 @@ class BugDir (list, settings_object.SavedSettingsObject):
def bug_from_uuid(self, uuid):
if not self.has_bug(uuid):
- raise NoBugMatches('No bug matches %s\n bug map: %s\n repo: %s' \
- % (uuid, self._bug_map, self.storage))
+ raise NoBugMatches(
+ uuid, self.uuids(),
+ 'No bug matches %s in %s' % (uuid, self.storage))
if self._bug_map[uuid] == None:
self._load_bug(uuid)
return self._bug_map[uuid]