Skip to content

Commit

Permalink
'staticdir' ftests moved to grokcore.view.
Browse files Browse the repository at this point in the history
The make_checker helper was removed in grokcore.view as well, so let's bring it
back in grok, at least temporarily.
  • Loading branch information
philikon committed Jul 22, 2008
1 parent 98dc60d commit ebe395d
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 71 deletions.
1 change: 0 additions & 1 deletion src/grok/ftests/staticdir/__init__.py

This file was deleted.

43 changes: 0 additions & 43 deletions src/grok/ftests/staticdir/simple.py

This file was deleted.

1 change: 0 additions & 1 deletion src/grok/ftests/staticdir/simple_fixture/__init__.py

This file was deleted.

14 changes: 0 additions & 14 deletions src/grok/ftests/staticdir/simple_fixture/ellie.py

This file was deleted.

1 change: 0 additions & 1 deletion src/grok/ftests/staticdir/simple_fixture/static/file.txt

This file was deleted.

5 changes: 0 additions & 5 deletions src/grok/ftests/staticdir/simple_fixture/static/static.pt

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions src/grok/ftests/test_grok_functional.py
Expand Up @@ -70,8 +70,8 @@ def suiteFromPackage(name):

def test_suite():
suite = unittest.TestSuite()
for name in ['staticdir', 'xmlrpc', 'traversal', 'form', 'url',
'security', 'utility', 'catalog', 'site', 'rest', 'viewlet']:
for name in ['xmlrpc', 'traversal', 'form', 'url', 'security',
'utility', 'catalog', 'site', 'rest', 'viewlet']:
suite.addTest(suiteFromPackage(name))
return suite

Expand Down
20 changes: 17 additions & 3 deletions src/grok/util.py
Expand Up @@ -13,14 +13,28 @@
##############################################################################
"""Grok utility functions.
"""


import grok
import zope.location.location
from zope import interface
# XXX BBB
from grokcore.view.util import make_checker, check_permission
from grokcore.view.util import check_permission
from zope.security.checker import NamesChecker, defineChecker

def make_checker(factory, view_factory, permission, method_names=None):
"""Make a checker for a view_factory associated with factory.
These could be one and the same for normal views, or different
in case we make method-based views such as for JSON and XMLRPC.
"""
if method_names is None:
method_names = ['__call__']
if permission is not None:
check_permission(factory, permission)
if permission is None or permission == 'zope.Public':
checker = NamesChecker(method_names)
else:
checker = NamesChecker(method_names, permission)
defineChecker(view_factory, checker)

def safely_locate_maybe(obj, parent, name):
"""Set an object's __parent__ (and __name__) if the object's
Expand Down

0 comments on commit ebe395d

Please sign in to comment.