[Checkins] SVN: z3c.pt/trunk/src/z3c/pt/pagetemplate.py Added support for path-parameter (ZPT's ViewPageTemplateFile class has this).

Malthe Borch mborch at gmail.com
Tue Sep 2 10:41:20 EDT 2008


Log message for revision 90711:
  Added support for path-parameter (ZPT's ViewPageTemplateFile class has this).

Changed:
  U   z3c.pt/trunk/src/z3c/pt/pagetemplate.py

-=-
Modified: z3c.pt/trunk/src/z3c/pt/pagetemplate.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/pagetemplate.py	2008-09-02 14:08:32 UTC (rev 90710)
+++ z3c.pt/trunk/src/z3c/pt/pagetemplate.py	2008-09-02 14:41:19 UTC (rev 90711)
@@ -81,7 +81,10 @@
     """If ``filename`` is a relative path, the module path of the
     class where the instance is used to get an absolute path."""
     
-    def __init__(self, filename, content_type=None, **kwargs):
+    def __init__(self, filename, path=None, content_type=None, **kwargs):
+        if path is not None:
+            filename = os.path.join(path, filename)
+
         if not os.path.isabs(filename):	       
             for depth in (1, 2):	       
                 frame = sys._getframe(depth)	 



More information about the Checkins mailing list