You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2013/06/08 01:42:11 UTC

[16/27] git commit: [#6325] Moving fixed 'templates' to instance property, update doc

[#6325] Moving fixed 'templates' to instance property, update doc

Signed-off-by: Nicholas Bollweg (Nick) <ni...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/cf0d391c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/cf0d391c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/cf0d391c

Branch: refs/heads/db/6276
Commit: cf0d391c7f3edca49b6f2617a71e8c59081e859a
Parents: 2d39c61
Author: Nicholas Bollweg (Nick) <ni...@gmail.com>
Authored: Tue Feb 7 18:02:46 2012 -0500
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Jun 4 20:51:31 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/package_path_loader.py |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cf0d391c/Allura/allura/lib/package_path_loader.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/package_path_loader.py b/Allura/allura/lib/package_path_loader.py
index a88a061..aee8e1a 100644
--- a/Allura/allura/lib/package_path_loader.py
+++ b/Allura/allura/lib/package_path_loader.py
@@ -45,7 +45,7 @@ For the examples, assume the following directory structure:
 To override the above example, a Tool implementer would
 add the following line to their Tool's setup.py:
 
-    [theme.override]
+    [allura.theme.override]
     newtool = newtool.app:NewToolApp
 
 Then, in the neighbor path (see below) for the file containing the
@@ -102,7 +102,9 @@ class PackagePathLoader(jinja2.BaseLoader):
     the same with other Tools.
     '''
     def __init__(self, override_entrypoint='allura.theme.override',
-                default_paths=None):
+                default_paths=None,
+                override_root='override',
+                ):
         '''
         Set up initial values... defaults are for Allura.
         '''
@@ -116,6 +118,7 @@ class PackagePathLoader(jinja2.BaseLoader):
 
         self.override_entrypoint = override_entrypoint
         self.default_paths = default_paths
+        self.override_root = override_root
 
         # Finally instantiate the loader
         self.fs_loader = jinja2.FileSystemLoader(self.init_paths())
@@ -197,11 +200,11 @@ class PackagePathLoader(jinja2.BaseLoader):
             # the default allura behavior
             package, path = template.split(':')
             # TODO: is there a better way to do this?
-            path_fragment = os.path.join('templates', package, path)
+            path_fragment = os.path.join(self.override_root, package, path)
         elif len(bits) == 1:
             # TODO: is this even useful?
             path = bits[0]
-            path_fragment = os.path.join('templates', path)
+            path_fragment = os.path.join(self.override_root, path)
         else:
             raise Exception('malformed template path')