Skip to content
Snippets Groups Projects
Commit fc796b97 authored by Dicson's avatar Dicson
Browse files

PluginInstaller. fix install(update)

parent 1995f71f
No related branches found
No related tags found
No related merge requests found
......@@ -424,7 +424,8 @@ class PluginInstaller(GajimPlugin):
file_path))
# read metadata from manifest.ini
conf.readfp(open(manifest_path, 'r'))
with open(manifest_path) as _file:
conf.read_file(_file)
for option in fields:
if conf.get('info', option) is '':
raise configparser.NoOptionError('field empty')
......@@ -582,7 +583,7 @@ class Ftp(threading.Thread):
else:
files.append(i[1:])
dirs, files = [], []
nlstr('/plugins/' + remote_dir)
nlstr('/plugins_gtk3/' + remote_dir)
base_dir, user_dir = gajim.PLUGINS_DIRS
if not os.path.isdir(user_dir):
......@@ -605,14 +606,16 @@ class Ftp(threading.Thread):
for filename in files:
GObject.idle_add(self.progressbar.set_text,
_('Downloading "%s"') % filename)
full_filename = os.path.join(local_dir, filename)
full_filename = os.path.join(local_dir, filename.replace(
'plugins_gtk3', 'plugins'))
try:
file_ = open(full_filename, 'wb')
self.ftp.retrbinary('RETR /%s' % filename,
file_.write)
file_.close()
except ftplib.error_perm:
print('ERROR: cannot read file "%s"' % filename)
except ftplib.all_errors as e:
print (str(e))
os.unlink(filename)
self.ftp.quit()
GObject.idle_add(self.window.emit, 'plugin_downloaded',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment