def register_plugin_class(base_class, file_path, class_name):
 plugin_dir = os.path.dirname(os.path.realpath(file_path))
 _register_plugin_path(plugin_dir)
 module_name = _get_plugin_module(file_path)
 if (module_name is None):
  return None
 module = imp.load_source(module_name, file_path)
 klass = getattr(module, class_name, None)
 if (not klass):
  raise Exception(('Plugin file "%s" doesn\'t expose class named "%s"' % (file_path, class_name)))
 _register_plugin(base_class, klass)
 return klass

def register_plugin_class ( base_class , file_path , class_name ) : plugin_dir = os . path . dirname ( os . path . realpath ( file_path ) ) _register_plugin_path ( plugin_dir ) module_name = _get_plugin_module ( file_path ) if ( module_name is None ) : return None module = imp . load_source ( module_name , file_path ) klass = getattr ( module , class_name , None ) if ( not klass ) : raise Exception ( ( 'Plugin file "%s" doesn\'t expose class named "%s"' % ( file_path , class_name ) ) ) _register_plugin ( base_class , klass ) return klass
retrieve a register plugin class from the provided file .