Fix plugin installation from zip
This commit is contained in:
parent
b5d3578e39
commit
6a49e2d869
|
@ -281,7 +281,7 @@ class PluginsWindow(object):
|
|||
|
||||
for i, row in enumerate(model):
|
||||
if plugin == row[Column.PLUGIN]:
|
||||
model.remove(model.get_iter((i, Column.PLUGIN)))
|
||||
model.remove(row.iter)
|
||||
break
|
||||
|
||||
iter_ = model.append([plugin, plugin.name, False,
|
||||
|
@ -308,7 +308,7 @@ class PluginsWindow(object):
|
|||
return
|
||||
model = self.installed_plugins_model
|
||||
iter_ = model.append([plugin, plugin.name, False,
|
||||
plugin.activatable], self.get_plugin_icon(plugin))
|
||||
plugin.activatable, self.get_plugin_icon(plugin)])
|
||||
sel = self.installed_plugins_treeview.get_selection()
|
||||
sel.select_iter(iter_)
|
||||
|
||||
|
|
|
@ -573,7 +573,7 @@ class PluginManager(metaclass=Singleton):
|
|||
|
||||
def install_from_zip(self, zip_filename, owerwrite=None):
|
||||
'''
|
||||
Install plagin from zip and return plugin
|
||||
Install plugin from zip and return plugin
|
||||
'''
|
||||
try:
|
||||
zip_file = zipfile.ZipFile(zip_filename)
|
||||
|
@ -595,7 +595,7 @@ class PluginManager(metaclass=Singleton):
|
|||
# members not safe
|
||||
raise PluginsystemError(_('Archive is malformed'))
|
||||
if filename.endswith('/') and filename.find('/', 0, -1) < 0:
|
||||
dirs.append(filename)
|
||||
dirs.append(filename.strip('/'))
|
||||
if 'manifest.ini' in filename.split('/')[1]:
|
||||
manifest = True
|
||||
if not manifest:
|
||||
|
@ -614,8 +614,8 @@ class PluginManager(metaclass=Singleton):
|
|||
|
||||
zip_file.extractall(user_dir)
|
||||
zip_file.close()
|
||||
path = os.path.join(user_dir, dirs[0])
|
||||
plugins = self.scan_dir_for_plugins(plugin_dir, False)
|
||||
|
||||
plugins = self.scan_dir_for_plugins(plugin_dir, package=True)
|
||||
if not plugins:
|
||||
return
|
||||
self.add_plugin(plugins[0])
|
||||
|
|
Loading…
Reference in New Issue