incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [1/6] git commit: Moving fixed 'templates' to instance property, update doc
Date Mon, 03 Jun 2013 14:24:07 GMT
Updated Branches:
  refs/heads/cj/merge-request-4 [created] 7b9bae5bb


Moving fixed 'templates' to instance property, update doc

Signed-off-by: Nicholas Bollweg (Nick) <nick.bollweg@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/055f113c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/055f113c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/055f113c

Branch: refs/heads/cj/merge-request-4
Commit: 055f113c50921101f0c28c61d68e87c85f396168
Parents: 31d234b
Author: Nicholas Bollweg (Nick) <nick.bollweg@gmail.com>
Authored: Tue Feb 7 18:02:46 2012 -0500
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Thu May 30 21:09:06 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/055f113c/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')
 


Mime
View raw message