Reverses all the Set() calls, restoring things to their original definition. Its okay to call UnsetAll() repeatedly, as later calls have no effect if no Set() calls have been made.
(self)
| 129 | setattr(parent, child_name, new_child) |
| 130 | |
| 131 | def UnsetAll(self): |
| 132 | """Reverses all the Set() calls, restoring things to their original |
| 133 | definition. Its okay to call UnsetAll() repeatedly, as later calls have |
| 134 | no effect if no Set() calls have been made. |
| 135 | |
| 136 | """ |
| 137 | # Undo calls to Set() in reverse order, in case Set() was called on the |
| 138 | # same arguments repeatedly (want the original call to be last one undone) |
| 139 | self.cache.reverse() |
| 140 | |
| 141 | for (parent, old_child, child_name) in self.cache: |
| 142 | setattr(parent, child_name, old_child) |
| 143 | self.cache = [] |
no test coverage detected