[Checkins] SVN: grokcore.view/trunk/ Fix the factory for subdirectories of the DirectoryResource
Jan-Wijbrand Kolman
janwijbrand at gmail.com
Fri Nov 28 05:59:53 EST 2008
Log message for revision 93413:
Fix the factory for subdirectories of the DirectoryResource
implementation by using hooks in
zope.app.publihser.browser.directoryresource.
Changed:
U grokcore.view/trunk/CHANGES.txt
U grokcore.view/trunk/src/grokcore/view/components.py
U grokcore.view/trunk/src/grokcore/view/ftests/staticdir/simple.py
A grokcore.view/trunk/src/grokcore/view/ftests/staticdir/simple_fixture/static/subdir/static.pt
U grokcore.view/trunk/versions.cfg
-=-
Modified: grokcore.view/trunk/CHANGES.txt
===================================================================
--- grokcore.view/trunk/CHANGES.txt 2008-11-28 10:56:55 UTC (rev 93412)
+++ grokcore.view/trunk/CHANGES.txt 2008-11-28 10:59:53 UTC (rev 93413)
@@ -4,6 +4,9 @@
1.3 (unreleased)
----------------
+* Fix the factory for subdirectories of the DirectoryResource implementation
+ by using hooks in zope.app.publihser.browser.directoryresource.
+
* Update APIs interfaces to include the new ``path`` directive and
new ``DirectoryResource`` component.
Modified: grokcore.view/trunk/src/grokcore/view/components.py
===================================================================
--- grokcore.view/trunk/src/grokcore/view/components.py 2008-11-28 10:56:55 UTC (rev 93412)
+++ grokcore.view/trunk/src/grokcore/view/components.py 2008-11-28 10:59:53 UTC (rev 93413)
@@ -247,6 +247,7 @@
# Override this method for the following line, in which our
# custom DirectoryResource class is instantiated.
resource = DirectoryResource(self.__dir, request)
+ resource.directory_factory = DirectoryResourceFactory
resource.__Security_checker__ = self.__checker
resource.__name__ = self.__name
return resource
Modified: grokcore.view/trunk/src/grokcore/view/ftests/staticdir/simple.py
===================================================================
--- grokcore.view/trunk/src/grokcore/view/ftests/staticdir/simple.py 2008-11-28 10:56:55 UTC (rev 93412)
+++ grokcore.view/trunk/src/grokcore/view/ftests/staticdir/simple.py 2008-11-28 10:59:53 UTC (rev 93413)
@@ -45,4 +45,18 @@
>>> print browser.contents
This is yet another file.
+There used to be a bug where subdirectories of the static directory were not
+instances of grokcore.view.component.DirectoryResource and as a result,
+pagetemplate files were actually executed. This is fixed.
+
+ >>> browser.open(
+ ... 'http://localhost/@@/grokcore.view.ftests.staticdir.simple_fixture/'
+ ... 'subdir/static.pt')
+ >>> print browser.contents
+ <html>
+ <body>
+ <h1 tal:content="string:will not be interpreted"/>
+ </body>
+ </html>
+
"""
Added: grokcore.view/trunk/src/grokcore/view/ftests/staticdir/simple_fixture/static/subdir/static.pt
===================================================================
--- grokcore.view/trunk/src/grokcore/view/ftests/staticdir/simple_fixture/static/subdir/static.pt (rev 0)
+++ grokcore.view/trunk/src/grokcore/view/ftests/staticdir/simple_fixture/static/subdir/static.pt 2008-11-28 10:59:53 UTC (rev 93413)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<h1 tal:content="string:will not be interpreted"/>
+</body>
+</html>
Modified: grokcore.view/trunk/versions.cfg
===================================================================
--- grokcore.view/trunk/versions.cfg 2008-11-28 10:56:55 UTC (rev 93412)
+++ grokcore.view/trunk/versions.cfg 2008-11-28 10:59:53 UTC (rev 93413)
@@ -48,7 +48,7 @@
zope.app.preference = 3.4.1
zope.app.principalannotation = 3.4
zope.app.publication = 3.4.3
-zope.app.publisher = 3.4.1
+zope.app.publisher = 3.5.1
zope.app.renderer = 3.4
zope.app.rotterdam = 3.4.1
zope.app.schema = 3.4
More information about the Checkins
mailing list