Skip to content
Browse files

now can have no cache dir for mako

  • Loading branch information...
1 parent bd91b55 commit b1a3bc3f6b3732b96dc6ae8858ce47df22aad28b @bmuller committed Aug 28, 2010
Showing with 7 additions and 3 deletions.
  1. +7 −3 twistler/controllers.py
View
10 twistler/controllers.py
@@ -31,7 +31,10 @@ def addViewDirs(self, klass, viewDirs):
# make this path: <viewsDir>/<viewDir which is controllername>
templateDirs.append(os.path.join(self.viewsDir, viewDir))
templateDirs = filter(os.path.exists, templateDirs)
- cachedir = os.path.join(self.templateCacheDir, cname)
+ if self.templateCacheDir is not None:
+ cachedir = os.path.join(self.templateCacheDir, cname)
+ else:
+ cachedir = None
klass.template_lookup = TemplateLookup(directories=templateDirs, module_directory=cachedir)
@@ -181,7 +184,7 @@ def _resetMessage(self):
self.session._message = self.session.message
- def path(self, action=None, **kwargs):
+ def path(self, action=None, clear_query=True, **kwargs):
controller = kwargs.pop('controller', None)
id = kwargs.pop('id', None)
@@ -195,7 +198,8 @@ def path(self, action=None, **kwargs):
path = self.request.URLPath().child(controller).child(action).child(id)
# clear all query args except the ones passed in
- path._querylist = []
+ if clear_query:
+ path._querylist = []
for name, value in kwargs.items():
path = path.add(name, value)
return path

0 comments on commit b1a3bc3

Please sign in to comment.
Something went wrong with that request. Please try again.