Skip to content

Commit

Permalink
silently ingore uncataloging absent id
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Pelletier committed Jan 17, 2000
1 parent ff734d4 commit 248a714
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions Catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,21 +369,22 @@ def uncatalogObject(self, uid):
catalogued, otherwise it will not get removed from the catalog
"""
if uid not in self.uids.keys():
raise ValueError, "Uncatalog of absent id %s" % `uid`

rid = self.uids[uid]
try:
rid = self.uids[uid]

for x in self.indexes.values():
if hasattr(x, 'unindex_object'):
try:
x.unindex_object(rid)
except KeyError:
pass #fugedaboudit

del self.data[rid]
del self.uids[uid]
del self.paths[rid]
for x in self.indexes.values():
if hasattr(x, 'unindex_object'):
try:
x.unindex_object(rid)
except KeyError:
pass #fugedaboudit

del self.data[rid]
del self.uids[uid]
del self.paths[rid]

except:
pass

def clear(self):
""" clear catalog """
Expand Down

0 comments on commit 248a714

Please sign in to comment.