fix plugin-templating

This commit is contained in:
Martijn Voncken 2008-07-05 11:22:16 +00:00
parent 0acd13aaca
commit 14d6dd55bc
2 changed files with 18 additions and 2 deletions

View File

@ -175,12 +175,28 @@ class ConfigPageManager(component.Component):
def unregister(self, name): def unregister(self, name):
del self.blocks[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(): def register():
__plugin_manager = PluginManager() __plugin_manager = PluginManager()
__menu_manager = MenuManager() __menu_manager = MenuManager()
__page_manager = PageManager() __page_manager = PageManager()
__config_page_manager = ConfigPageManager() __config_page_manager = ConfigPageManager()
__plugin_api = PluginApi()

View File

@ -48,11 +48,11 @@ class subclassed_render(object):
""" """
def __init__(self): def __init__(self):
self.apply_cfg() self.apply_cfg()
self.plugin_renderers = []
def apply_cfg(self): def apply_cfg(self):
self.cache = config.get('cache_templates') self.cache = config.get('cache_templates')
self.renderers = [] self.renderers = []
self.plugin_renderers = []
self.template_cache = {} self.template_cache = {}
self.webui_path = os.path.dirname(__file__) self.webui_path = os.path.dirname(__file__)
@ -70,7 +70,7 @@ class subclassed_render(object):
@logcall @logcall
def register_template_path(self, path): def register_template_path(self, path):
self.plugin_renderers.append(template.render(path)) self.plugin_renderers.append(template.render(path , cache=False))
@logcall @logcall
def unregister_template_path(self, path): def unregister_template_path(self, path):