From 203cce4378f142bf6e170ad4d14e877b4165d08b Mon Sep 17 00:00:00 2001 From: Max Goodman Date: Sun, 9 Sep 2012 12:51:37 -0700 Subject: [PATCH] plugins: Single template_dir and precedence over base templates. --- r2/r2/lib/plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/r2/r2/lib/plugin.py b/r2/r2/lib/plugin.py index cfa1a5a8a..c3c2fea0e 100644 --- a/r2/r2/lib/plugin.py +++ b/r2/r2/lib/plugin.py @@ -45,9 +45,9 @@ class Plugin(object): return os.path.dirname(module.__file__) @property - def template_dirs(self): + def template_dir(self): """Add module/templates/ as a template directory.""" - return [os.path.join(self.path, 'templates')] + return os.path.join(self.path, 'templates') @property def static_dir(self): @@ -119,7 +119,7 @@ class PluginLoader(object): # Load plugin g.config.add_spec(plugin.config) - config['pylons.paths']['templates'].extend(plugin.template_dirs) + config['pylons.paths']['templates'].insert(0, plugin.template_dir) plugin.add_js() plugin.on_load()