aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/storage
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-14 07:37:51 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-14 07:37:51 -0500
commit19fe0817ba7c2cd04caea3adfa82d4490288a548 (patch)
tree6291cac9b9861f1009d63a419c3e79879f356bc8 /libbe/storage
parent2f0ceedba5b6619faf476cd1aa67e826e91d5c7c (diff)
downloadbugseverywhere-19fe0817ba7c2cd04caea3adfa82d4490288a548.tar.gz
Transitioned comment to Command format
Diffstat (limited to 'libbe/storage')
-rw-r--r--libbe/storage/util/config.py8
-rw-r--r--libbe/storage/vcs/base.py7
2 files changed, 8 insertions, 7 deletions
diff --git a/libbe/storage/util/config.py b/libbe/storage/util/config.py
index a0fea0c..a0a252e 100644
--- a/libbe/storage/util/config.py
+++ b/libbe/storage/util/config.py
@@ -47,15 +47,15 @@ def set_val(name, value, section="DEFAULT", encoding=None):
encoding = default_encoding
config = ConfigParser.ConfigParser()
if os.path.exists(path()) == False: # touch file or config
- open(path(), "w").close() # read chokes on missing file
- f = codecs.open(path(), "r", encoding)
+ open(path(), 'w').close() # read chokes on missing file
+ f = codecs.open(path(), 'r', encoding)
config.readfp(f, path())
f.close()
if value is not None:
config.set(section, name, value)
else:
config.remove_option(section, name)
- f = codecs.open(path(), "w", encoding)
+ f = codecs.open(path(), 'w', encoding)
config.write(f)
f.close()
@@ -79,7 +79,7 @@ def get_val(name, section="DEFAULT", default=None, encoding=None):
if encoding == None:
encoding = default_encoding
config = ConfigParser.ConfigParser()
- f = codecs.open(path(), "r", encoding)
+ f = codecs.open(path(), 'r', encoding)
config.readfp(f, path())
f.close()
try:
diff --git a/libbe/storage/vcs/base.py b/libbe/storage/vcs/base.py
index 9ea38d3..768a85f 100644
--- a/libbe/storage/vcs/base.py
+++ b/libbe/storage/vcs/base.py
@@ -620,7 +620,7 @@ os.listdir(self.get_path("bugs")):
self.be_dir = os.path.join(
self.repo, self._cached_path_id._spacer_dirs[0])
self._cached_path_id.root(self.repo)
- self._rooted == True
+ self._rooted = True
def _init(self):
"""
@@ -631,7 +631,8 @@ os.listdir(self.get_path("bugs")):
raise VCSUnableToRoot(self)
if self._vcs_detect(self.repo) == False:
self._vcs_init(self.repo)
- self.root()
+ if self._rooted == False:
+ self.root()
os.mkdir(self.be_dir)
self._vcs_add(self._u_rel_path(self.be_dir))
self._cached_path_id.init()
@@ -863,7 +864,7 @@ os.listdir(self.get_path("bugs")):
Split the commitfile created in self.commit() back into
summary and header lines.
"""
- f = codecs.open(commitfile, "r", self.encoding)
+ f = codecs.open(commitfile, 'r', self.encoding)
summary = f.readline()
body = f.read()
body.lstrip('\n')