Set immutability to is_immutable and recursively apply the setting to all nested CfgNodes.
(self, is_immutable)
| 258 | return self.__dict__[CfgNode.IMMUTABLE] |
| 259 | |
| 260 | def _immutable(self, is_immutable): |
| 261 | """Set immutability to is_immutable and recursively apply the setting |
| 262 | to all nested CfgNodes. |
| 263 | """ |
| 264 | self.__dict__[CfgNode.IMMUTABLE] = is_immutable |
| 265 | # Recursively set immutable state |
| 266 | for v in self.__dict__.values(): |
| 267 | if isinstance(v, CfgNode): |
| 268 | v._immutable(is_immutable) |
| 269 | for v in self.values(): |
| 270 | if isinstance(v, CfgNode): |
| 271 | v._immutable(is_immutable) |
| 272 | |
| 273 | def clone(self): |
| 274 | """Recursively copy this CfgNode.""" |