(self)
Initialize companion classes.
Initialize companion classes.
Initialize companion classes .
def initialize_companion_classes(self):
        """Initialize companion classes."""
        # default companion classes
        if not getattr(self, "companion_classes", None):
            self.set_companion_classes()
        
        # create the managers
        for key, val in self.companion_classes.iteritems():
            log_debug("Initializing '%s'" % key)
            obj = val(self)
            setattr(self, key, obj)
        
        # link all managers
        for key, val in self.companion_classes.iteritems():
            for child_key, child_val in self.companion_classes.iteritems():
                # no self-reference
                if child_key == key:
                    continue
                obj = getattr(self, key)
                setattr(obj, child_key, getattr(self, child_key))
        
        self.interaction_manager.constrain_navigation = self.constrain_navigation        
        self.companion_classes_initialized = True
def initialize_companion_classes ( self ) : # default companion classes if not getattr ( self , "companion_classes" , None ) : self . set_companion_classes ( ) # create the managers for key , val in self . companion_classes . iteritems ( ) : log_debug ( "Initializing '%s'" % key ) obj = val ( self ) setattr ( self , key , obj ) # link all managers for key , val in self . companion_classes . iteritems ( ) : for child_key , child_val in self . companion_classes . iteritems ( ) : # no self-reference if child_key == key : continue obj = getattr ( self , key ) setattr ( obj , child_key , getattr ( self , child_key ) ) self . interaction_manager . constrain_navigation = self . constrain_navigation self . companion_classes_initialized = True