[plugin_installer] Use configpaths api for getting path
This commit is contained in:
@@ -49,6 +49,7 @@ try:
|
|||||||
from gtkgui_helpers import get_action
|
from gtkgui_helpers import get_action
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from gajim.common import app
|
from gajim.common import app
|
||||||
|
from gajim.common import configpaths
|
||||||
from gajim.plugins import GajimPlugin
|
from gajim.plugins import GajimPlugin
|
||||||
from gajim.plugins.gui import GajimPluginConfigDialog
|
from gajim.plugins.gui import GajimPluginConfigDialog
|
||||||
from gajim.htmltextview import HtmlTextView
|
from gajim.htmltextview import HtmlTextView
|
||||||
@@ -95,7 +96,7 @@ def get_local_version(plugin_manifest):
|
|||||||
if not active:
|
if not active:
|
||||||
return
|
return
|
||||||
manifest_path = os.path.join(
|
manifest_path = os.path.join(
|
||||||
app.PLUGINS_DIRS[1], short_name, 'manifest.ini')
|
configpaths.get('PLUGINS_USER'), short_name, 'manifest.ini')
|
||||||
if not os.path.exists(manifest_path):
|
if not os.path.exists(manifest_path):
|
||||||
return
|
return
|
||||||
conf = configparser.ConfigParser()
|
conf = configparser.ConfigParser()
|
||||||
@@ -294,7 +295,7 @@ class PluginInstaller(GajimPlugin):
|
|||||||
for _dir in plugin_dirs:
|
for _dir in plugin_dirs:
|
||||||
is_active = False
|
is_active = False
|
||||||
plugins = None
|
plugins = None
|
||||||
plugin_dir = os.path.join(app.PLUGINS_DIRS[1], _dir)
|
plugin_dir = os.path.join(configpaths.get('PLUGINS_USER'), _dir)
|
||||||
plugin = app.plugin_manager.get_plugin_by_path(plugin_dir)
|
plugin = app.plugin_manager.get_plugin_by_path(plugin_dir)
|
||||||
if plugin:
|
if plugin:
|
||||||
if plugin.active:
|
if plugin.active:
|
||||||
@@ -571,7 +572,7 @@ class DownloadAsync(threading.Thread):
|
|||||||
for remote_dir in self.remote_dirs:
|
for remote_dir in self.remote_dirs:
|
||||||
filename = remote_dir + '.zip'
|
filename = remote_dir + '.zip'
|
||||||
log.info('Download: %s', filename)
|
log.info('Download: %s', filename)
|
||||||
base_dir, user_dir = app.PLUGINS_DIRS
|
user_dir = configpaths.get('PLUGINS_USER')
|
||||||
if not os.path.isdir(user_dir):
|
if not os.path.isdir(user_dir):
|
||||||
os.mkdir(user_dir)
|
os.mkdir(user_dir)
|
||||||
local_dir = os.path.join(user_dir, remote_dir)
|
local_dir = os.path.join(user_dir, remote_dir)
|
||||||
|
|||||||
Reference in New Issue
Block a user