(self, cascade=False)
Set behavior if name is in self.parentBehavior.knownChildren.

        If cascade is True, unset behavior and parentBehavior for all
        descendants, then recalculate behavior and parentBehavior.
Set behavior if name is in self.parentBehavior.knownChildren.
Set behavior if name is in self . parentBehavior . knownChildren .
def autoBehavior(self, cascade=False):
        """
        Set behavior if name is in self.parentBehavior.knownChildren.

        If cascade is True, unset behavior and parentBehavior for all
        descendants, then recalculate behavior and parentBehavior.
        """
        parentBehavior = self.parentBehavior
        if parentBehavior is not None:
            knownChildTup = parentBehavior.knownChildren.get(self.name, None)
            if knownChildTup is not None:
                behavior = getBehavior(self.name, knownChildTup[2])
                if behavior is not None:
                    self.setBehavior(behavior, cascade)
                    if isinstance(self, ContentLine) and self.encoded:
                        self.behavior.decode(self)
            elif isinstance(self, ContentLine):
                self.behavior = parentBehavior.defaultBehavior
                if self.encoded and self.behavior:
                    self.behavior.decode(self)
def autoBehavior ( self , cascade = False ) : parentBehavior = self . parentBehavior if parentBehavior is not None : knownChildTup = parentBehavior . knownChildren . get ( self . name , None ) if knownChildTup is not None : behavior = getBehavior ( self . name , knownChildTup [ 2 ] ) if behavior is not None : self . setBehavior ( behavior , cascade ) if isinstance ( self , ContentLine ) and self . encoded : self . behavior . decode ( self ) elif isinstance ( self , ContentLine ) : self . behavior = parentBehavior . defaultBehavior if self . encoded and self . behavior : self . behavior . decode ( self )