Made get_path() definitions consistent between bugdirs, bugs, and comments.
authorW. Trevor King <wking@drexel.edu>
Mon, 31 Aug 2009 15:50:28 +0000 (11:50 -0400)
committerW. Trevor King <wking@drexel.edu>
Mon, 31 Aug 2009 15:50:28 +0000 (11:50 -0400)
.be/bugs/764b812f-a0bb-4f4d-8e2f-c255c9474a0e/values [new file with mode: 0644]
libbe/bug.py
libbe/bugdir.py
libbe/comment.py

diff --git a/.be/bugs/764b812f-a0bb-4f4d-8e2f-c255c9474a0e/values b/.be/bugs/764b812f-a0bb-4f4d-8e2f-c255c9474a0e/values
new file mode 100644 (file)
index 0000000..631d1d6
--- /dev/null
@@ -0,0 +1,17 @@
+creator: W. Trevor King <wking@drexel.edu>
+
+
+reporter: W. Trevor King <wking@drexel.edu>
+
+
+severity: minor
+
+
+status: open
+
+
+summary: Add docstrings explaining role of the libbe submodules.
+
+
+time: Mon, 31 Aug 2009 13:57:54 +0000
+
index 7554318824dc5faaea78a97909defaf2d239690f..f7a1a06f83146e020d7e6edb015ad037cc1b4ff0 100644 (file)
@@ -341,12 +341,12 @@ class Bug(settings_object.SavedSettingsObject):
 
     # methods for saving/loading/acessing settings and properties.
 
-    def get_path(self, name=None):
-        my_dir = os.path.join(self.bugdir.get_path("bugs"), self.uuid)
-        if name is None:
-            return my_dir
-        assert name in ["values", "comments"]
-        return os.path.join(my_dir, name)
+    def get_path(self, *args):
+        dir = os.path.join(self.bugdir.get_path("bugs"), self.uuid)
+        if len(args) == 0:
+            return dir
+        assert args[0] in ["values", "comments"], str(args)
+        return os.path.join(dir, *args)
 
     def set_sync_with_disk(self, value):
         self.sync_with_disk = value
index ee6c9437346bc192cccd85aaee92015f31f1b814..64fea1f5b093dd0e27a672f12a4ea886d54d1716 100644 (file)
@@ -370,11 +370,11 @@ settings easy.  Don't set this attribute.  Set .rcs instead, and
         """
         Return a path relative to .root.
         """
-        my_dir = os.path.join(self.root, ".be")
+        dir = os.path.join(self.root, ".be")
         if len(args) == 0:
-            return my_dir
+            return dir
         assert args[0] in ["version", "settings", "bugs"], str(args)
-        return os.path.join(my_dir, *args)
+        return os.path.join(dir, *args)
 
     def _get_settings(self, settings_path, for_duplicate_bugdir=False):
         allow_no_rcs = not self.rcs.path_in_root(settings_path)
index b2fc5567aa3038110291fdbc17b474b8a38e941f..4e55c90b334c92917c55e050adb852221542013b 100644 (file)
@@ -546,12 +546,12 @@ class Comment(Tree, settings_object.SavedSettingsObject):
 
     # methods for saving/loading/acessing settings and properties.
 
-    def get_path(self, name=None):
-        my_dir = os.path.join(self.bug.get_path("comments"), self.uuid)
-        if name is None:
-            return my_dir
-        assert name in ["values", "body"]
-        return os.path.join(my_dir, name)
+    def get_path(self, *args):
+        dir = os.path.join(self.bug.get_path("comments"), self.uuid)
+        if len(args) == 0:
+            return dir
+        assert args[0] in ["values", "body"], str(args)
+        return os.path.join(dir, *args)
 
     def set_sync_with_disk(self, value):
         self.sync_with_disk = value