aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/bugdir.py
diff options
context:
space:
mode:
authorAaron Bentley <abentley@panoramicfeedback.com>2005-03-23 15:28:29 +0000
committerAaron Bentley <abentley@panoramicfeedback.com>2005-03-23 15:28:29 +0000
commit03b878916280732d45c474c106eb3d70b4be5e9e (patch)
tree496b27b5f6ab3dc8fc8ba5b9ef6e0bea62af6ff8 /libbe/bugdir.py
parent43d8c19ae299bab2cba0f29b560396ba6d8bd1a5 (diff)
downloadbugseverywhere-03b878916280732d45c474c106eb3d70b4be5e9e.tar.gz
Added datestamps to bugs
Diffstat (limited to 'libbe/bugdir.py')
-rw-r--r--libbe/bugdir.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/libbe/bugdir.py b/libbe/bugdir.py
index e2f40d6..d318690 100644
--- a/libbe/bugdir.py
+++ b/libbe/bugdir.py
@@ -4,6 +4,8 @@ import cmdutil
import errno
import names
import mapfile
+import time
+import utility
from rcs import rcs_by_name
class NoBugDir(Exception):
@@ -162,6 +164,9 @@ class Bug(object):
self.status = dict.get("status")
self.severity = dict.get("severity")
self.assigned = dict.get("assigned")
+ self.time = dict.get("time")
+ if self.time is not None:
+ self.time = utility.str_to_time(self.time)
def get_path(self, file):
return os.path.join(self.path, self.uuid, file)
@@ -184,10 +189,21 @@ class Bug(object):
self.add_attr(map, "target")
self.add_attr(map, "status")
self.add_attr(map, "severity")
+ if self.time is not None:
+ map["time"] = utility.time_to_str(self.time)
path = self.get_path("values")
map_save(rcs_by_name(self.rcs_name), path, map)
+def new_bug(dir):
+ bug = dir.new_bug()
+ bug.creator = names.creator()
+ bug.severity = "minor"
+ bug.status = "open"
+ bug.time = time.time()
+ return bug
+
+
def map_save(rcs, path, map):
"""Save the map as a mapfile to the specified path"""
if not os.path.exists(path):