Skip to content

Commit

Permalink
Fixed missing value bug, and 'Update Catalog' can sanify the catalog
Browse files Browse the repository at this point in the history
if it gets in a bad state (not a bug fix, but a workaround)
  • Loading branch information
Michel Pelletier committed Aug 18, 1999
1 parent 3e00f23 commit 2416023
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Catalog.py
Expand Up @@ -206,7 +206,7 @@ def addColumn(self, name, default_value=None):

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)
Expand Down Expand Up @@ -330,9 +330,14 @@ def uncatalogObject(self, uid):
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):

Expand Down

0 comments on commit 2416023

Please sign in to comment.