Skip to content

Commit

Permalink
create a maintenance branch for grokcore.view-1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
janwijbrand committed Nov 28, 2008
1 parent e472dd6 commit 80495ef
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 5 deletions.
9 changes: 9 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changes
=======

1.2.1 (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.

1.2 (2008-10-16)
----------------

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def read(*rnames):

setup(
name='grokcore.view',
version='1.2',
version='1.2.1dev',
author='Grok Team',
author_email='grok-dev@zope.org',
url='http://grok.zope.org',
Expand Down
1 change: 1 addition & 0 deletions src/grokcore/view/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ def __call__(self, request):
# 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
14 changes: 14 additions & 0 deletions src/grokcore/view/ftests/staticdir/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -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>
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html>
<body>
<h1 tal:content="string:will not be interpreted"/>
</body>
</html>
12 changes: 9 additions & 3 deletions src/grokcore/view/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

class IBaseClasses(Interface):
View = Attribute("Base class for browser views.")

DirectoryResource = Attribute("Base class to create new "
"directory resource.")

class IDirectives(Interface):

Expand All @@ -29,6 +30,11 @@ def layer(layer):
This directive acts as a contraint on the 'request' of
grok.View. This directive can only be used on class level."""

def path(path):
"""Declare which path to use on a DirectoryResource.
This directive can only be used on class level."""

def skin(skin):
"""Declare this layer as a named skin.
Expand All @@ -52,8 +58,8 @@ class IGrokcoreViewAPI(IBaseClasses, IDirectives):
def url(request, obj, name=None, data=None):
"""Generate the URL to an object with optional name attached.
An optional argument 'data' can be a dictionary that is converted
into a query string appended to the URL.
"""
into a query string appended to the URL."""

def PageTemplate(template):
"""Create a Grok PageTemplate object from ``template`` source
text. This can be used for inline PageTemplates."""
Expand Down
2 changes: 1 addition & 1 deletion versions.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ zope.app.pagetemplate = 3.4.1
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
Expand Down

0 comments on commit 80495ef

Please sign in to comment.