mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-12 19:30:11 +01:00
plugins are notified of exiting so they can save config etc
This commit is contained in:
@@ -15,6 +15,9 @@ class Plugin(object):
|
||||
self.description = 'UNKNOWN'
|
||||
self.pc = plugin_collection
|
||||
|
||||
def quit_plugin(self):
|
||||
print("quitting " + type(self).__name__)
|
||||
|
||||
class MidiFeedbackPlugin(Plugin):
|
||||
"""Base class for MIDI feedback plugins
|
||||
"""
|
||||
@@ -476,6 +479,10 @@ class PluginCollection(object):
|
||||
print("Looking for plugins under package %s" % self.plugin_package)
|
||||
self.walk_package(self.plugin_package)
|
||||
|
||||
def quit_plugins(self):
|
||||
# tell each plugin to quit
|
||||
for plugin in self.get_plugins():
|
||||
plugin.quit_plugin()
|
||||
|
||||
def get_plugins(self, clazz = None):
|
||||
if clazz:
|
||||
@@ -483,16 +490,6 @@ class PluginCollection(object):
|
||||
else:
|
||||
return [c for c in self.plugins if not c.disabled]
|
||||
|
||||
def apply_all_plugins_on_value(self, argument):
|
||||
"""Apply all of the plugins on the argument supplied to this function
|
||||
"""
|
||||
print()
|
||||
print('Applying all plugins on value %s:' %argument)
|
||||
for plugin in self.plugins:
|
||||
#print(" Applying %s on value %s yields value %s" % (plugin.description, argument, plugin.perform_operation(argument)))
|
||||
pass
|
||||
|
||||
|
||||
def walk_package(self, package):
|
||||
"""Recursively walk the supplied package to retrieve all plugins
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user