Did I find the right examples for you? yes no

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

        def load_class_from_name(fqcn):
    # Break apart fqcn to get module and classname
    paths = fqcn.split('.')
    modulename = '.'.join(paths[:-1])
    classname = paths[-1]
    # Import the module
    __import__(modulename, globals(), locals(), ['*'])
    # Get the class
    cls = getattr(sys.modules[modulename], classname)
    # Check cls
    if not inspect.isclass(cls):
        raise TypeError("%s is not a class" % fqcn)
    # Return class
    return cls

src/f/o/forge-cli-0.2/forge/forge.py   forge-cli(Download)
import inspect
from util import load_class_from_name
from module import Module
        # Load class
        cls = load_class_from_name(fqcn)
        # Check if cls is subclass of Module
        if cls == Module or not issubclass(cls, Module):