Example #1
0
    def load(self):
        """Load the module for this plugin.

        @rtype: C{ModuleType}
        @return: The module object that is loaded.
        """
        return namedModule(self.module)
Example #2
0
    def load(self):
        """Load the module for this plugin.

        @rtype: C{ModuleType}
        @return: The module object that is loaded.
        """
        return namedModule(self.module)
Example #3
0
def latestClass(oldClass):
    """Get the latest version of a class.
    """
    module = reflect.namedModule(oldClass.__module__)
    newClass = getattr(module, oldClass.__name__)
    newBases = []
    for base in newClass.__bases__:
        newBases.append(latestClass(base))
    try:
        newClass.__bases__ = tuple(newBases)
        return newClass
    except TypeError:
        ctor = getattr(newClass, '__metaclass__', type)
        return ctor(newClass.__name__, tuple(newBases), dict(newClass.__dict__))
Example #4
0
def latestClass(oldClass):
    """Get the latest version of a class.
    """
    module = reflect.namedModule(oldClass.__module__)
    newClass = getattr(module, oldClass.__name__)
    newBases = []
    for base in newClass.__bases__:
        newBases.append(latestClass(base))

    try:
        # This makes old-style stuff work
        newClass.__bases__ = tuple(newBases)
        return newClass
    except TypeError:
        ctor = getattr(newClass, '__metaclass__', type)
        return ctor(newClass.__name__, tuple(newBases),
                    dict(newClass.__dict__))