changeset 2abcffe15a5a in /home/hg/repos/gajim-plugins
buthor: Yann Leboulanger asterix@lagaule.org ranches: gtk3 details:gajim-plugins?cmd=changeset;node=2abcffe15a5a description: look in correct ftp folder according to gajim version
diffstat:
plugin_installer/manifest.ini | 2 +- plugin_installer/plugin_installer.py | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-)
diffs (64 lines):
diff -r bae3729097d8 -r 2abcffe15a5a plugin_installer/manifest.ini --- a/plugin_installer/manifest.ini Sat Aug 24 14:38:46 2013 +0400 +++ b/plugin_installer/manifest.ini Wed Aug 28 13:16:43 2013 +0200 @@ -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 diff -r bae3729097d8 -r 2abcffe15a5a plugin_installer/plugin_installer.py --- a/plugin_installer/plugin_installer.py Sat Aug 24 14:38:46 2013 +0400 +++ b/plugin_installer/plugin_installer.py Wed Aug 28 13:16:43 2013 +0200 @@ -78,6 +78,12 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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')