aboutsummaryrefslogtreecommitdiffstats
path: root/libbe
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-08-31 11:50:28 -0400
committerW. Trevor King <wking@drexel.edu>2009-08-31 11:50:28 -0400
commitbaa45573a54bf8f7fdcd7fc53d13f9f160954da7 (patch)
tree83e54eddaa574462b1d71b80b753b4aa6ee8ec44 /libbe
parentab45531c788f48bf27dec1a5fff2d23ac92936f7 (diff)
downloadbugseverywhere-baa45573a54bf8f7fdcd7fc53d13f9f160954da7.tar.gz
Made get_path() definitions consistent between bugdirs, bugs, and comments.
Diffstat (limited to 'libbe')
-rw-r--r--libbe/bug.py12
-rw-r--r--libbe/bugdir.py6
-rw-r--r--libbe/comment.py12
3 files changed, 15 insertions, 15 deletions
diff --git a/libbe/bug.py b/libbe/bug.py
index 7554318..f7a1a06 100644
--- a/libbe/bug.py
+++ b/libbe/bug.py
@@ -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
diff --git a/libbe/bugdir.py b/libbe/bugdir.py
index ee6c943..64fea1f 100644
--- a/libbe/bugdir.py
+++ b/libbe/bugdir.py
@@ -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)
diff --git a/libbe/comment.py b/libbe/comment.py
index b2fc556..4e55c90 100644
--- a/libbe/comment.py
+++ b/libbe/comment.py
@@ -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