Last active
February 5, 2019 19:19
-
-
Save maethu/a24bd1787391a1078c2a to your computer and use it in GitHub Desktop.
uncatalog_if_no_uid.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def uncatalog_by_rid(_catalog, rid): | |
data = _catalog.data | |
paths = _catalog.paths | |
indexes = _catalog.indexes.keys() | |
for name in indexes: | |
x = _catalog.getIndex(name) | |
if hasattr(x, 'unindex_object'): | |
x.unindex_object(rid) | |
del data[rid] | |
del paths[rid] | |
_catalog._length.change(-1) |
jone
commented
Jan 31, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment