Added possibility to overwrite app_dirname.
[toast/alpenzoo.git] / django_template_backend_genshi / __init__.py
index 17240a21685dad65da3fa1a867b4acb169b22399..85c338f3a4a2ecdee739554eec11c0e278203a31 100644 (file)
@@ -11,6 +11,7 @@ class GenshiEngine(django.template.backends.base.BaseEngine):
     def __init__(self, params):
         params = params.copy()
         options = params.pop('OPTIONS').copy()
+        self.app_dirname = options.get('app_dirname', self.app_dirname)
         super(GenshiEngine, self).__init__(params)
         loader = genshi.template.TemplateLoader(self.template_dirs, auto_reload=options['auto_reload'])
         self.loader = loader
@@ -27,7 +28,7 @@ class GenshiEngine(django.template.backends.base.BaseEngine):
     def get_template(self, template_name):
         try:
             template = self.loader.load(template_name)
-            return GenshiTemplateWrapper(self.loader.load(template_name))
+            return GenshiTemplateWrapper(template)
         except genshi.template.loader.TemplateNotFound as exc:
             raise django.template.TemplateDoesNotExist(exc.args)
         except genshi.template.base.TemplateSyntaxError as exc: