Browse Source

added ParamObj __repr__

Darren Ranalli 20 years ago
parent
commit
7e222cf09c
1 changed files with 6 additions and 0 deletions
  1. 6 0
      direct/src/showbase/PythonUtil.py

+ 6 - 0
direct/src/showbase/PythonUtil.py

@@ -1104,6 +1104,12 @@ class ParamObj:
         # of the param was
         return self._priorValuesStack.top()[self._curParamStack.top()]
 
+    def __repr__(self):
+        argStr = ''
+        for param in self.ParamSet.getParams():
+            argStr += '%s=%s,' % (param, getSetter(self, param, 'get')())
+        return '%s(%s)' % (self.__class__.__name__, argStr)
+
 def bound(value, bound1, bound2):
     """
     returns value if value is between bound1 and bound2