Create a clone of the resource object. If ``__name__`` or ``__parent__`` arguments are passed, use these values to override the existing ``__name__`` or ``__parent__`` of the resource. If any extra keyword args are passed in via the ``kw`` argument, use these keywor
(self, __name__=_marker, __parent__=_marker, **kw)
| 213 | return name in self.subs |
| 214 | |
| 215 | def clone(self, __name__=_marker, __parent__=_marker, **kw): |
| 216 | """Create a clone of the resource object. If ``__name__`` or |
| 217 | ``__parent__`` arguments are passed, use these values to |
| 218 | override the existing ``__name__`` or ``__parent__`` of the |
| 219 | resource. If any extra keyword args are passed in via the ``kw`` |
| 220 | argument, use these keywords to add to or override existing |
| 221 | resource keywords (attributes).""" |
| 222 | oldkw = self.kw.copy() |
| 223 | oldkw.update(kw) |
| 224 | inst = self.__class__(self.__name__, self.__parent__, **oldkw) |
| 225 | inst.subs = copy.deepcopy(self.subs) |
| 226 | if __name__ is not _marker: |
| 227 | inst.__name__ = __name__ |
| 228 | if __parent__ is not _marker: |
| 229 | inst.__parent__ = __parent__ |
| 230 | return inst |
| 231 | |
| 232 | |
| 233 | DummyModel = DummyResource # b/w compat (forever) |
no test coverage detected