From: W. Trevor King Date: Tue, 11 Aug 2009 18:46:26 +0000 (-0400) Subject: Handle BugDir.list_uuids() in the case of missing ".be/bugs/". X-Git-Tag: 1.0.0~62^2~30 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7e3f2172564953b6eb2cbfc13eb07d7031cc7331;p=be.git Handle BugDir.list_uuids() in the case of missing ".be/bugs/". Previously: $ be init $ be list ... File ".../libbe/bugdir.py", line 537, in list_uuids for uuid in os.listdir(self.get_path("bugs")): OSError: [Errno 2] No such file or directory: '.../.be/bugs' --- diff --git a/libbe/bugdir.py b/libbe/bugdir.py index 0eb4a6c..ee6c943 100644 --- a/libbe/bugdir.py +++ b/libbe/bugdir.py @@ -534,10 +534,11 @@ settings easy. Don't set this attribute. Set .rcs instead, and uuids = [] if self.sync_with_disk == True and os.path.exists(self.get_path()): # list the uuids on disk - for uuid in os.listdir(self.get_path("bugs")): - if not (uuid.startswith('.')): - uuids.append(uuid) - yield uuid + if os.path.exists(self.get_path("bugs")): + for uuid in os.listdir(self.get_path("bugs")): + if not (uuid.startswith('.')): + uuids.append(uuid) + yield uuid # and the ones that are still just in memory for bug in self: if bug.uuid not in uuids: