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