def get_subclass_from_module(module, parent_class):
    """
    Get a subclass of parent_class from the module at module

    get_subclass_from_module performs reflection to find the first class that
    extends the parent_class in the module path, and returns it.
    """
    try:
        r = __recursive_import(module)
        member_dict = dict(inspect.getmembers(r))
        sprinter_class = parent_class
        for v in member_dict.values():
            if inspect.isclass(v) and issubclass(v, parent_class) and v != parent_class:
                if sprinter_class is parent_class:
                    sprinter_class = v
        if sprinter_class is None:
            raise SprinterException("No subclass %s that extends %s exists in classpath!" % (module, str(parent_class)))
        return sprinter_class
    except ImportError:
        e = sys.exc_info()[1]
        raise e
def get_subclass_from_module ( module , parent_class ) : try : r = __recursive_import ( module ) member_dict = dict ( inspect . getmembers ( r ) ) sprinter_class = parent_class for v in member_dict . values ( ) : if inspect . isclass ( v ) and issubclass ( v , parent_class ) and v != parent_class : if sprinter_class is parent_class : sprinter_class = v if sprinter_class is None : raise SprinterException ( "No subclass %s that extends %s exists in classpath!" % ( module , str ( parent_class ) ) ) return sprinter_class except ImportError : e = sys . exc_info ( ) [ 1 ] raise e
Get a subclass of parent_class from the module at module

    get_subclass_from_module performs reflection to find the first class that
    extends the parent_class in the module path, and returns it.