changeset 1343:c2fbae4f0adc

Delegate to component_manager with method object
author Thinker K.F. Li <thinker@codemud.net>
date Tue, 08 Feb 2011 13:35:21 +0800
parents 972d749b9656
children 8f1f8ef5c9ea
files pyink/domview.py
diffstat 1 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/pyink/domview.py	Tue Feb 08 13:05:07 2011 +0800
+++ b/pyink/domview.py	Tue Feb 08 13:35:21 2011 +0800
@@ -959,17 +959,15 @@
         self._layers = []
 
         self._comp_mgr = component_manager(self)
+        # Mixing-in component_manager to domview.
+        for attr in dir(self._comp_mgr):
+            if not attr.startswith('_'):
+                v = getattr(self._comp_mgr, attr)
+                setattr(self, attr, v)
+                pass
+            pass
 	pass
 
-    ## \brief Special method to get attribute.
-    #
-    # This method is here for delegating attribute accessing for
-    # mix-in.
-    #
-    def __getattr__(self, name):
-        val = getattr(self._comp_mgr, name)
-        return val
-
     ## \brief Create a scenes node if not existed.
     #
     def _init_metadata(self):