From e225c565b279ba0e0c0b72069451694c8edc7c18 Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Tue, 12 Jul 2005 18:49:51 +0000 Subject: [PATCH] added POD.copyTo --- direct/src/showbase/PythonUtil.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 436df08007..6e555aa22c 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -1202,7 +1202,7 @@ class POD: raise "object '%s' doesn't have value '%s'" % (other, name) else: setattr(self, name, self.getDefaultValue(name)) - # support 'p = POD.POD().copyFrom(other)' + # support 'p = POD.POD().copyFrom(other)' syntax return self def makeCopy(self): # returns a duplicate of this object @@ -1730,6 +1730,11 @@ class Enum: def __len__(self): return len(self._stringTable) + def copyTo(self, obj): + # copies all members onto obj + for name, value in self._stringTable: + setattr(obj, name, value) + if __debug__: def _checkExistingMembers(self, items): for item in items: