You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/06/03 20:56:23 UTC
[2/7] 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/f1003777
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f1003777
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f1003777
Branch: refs/heads/cj/6325
Commit: f100377702e975cec2e98b524d5bdeda4a745443
Parents: c9192e6
Author: Nicholas Bollweg (Nick) <ni...@gmail.com>
Authored: Tue Feb 7 18:02:46 2012 -0500
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Mon Jun 3 18:55:32 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/f1003777/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')