diff sat/core/sat_main.py @ 3661:cbb988a6f507

merge bookmark `@`
author Goffi <goffi@goffi.org>
date Wed, 08 Sep 2021 11:20:37 +0200
parents 7bc443253b7c 760f3ff05092
children 16e36f0dd1cb
line wrap: on
line diff
--- a/sat/core/sat_main.py	Wed Sep 01 15:25:02 2021 +0200
+++ b/sat/core/sat_main.py	Wed Sep 08 11:20:37 2021 +0200
@@ -228,11 +228,7 @@
             ui_contact_list.ContactList(self)
             ui_profile_manager.ProfileManager(self)
         except Exception as e:
-            log.error(
-                _("Could not initialize backend: {reason}").format(
-                    reason=str(e).decode("utf-8", "ignore")
-                )
-            )
+            log.error(f"Could not initialize backend: {e}")
             sys.exit(1)
         self._addBaseMenus()
 
@@ -344,6 +340,12 @@
             plugin_modes = plugin_info["modes"] = set(
                 plugin_info.setdefault("modes", C.PLUG_MODE_DEFAULT)
             )
+            if not plugin_modes.intersection(C.PLUG_MODE_BOTH):
+                log.error(
+                    f"Can't import plugin at {plugin_path}, invalid {C.PI_MODES!r} "
+                    f"value: {plugin_modes!r}"
+                )
+                continue
 
             # if the plugin is an entry point, it must work in component mode
             if plugin_info["type"] == C.PLUG_TYPE_ENTRY_POINT: