Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
58f05f36
Commit
58f05f36
authored
Mar 18, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2840 from ionis-education-group/double-edxmako-startup
Add method to clear mako template lookups
parents
32fd0737
efa8bd67
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
common/djangoapps/edxmako/__init__.py
+1
-1
common/djangoapps/edxmako/paths.py
+7
-0
common/djangoapps/edxmako/startup.py
+2
-1
No files found.
common/djangoapps/edxmako/__init__.py
View file @
58f05f36
...
...
@@ -13,4 +13,4 @@
# limitations under the License.
LOOKUP
=
{}
from
.paths
import
add_lookup
,
lookup_template
from
.paths
import
add_lookup
,
lookup_template
,
clear_lookups
common/djangoapps/edxmako/paths.py
View file @
58f05f36
...
...
@@ -22,6 +22,13 @@ class DynamicTemplateLookup(TemplateLookup):
self
.
directories
.
append
(
os
.
path
.
normpath
(
directory
))
def
clear_lookups
(
namespace
):
"""
Remove mako template lookups for the given namespace.
"""
if
namespace
in
LOOKUP
:
del
LOOKUP
[
namespace
]
def
add_lookup
(
namespace
,
directory
,
package
=
None
):
"""
Adds a new mako template lookup directory to the given namespace.
...
...
common/djangoapps/edxmako/startup.py
View file @
58f05f36
...
...
@@ -2,7 +2,7 @@
Initialize the mako template lookup
"""
from
django.conf
import
settings
from
.
import
add_lookup
from
.
import
add_lookup
,
clear_lookups
def
run
():
...
...
@@ -14,5 +14,6 @@ def run():
"""
template_locations
=
settings
.
MAKO_TEMPLATES
for
namespace
,
directories
in
template_locations
.
items
():
clear_lookups
(
namespace
)
for
directory
in
directories
:
add_lookup
(
namespace
,
directory
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment