Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim-plugins.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Leboulanger <asterix@lagaule.org>2012-08-16 19:48:49 +0400
committerYann Leboulanger <asterix@lagaule.org>2012-08-16 19:48:49 +0400
commit8e56bbf476b439f53332444e5ff5f1c9264404d9 (patch)
tree992367c53ba27e1626c661444f70f89618a8ceb3 /plugin_installer
parente773f9d0ef43b7e9869162813aac0d7f48a1bcf7 (diff)
load icons from ftp server
Diffstat (limited to 'plugin_installer')
-rw-r--r--plugin_installer/manifest.ini2
-rw-r--r--plugin_installer/plugin_installer.py20
2 files changed, 14 insertions, 8 deletions
diff --git a/plugin_installer/manifest.ini b/plugin_installer/manifest.ini
index 96fa00f..04c65b0 100644
--- a/plugin_installer/manifest.ini
+++ b/plugin_installer/manifest.ini
@@ -1,7 +1,7 @@
[info]
name: Plugin Installer
short_name: plugin_installer
-version: 0.10.1
+version: 0.10.2
description: Install and upgrade plugins from ftp
authors: Denis Fomin <fominde@gmail.com>
Yann Leboulanger <asterix@lagaule.org>
diff --git a/plugin_installer/plugin_installer.py b/plugin_installer/plugin_installer.py
index e13d410..b97ecb8 100644
--- a/plugin_installer/plugin_installer.py
+++ b/plugin_installer/plugin_installer.py
@@ -463,11 +463,13 @@ class Ftp(threading.Thread):
if not self.remote_dirs:
gobject.idle_add(self.progressbar.set_text,
_('Scan files on the server'))
- self.ftp.retrbinary('RETR manifests.zip', self.handleDownload)
+ self.ftp.retrbinary('RETR manifests_images.zip', self.handleDownload)
zip_file = zipfile.ZipFile(self.buffer_)
manifest_list = zip_file.namelist()
progress_step = 1.0 / len(manifest_list)
for filename in manifest_list:
+ if not filename.endswith('manifest.ini'):
+ continue
dir_ = filename.split('/')[0]
fract = self.progressbar.get_fraction() + progress_step
gobject.idle_add(self.progressbar.set_fraction, fract)
@@ -487,15 +489,19 @@ class Ftp(threading.Thread):
gobject.idle_add(
self.plugin.inslall_upgrade_button.set_property,
'sensitive', True)
- def_icon = self.def_icon
+ png_filename = dir_ + '/' + dir_ + '.png'
+ if png_filename in manifest_list:
+ data = zip_file.open(png_filename).read()
+ pbl = gtk.gdk.PixbufLoader()
+ pbl.set_size(16, 16)
+ pbl.write(data)
+ pbl.close()
+ def_icon = pbl.get_pixbuf()
+ else:
+ def_icon = self.def_icon
if local_version:
base_dir, user_dir = gajim.PLUGINS_DIRS
local_dir = os.path.join(user_dir, dir_)
- icon_name = dir_ + '.png'
- filename = os.path.join(local_dir, icon_name)
- if os.path.isfile(filename):
- def_icon = gtk.gdk.pixbuf_new_from_file_at_size(
- filename, 16, 16)
gobject.idle_add(self.model_append, [def_icon, dir_,
self.config.get('info', 'name'), local_version,