look in correct ftp folder according to gajim version
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
[info]
|
||||
name: Plugin Installer
|
||||
short_name: plugin_installer
|
||||
version: 0.12
|
||||
version: 0.12.1
|
||||
description: Install and upgrade plugins from ftp
|
||||
authors: Denis Fomin <fominde@gmail.com>
|
||||
Yann Leboulanger <asterix@lagaule.org>
|
||||
|
||||
@@ -78,6 +78,12 @@ class PluginInstaller(GajimPlugin):
|
||||
icon = Gtk.Image()
|
||||
self.def_icon = icon.render_icon(Gtk.STOCK_PREFERENCES,
|
||||
Gtk.IconSize.MENU)
|
||||
if gajim.version.startswith('0.15'):
|
||||
self.server_folder = 'plugins_0.15'
|
||||
elif gajim.version.startswith('0.16.10'):
|
||||
self.server_folder = 'plugins_gtk3'
|
||||
else:
|
||||
self.server_folder = 'plugins_0.16'
|
||||
|
||||
@log_calls('PluginInstallerPlugin')
|
||||
def activate(self):
|
||||
@@ -118,7 +124,7 @@ class PluginInstaller(GajimPlugin):
|
||||
try:
|
||||
to_update = []
|
||||
con = self.ftp_connect()
|
||||
con.cwd('plugins_gtk3')
|
||||
con.cwd(self.server_folder)
|
||||
con.retrbinary('RETR manifests.zip', ftp.handleDownload)
|
||||
zip_file = zipfile.ZipFile(ftp.buffer_)
|
||||
manifest_list = zip_file.namelist()
|
||||
@@ -501,7 +507,7 @@ class Ftp(threading.Thread):
|
||||
GLib.idle_add(self.progressbar.set_text,
|
||||
_('Connecting to server'))
|
||||
self.ftp = self.plugin.ftp_connect()
|
||||
self.ftp.cwd('plugins_gtk3')
|
||||
self.ftp.cwd(self.plugin.server_folder)
|
||||
self.progressbar.set_show_text(True)
|
||||
if not self.remote_dirs:
|
||||
GLib.idle_add(self.progressbar.set_text,
|
||||
@@ -601,7 +607,7 @@ class Ftp(threading.Thread):
|
||||
else:
|
||||
files.append(i[1:])
|
||||
dirs, files = [], []
|
||||
nlstr('/plugins_gtk3/' + remote_dir)
|
||||
nlstr('/%s/%s' % (self.plugin.server_folder, remote_dir)
|
||||
|
||||
base_dir, user_dir = gajim.PLUGINS_DIRS
|
||||
if not os.path.isdir(user_dir):
|
||||
@@ -625,7 +631,7 @@ class Ftp(threading.Thread):
|
||||
GLib.idle_add(self.progressbar.set_text,
|
||||
_('Downloading "%s"') % filename)
|
||||
full_filename = os.path.join(local_dir, filename.replace(
|
||||
'plugins_gtk3', 'plugins'))
|
||||
self.plugin.server_folder, 'plugins'))
|
||||
try:
|
||||
file_ = open(full_filename, 'wb')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user