diff options
author | Aaron Bentley <abentley@panoramicfeedback.com> | 2005-03-09 19:32:17 +0000 |
---|---|---|
committer | Aaron Bentley <abentley@panoramicfeedback.com> | 2005-03-09 19:32:17 +0000 |
commit | 006b0cb118041cac8081032ad2d401fdd69fe6ae (patch) | |
tree | e8dd9b0d65d0ce3ca842cd279ba3edc724416e8e /libbe/bugdir.py | |
parent | 6ade356915dc78cae448b8b48028659ee0528244 (diff) | |
download | bugseverywhere-006b0cb118041cac8081032ad2d401fdd69fe6ae.tar.gz |
Added ability to create, close, open bugs
Diffstat (limited to 'libbe/bugdir.py')
-rw-r--r-- | libbe/bugdir.py | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/libbe/bugdir.py b/libbe/bugdir.py index efb392d..5e1d409 100644 --- a/libbe/bugdir.py +++ b/libbe/bugdir.py @@ -2,7 +2,7 @@ import os import os.path import cmdutil import errno - +import names class NoBugDir(cmdutil.UserError): def __init__(self, path): @@ -38,6 +38,13 @@ class BugDir: continue yield Bug(self.bugs_path, uuid) + def new_bug(self): + uuid = names.uuid() + path = os.path.join(self.bugs_path, uuid) + os.mkdir(path) + return Bug(self.bugs_path, uuid) + + def file_property(name, valid=None): def getter(self): value = self._get_value(name) @@ -68,23 +75,10 @@ class Bug(object): summary = file_property("summary") creator = file_property("creator") target = file_property("target") + status = file_property("status", valid=("open", "closed")) severity = file_property("severity", valid=("wishlist", "minor", "serious", "critical", "fatal")) - def _check_status(status): - assert status in ("open", "closed") - - def _set_status(self, status): - self._check_status(status) - self._set_value("status", status) - - def _get_status(self): - status = self._get_value("status") - assert status in ("open", "closed") - return status - - status = property(_get_status, _set_status) - def _get_active(self): return self.status == "open" |