MCPcopy Create free account
hub / github.com/ActiveState/code / rename

Method rename

recipes/Python/576966_DnTree/recipe-576966.py:164–175  ·  view source on GitHub ↗

Rename node. old_dn --- old distinguished name of node. new_dn --- new distinguished name of node.

(self, old_dn, new_dn)

Source from the content-addressed store, hash-verified

162 self.dn_set.add(dn)
163
164 def rename(self, old_dn, new_dn):
165 """Rename node.
166
167 old_dn --- old distinguished name of node.
168 new_dn --- new distinguished name of node.
169 """
170 if old_dn not in self.dn_set:
171 raise ValueError("A record with dn=%s don't exists!" % new_dn)
172 if new_dn in self.dn_set:
173 raise ValueError("A record with dn=%s already exists!" % new_dn)
174 self.remove(old_dn)
175 self.add(new_dn)
176
177 def remove(self, dn):
178 """Remove node and its subtree.

Callers 15

VersionFileFunction · 0.45
RenameFileFunction · 0.45
recipe-576873.pyFile · 0.45
recipe-578621.pyFile · 0.45
doRolloverMethod · 0.45
_replaceCurrentFileMethod · 0.45
_backupCurrentFileMethod · 0.45
ext_lowerFunction · 0.45
ext_upperFunction · 0.45
replaceFileFunction · 0.45
_sync_indexMethod · 0.45
_splitMethod · 0.45

Calls 2

removeMethod · 0.95
addMethod · 0.95

Tested by

no test coverage detected