|
|
|
@ -20,6 +20,29 @@ class WebInterfacePlugins:
|
|
|
|
|
#setattr(getattr(self, plname), "stream_respones", True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class IconHandler:
|
|
|
|
|
|
|
|
|
|
def __init__(self, plugins):
|
|
|
|
|
self.plugins = PluginIconHandler(plugins)
|
|
|
|
|
self.plugins.exposed = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PluginIconHandler:
|
|
|
|
|
|
|
|
|
|
def __init__(self, plugins):
|
|
|
|
|
for plugin in plugins.getPlugins():
|
|
|
|
|
if not plugin: continue
|
|
|
|
|
plname = plugin.getName()
|
|
|
|
|
## this should be the "easiest" way to expose all plugins as URLs
|
|
|
|
|
x = lambda: plugin.getIcon()
|
|
|
|
|
print x
|
|
|
|
|
print plugin.getIcon
|
|
|
|
|
def getIcon(p):
|
|
|
|
|
return p.getIcon()
|
|
|
|
|
setattr(self, plname, plugin.getIcon)
|
|
|
|
|
## the function is exposed in the CryptoBoxPlugin class - it did not work here
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class WebInterfaceSites:
|
|
|
|
|
'''
|
|
|
|
@ -46,6 +69,8 @@ class WebInterfaceSites:
|
|
|
|
|
## publish the url "/system" as an alias for "/plugins"
|
|
|
|
|
self.plugins.index = self.system
|
|
|
|
|
self.dataset = WebInterfaceDataset.WebInterfaceDataset(self.cbox, self.prefs, self.pluginList.getPlugins())
|
|
|
|
|
## publish plugin icons
|
|
|
|
|
self.icons = IconHandler(self.pluginList)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __check_config(self):
|
|
|
|
|