comparison 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
comparison
equal deleted inserted replaced
3639:05db744f194f 3661:cbb988a6f507
226 try: 226 try:
227 self._import_plugins() 227 self._import_plugins()
228 ui_contact_list.ContactList(self) 228 ui_contact_list.ContactList(self)
229 ui_profile_manager.ProfileManager(self) 229 ui_profile_manager.ProfileManager(self)
230 except Exception as e: 230 except Exception as e:
231 log.error( 231 log.error(f"Could not initialize backend: {e}")
232 _("Could not initialize backend: {reason}").format(
233 reason=str(e).decode("utf-8", "ignore")
234 )
235 )
236 sys.exit(1) 232 sys.exit(1)
237 self._addBaseMenus() 233 self._addBaseMenus()
238 234
239 self.initialised.callback(None) 235 self.initialised.callback(None)
240 log.info(_("Backend is ready")) 236 log.info(_("Backend is ready"))
342 import_name = plugin_info["import_name"] 338 import_name = plugin_info["import_name"]
343 339
344 plugin_modes = plugin_info["modes"] = set( 340 plugin_modes = plugin_info["modes"] = set(
345 plugin_info.setdefault("modes", C.PLUG_MODE_DEFAULT) 341 plugin_info.setdefault("modes", C.PLUG_MODE_DEFAULT)
346 ) 342 )
343 if not plugin_modes.intersection(C.PLUG_MODE_BOTH):
344 log.error(
345 f"Can't import plugin at {plugin_path}, invalid {C.PI_MODES!r} "
346 f"value: {plugin_modes!r}"
347 )
348 continue
347 349
348 # if the plugin is an entry point, it must work in component mode 350 # if the plugin is an entry point, it must work in component mode
349 if plugin_info["type"] == C.PLUG_TYPE_ENTRY_POINT: 351 if plugin_info["type"] == C.PLUG_TYPE_ENTRY_POINT:
350 # if plugin is an entrypoint, we cache it 352 # if plugin is an entrypoint, we cache it
351 if C.PLUG_MODE_COMPONENT not in plugin_modes: 353 if C.PLUG_MODE_COMPONENT not in plugin_modes: