File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77from .application import application
88from .signals import signals
99from .settings import ab_settings , project_settings
10- from .controllers import *
1110from .info import __version__ as version
1211from .layouts .main import MainWindow
1312from .plugin import Plugin
13+ from .controllers import *
1414
1515
1616def load_settings () -> None :
Original file line number Diff line number Diff line change @@ -41,14 +41,21 @@ def load_plugin(self, name):
4141 importlib .reload (plugin_lib )
4242 return plugin_lib .Plugin ()
4343 except Exception as e :
44- log .error ("Error: Import of plugin {} failed" . format ( name ), error = e )
44+ log .error (f" Import of plugin ' { name } ' failed: { e } " )
4545
4646 def add_plugin (self , name , select : bool = True ):
4747 """add or reload tabs of the given plugin"""
4848 if select :
4949 plugin = self .plugins [name ]
5050 # Apply plugin load() function
51- plugin .load ()
51+ try :
52+ plugin .load ()
53+ except Exception as e :
54+ log .warning (f"Failed to load plugin '{ name } ' due to an error in the plugin, ignoring plugin. "
55+ "If this keeps happening contact the plugin developers and let them know of this error:"
56+ f"\n { e } " )
57+ return
58+
5259 # Add plugins tabs
5360 for tab in plugin .tabs :
5461 application .main_window .add_tab_to_panel (
@@ -78,7 +85,7 @@ def reload_plugins(self):
7885 try :
7986 self .add_plugin (name )
8087 except :
81- log .error (f"Error: plugin { name } not installed" )
88+ log .warning (f"Tried to load plugin ' { name } ' but it is not installed, ignoring plugin " )
8289
8390 def close (self ):
8491 """close all plugins"""
You can’t perform that action at this time.
0 commit comments