diff --git a/deluge/ui/webui/components.py b/deluge/ui/webui/components.py index 3a2f8abec..7457c0c68 100644 --- a/deluge/ui/webui/components.py +++ b/deluge/ui/webui/components.py @@ -175,12 +175,28 @@ class ConfigPageManager(component.Component): def unregister(self, name): del self.blocks[name] +class PluginApi(component.Component): + """ + """ + def __init__(self): + component.Component.__init__(self, "WebPluginApi") + import web + from render import render + import page_decorators as deco + + self.render = render + self.web = web + self.deco = deco + self.page_manager = component.get("PageManager") + def register(): __plugin_manager = PluginManager() __menu_manager = MenuManager() __page_manager = PageManager() __config_page_manager = ConfigPageManager() + __plugin_api = PluginApi() + diff --git a/deluge/ui/webui/render.py b/deluge/ui/webui/render.py index 67d2dbf87..8800364e3 100644 --- a/deluge/ui/webui/render.py +++ b/deluge/ui/webui/render.py @@ -48,11 +48,11 @@ class subclassed_render(object): """ def __init__(self): self.apply_cfg() + self.plugin_renderers = [] def apply_cfg(self): self.cache = config.get('cache_templates') self.renderers = [] - self.plugin_renderers = [] self.template_cache = {} self.webui_path = os.path.dirname(__file__) @@ -70,7 +70,7 @@ class subclassed_render(object): @logcall def register_template_path(self, path): - self.plugin_renderers.append(template.render(path)) + self.plugin_renderers.append(template.render(path , cache=False)) @logcall def unregister_template_path(self, path):