(self, model, initial=None)
Extends transitions.core.Machine.add_model by applying a custom 'to' function to
            the added model.
Extends transitions.core.Machine.add_model by applying a custom 'to' function to
            the added model.
Extends transitions . core . Machine . add_model by applying a custom to function to the added model .
def add_model(self, model, initial=None):
        """ Extends transitions.core.Machine.add_model by applying a custom 'to' function to
            the added model.
        """
        _super(HierarchicalMachine, self).add_model(model, initial=initial)
        models = listify(model)
        for mod in models:
            mod = self if mod is self.self_literal else mod
            # TODO: Remove 'mod != self' in 0.7.0
            if hasattr(mod, 'to') and mod != self:
                _LOGGER.warning("%sModel already has a 'to'-method. It will NOT "
                                "be overwritten by NestedMachine", self.name)
            else:
                to_func = partial(self.to_state, mod)
                setattr(mod, 'to', to_func)
def add_model ( self , model , initial = None ) : _super ( HierarchicalMachine , self ) . add_model ( model , initial = initial ) models = listify ( model ) for mod in models : mod = self if mod is self . self_literal else mod # TODO: Remove 'mod != self' in 0.7.0 if hasattr ( mod , 'to' ) and mod != self : _LOGGER . warning ( "%sModel already has a 'to'-method. It will NOT " "be overwritten by NestedMachine" , self . name ) else : to_func = partial ( self . to_state , mod ) setattr ( mod , 'to' , to_func )