Commit 422a17d8 authored by Michel Pelletier's avatar Michel Pelletier

Fixed missing value bug, and 'Update Catalog' can sanify the catalog

if it gets in a bad state (not a bug fix, but a workaround)
parent f6858fd8
......@@ -206,7 +206,7 @@ class Catalog(Persistent, Acquisition.Implicit):
for key in self.data.keys():
rec = list(self.data[key])
rec.append(default_value, name)
rec.append(default_value)
self.data[key] = tuple(rec)
self.names = tuple(names)
......@@ -330,9 +330,14 @@ class Catalog(Persistent, Acquisition.Implicit):
except KeyError:
pass #fugedaboudit
del self.data[rid]
del self.uids[uid]
del self.paths[rid]
# I think if your data gets out of sync due to crashes or
# ZClass problems, some items might not be here. The try's
# catch any inconsistencies and lets 'Update Catalog' sanify
# the situation
try: del self.data[rid] except: pass
try: del self.uids[uid] except: pass
try: del self.paths[rid] except: pass
def clear(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment