def import_classes(name, currmodule):
 target = None
 if currmodule:
  target = try_import(((currmodule + '.') + name))
 if (target is None):
  target = try_import(name)
 if (target is None):
  raise InheritanceException(('Could not import class or module %r specified for inheritance diagram' % name))
 if inspect.isclass(target):
  return [target]
 elif inspect.ismodule(target):
  classes = []
  for cls in target.__dict__.values():
   if (inspect.isclass(cls) and (cls.__module__ == target.__name__)):
    classes.append(cls)
  return classes
 raise InheritanceException(('%r specified for inheritance diagram is not a class or module' % name))

def import_classes ( name , currmodule ) : target = None if currmodule : target = try_import ( ( ( currmodule + '.' ) + name ) ) if ( target is None ) : target = try_import ( name ) if ( target is None ) : raise InheritanceException ( ( 'Could not import class or module %r specified for inheritance diagram' % name ) ) if inspect . isclass ( target ) : return [ target ] elif inspect . ismodule ( target ) : classes = [ ] for cls in target . __dict__ . values ( ) : if ( inspect . isclass ( cls ) and ( cls . __module__ == target . __name__ ) ) : classes . append ( cls ) return classes raise InheritanceException ( ( '%r specified for inheritance diagram is not a class or module' % name ) )
import a class using its fully-qualified *name* .