mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-06 00:10:07 +01:00
fix WJSendPlugin so that it doesn't crash if it can't open a serial device
This commit is contained in:
@@ -122,6 +122,9 @@ class Data(object):
|
||||
def get_enabled_plugin_class_names(self):
|
||||
return [k for k, v in self.enabled_plugins.items() if v is True]
|
||||
|
||||
def disable_plugin(self, plugin_class_name):
|
||||
del self.enabled_plugins[plugin_class_name]
|
||||
|
||||
def compare_plugins_list(self):
|
||||
current_plugins = [type(plugin).__name__ for plugin in self.plugins.get_plugins(include_disabled=True)]
|
||||
plugins_to_add = set(current_plugins) - set(self.enabled_plugins.keys())
|
||||
|
||||
@@ -234,7 +234,7 @@ class WJSendPlugin(ActionsPlugin, SequencePlugin, DisplayPlugin, ModulationRecei
|
||||
|
||||
except Exception as e:
|
||||
print("WJSendPlugin>> open_serial failed: " + str(type(e)))
|
||||
self.disabled = True
|
||||
self.pc.data.disable_plugin('WJSendPlugin')
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user