default plugin icon added
plugins moved to /icons/plugins/PLUGINNAME
This commit is contained in:
parent
662be231b9
commit
5ca5164a50
5 changed files with 36 additions and 3 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue