def _setup_plugins_dir(self): plugins_dir = get_plugins_dir() user_plugins_dir = get_user_plugins_dir() if os.path.exists(plugins_dir): self.engine.add_search_path(plugins_dir) if os.path.exists(user_plugins_dir): self.engine.add_search_path(user_plugins_dir)
def _setup_plugins_dir(self): plugins_dir = get_plugins_dir() user_plugins_dir = get_user_plugins_dir() if os.path.exists(plugins_dir): self.engine.add_search_path(plugins_dir) if os.path.exists(plugins_dir): self.engine.add_search_path(user_plugins_dir)
def get_plugin_type(cls, plugin_info): """Gets the PluginType for the specified Peas.PluginInfo.""" paths = [plugin_info.get_data_dir(), get_plugins_dir()] if os.path.commonprefix(paths) == get_plugins_dir(): return PluginType.SYSTEM return PluginType.USER
def get_dir(self): """Returns the directory where this type of plugins can be found.""" if self.value == PluginType.USER: return get_user_plugins_dir() elif self.value == PluginType.SYSTEM: return get_plugins_dir()
def get_plugin_type(cls, plugin_info): paths = [plugin_info.get_data_dir(), get_plugins_dir()] if os.path.commonprefix(paths) == get_plugins_dir(): return PluginType.SYSTEM return PluginType.USER
def get_dir(self): if self.value == PluginType.USER: return get_user_plugins_dir() elif self.value == PluginType.SYSTEM: return get_plugins_dir()