Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
 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
Esempio n. 4
0
 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()
Esempio n. 5
0
 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
Esempio n. 6
0
 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
Esempio n. 7
0
 def get_dir(self):
     if self.value == PluginType.USER:
         return get_user_plugins_dir()
     elif self.value == PluginType.SYSTEM:
         return get_plugins_dir()
Esempio n. 8
0
 def get_dir(self):
     if self.value == PluginType.USER:
         return get_user_plugins_dir()
     elif self.value == PluginType.SYSTEM:
         return get_plugins_dir()