Philipp Hörist pushed to branch master at gajim / gajim
Commits:
bae95858 by Philipp Hörist at 2018-10-10T19:25:54Z
Dont overwrite user plugins with base plugins
- Dont load plugins without short_name
- Check with the short_name if a plugin is already loaded
- - - - -
1 changed file:
- gajim/plugins/pluginmanager.py
Changes:
=====================================
gajim/plugins/pluginmanager.py
=====================================
@@ -110,7 +110,7 @@ class PluginManager(metaclass=Singleton):
'''
for path in reversed(configpaths.get_plugin_dirs()):
- pc = PluginManager.scan_dir_for_plugins(path)
+ pc = self.scan_dir_for_plugins(path)
self.add_plugins(pc)
@log_calls('PluginManager')
@@ -137,7 +137,6 @@ class PluginManager(metaclass=Singleton):
and adding class from reloaded module or ignoring adding plug-in?
'''
plugin = plugin_class()
-
if plugin not in self.plugins:
if not self._plugin_has_entry_in_global_config(plugin):
self._create_plugin_entry_in_global_config(plugin)
@@ -520,9 +519,8 @@ class PluginManager(metaclass=Singleton):
def _set_plugin_active_in_global_config(self, plugin, active=True):
app.config.set_per('plugins', plugin.short_name, 'active', active)
- @staticmethod
@log_calls('PluginManager')
- def scan_dir_for_plugins(path, scan_dirs=True, package=False):
+ def scan_dir_for_plugins(self, path, scan_dirs=True, package=False):
r'''
Scans given directory for plugin classes.
@@ -584,6 +582,21 @@ class PluginManager(metaclass=Singleton):
elem_name, exc_info=True)
continue
+ short_name = conf.get('info', 'short_name', fallback=None)
+ if short_name is None:
+ log.error('No short_name defined for %s', elem_name)
+
+ # Check if the plugin is already loaded
+ try:
+ for plugin in self.plugins:
+ if plugin.short_name == short_name:
+ raise PluginAlreadyLoaded(
+ 'Skip Plugin %s because its '
+ 'already loaded' % elem_name)
+ except PluginAlreadyLoaded as error:
+ log.warning(error)
+ continue
+
min_v = conf.get('info', 'min_gajim_version', fallback=None)
max_v = conf.get('info', 'max_gajim_version', fallback=None)
@@ -734,3 +747,7 @@ class PluginManager(metaclass=Singleton):
for plugin in self.plugins:
if plugin.__path__ in plugin_dir:
return plugin
+
+
+class PluginAlreadyLoaded(Exception):
+ pass
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/bae95858aa0dacbabd82f598eb83ca7008…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/bae95858aa0dacbabd82f598eb83ca7008…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
84276aed by Philipp Hörist at 2018-10-07T18:51:51Z
Raise min nbxmpp version
- - - - -
1 changed file:
- gajim/gajim.py
Changes:
=====================================
gajim/gajim.py
=====================================
@@ -27,7 +27,7 @@ from distutils.version import LooseVersion as V
# Install _() in namespace
from gajim.common import i18n
-_MIN_NBXMPP_VER = "0.6.7"
+_MIN_NBXMPP_VER = "0.6.8"
_MIN_GTK_VER = "3.22.0"
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/84276aed430b19c17e69ac4613362091bf…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/84276aed430b19c17e69ac4613362091bf…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
084e5d6c by Philipp Hörist at 2018-10-07T16:19:57Z
Better fix for aa50da05
- - - - -
1 changed file:
- gajim/common/i18n.py
Changes:
=====================================
gajim/common/i18n.py
=====================================
@@ -67,7 +67,7 @@ def iter_locale_dirs():
continue
found_paths.append(locale_dir)
if locale_dir.is_dir():
- yield locale_dir
+ yield str(locale_dir)
def initialize_direction_mark():
from gi.repository import Gtk
@@ -150,7 +150,7 @@ if os.name == 'nt':
# Search for the translation in all locale dirs
for dir_ in iter_locale_dirs():
try:
- _translation = gettext.translation(DOMAIN, str(dir_))
+ _translation = gettext.translation(DOMAIN, dir_)
_ = _translation.gettext
except OSError:
continue
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/084e5d6ca7648298a949b77c43aca5b788…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/084e5d6ca7648298a949b77c43aca5b788…
You're receiving this email because of your account on dev.gajim.org.