Example #1
0
    def changed(self, originally_changed):
        """We, or something we depend on, have changed
        """
        try:
            del self._v_attrs
        except AttributeError:
            pass

        implied = self._implied
        implied.clear()

        ancestors = ro(self)

        try:
            if Interface not in ancestors:
                ancestors.append(Interface)
        except NameError:
            pass # defining Interface itself

        self.__sro__ = tuple(ancestors)
        self.__iro__ = tuple([ancestor for ancestor in ancestors
                              if isinstance(ancestor, InterfaceClass)
                              ])

        for ancestor in ancestors:
            # We directly imply our ancestors:
            implied[ancestor] = ()

        # Now, advise our dependents of change:
        for dependent in self.dependents.keys():
            dependent.changed(originally_changed)
Example #2
0
    def changed(self, originally_changed):
        """We, or something we depend on, have changed
        """
        try:
            del self._v_attrs
        except AttributeError:
            pass

        implied = self._implied
        implied.clear()

        ancestors = ro(self)

        try:
            if Interface not in ancestors:
                ancestors.append(Interface)
        except NameError:
            pass  # defining Interface itself

        self.__sro__ = tuple(ancestors)
        self.__iro__ = tuple([
            ancestor for ancestor in ancestors
            if isinstance(ancestor, InterfaceClass)
        ])

        for ancestor in ancestors:
            # We directly imply our ancestors:
            implied[ancestor] = ()

        # Now, advise our dependents of change:
        for dependent in self.dependents.keys():
            dependent.changed(originally_changed)
Example #3
0
 def _setBases(self, bases):
     self.__dict__['__bases__'] = bases
     self.ro = ro.ro(self)
     self.changed(self)
Example #4
0
 def _setBases(self, bases):
     self.__dict__['__bases__'] = bases
     self.ro = ro.ro(self)
     self.changed(self)