def _import_plugin(module_name, plugin_path, modnames, modlist):
 if (module_name in modnames):
  return
 try:
  mock = _ModuleMock()
  mock.LOCALEPATH = osp.join(plugin_path, module_name, 'locale')
  sys.modules[module_name] = mock
  if osp.isdir(osp.join(plugin_path, module_name)):
   module = _import_module_from_path(module_name, plugin_path)
  else:
   module = None
  if module:
   sys.modules[module_name] = module
   modlist.append(module)
   modnames.append(module_name)
 except Exception:
  sys.stderr.write('ERROR: 3rd party plugin import failed for `{0}`\n'.format(module_name))
  traceback.print_exc(file=sys.stderr)

def _import_plugin ( module_name , plugin_path , modnames , modlist ) : if ( module_name in modnames ) : return try : mock = _ModuleMock ( ) mock . LOCALEPATH = osp . join ( plugin_path , module_name , 'locale' ) sys . modules [ module_name ] = mock if osp . isdir ( osp . join ( plugin_path , module_name ) ) : module = _import_module_from_path ( module_name , plugin_path ) else : module = None if module : sys . modules [ module_name ] = module modlist . append ( module ) modnames . append ( module_name ) except Exception : sys . stderr . write ( 'ERROR: 3rd party plugin import failed for `{0}`\n' . format ( module_name ) ) traceback . print_exc ( file = sys . stderr )
import the plugin module_name from plugin_path .