[Checkins] SVN: grokcore.view/branches/zca-only/s Remove components that no longer make sense and cleaned the tests accordingly

Souheil CHELFOUH souheil at chelfouh.com
Wed Mar 16 09:18:02 EDT 2011


Log message for revision 120972:
  Remove components that no longer make sense and cleaned the tests accordingly

Changed:
  U   grokcore.view/branches/zca-only/setup.py
  U   grokcore.view/branches/zca-only/src/grokcore/view/__init__.py
  U   grokcore.view/branches/zca-only/src/grokcore/view/components.py
  U   grokcore.view/branches/zca-only/src/grokcore/view/configure.zcml
  U   grokcore.view/branches/zca-only/src/grokcore/view/directive.py
  U   grokcore.view/branches/zca-only/src/grokcore/view/ftesting.zcml
  D   grokcore.view/branches/zca-only/src/grokcore/view/ftests/
  U   grokcore.view/branches/zca-only/src/grokcore/view/interfaces.py
  D   grokcore.view/branches/zca-only/src/grokcore/view/meta/directoryresource.py
  D   grokcore.view/branches/zca-only/src/grokcore/view/meta/skin.py
  U   grokcore.view/branches/zca-only/src/grokcore/view/meta/views.py
  D   grokcore.view/branches/zca-only/src/grokcore/view/publication.py
  D   grokcore.view/branches/zca-only/src/grokcore/view/publication_security.zcml
  D   grokcore.view/branches/zca-only/src/grokcore/view/tests/directoryresource/
  D   grokcore.view/branches/zca-only/src/grokcore/view/tests/skin/
  U   grokcore.view/branches/zca-only/src/grokcore/view/tests/test_all.py
  U   grokcore.view/branches/zca-only/src/grokcore/view/tests/view/update_redirect.py

-=-
Modified: grokcore.view/branches/zca-only/setup.py
===================================================================
--- grokcore.view/branches/zca-only/setup.py	2011-03-16 07:50:33 UTC (rev 120971)
+++ grokcore.view/branches/zca-only/setup.py	2011-03-16 13:18:01 UTC (rev 120972)
@@ -15,38 +15,25 @@
     'grokcore.component >= 2.1',
     'grokcore.security >= 1.5',
     'martian >= 0.13',
-    'zope.browserresource >= 3.9.0',
     'zope.component',
     'zope.interface',
     'zope.pagetemplate',
-    'zope.ptresource >= 3.9.0',
     'zope.publisher',
     'zope.security',
     'zope.traversing',
     ]
 
 tests_require = [
-    'zope.app.wsgi',
     'zope.container',
     'zope.securitypolicy',
     'zope.site',
-    'zope.testing',
-    'zope.login',
-    'zope.configuration',
-    'zope.app.appsetup',
-    'zope.app.publication',
     'zope.browserpage',
-    'zope.password',
     'zope.principalregistry',
     ]
 
-publication_require = [
-    'zope.app.publication'
-    ]
-
 setup(
     name='grokcore.view',
-    version='2.5dev',
+    version='3.0dev',
     author='Grok Team',
     author_email='grok-dev at zope.org',
     url='http://grok.zope.org',
@@ -68,6 +55,5 @@
     zip_safe=False,
     install_requires=install_requires,
     tests_require=tests_require,
-    extras_require={'test': tests_require,
-                    'security_publication': publication_require},
+    extras_require={'test': tests_require},
 )

Modified: grokcore.view/branches/zca-only/src/grokcore/view/__init__.py
===================================================================
--- grokcore.view/branches/zca-only/src/grokcore/view/__init__.py	2011-03-16 07:50:33 UTC (rev 120971)
+++ grokcore.view/branches/zca-only/src/grokcore/view/__init__.py	2011-03-16 13:18:01 UTC (rev 120972)
@@ -16,15 +16,11 @@
 from grokcore.component import *
 from grokcore.security import *
 
-from zope.publisher.interfaces.browser import IBrowserRequest
-from zope.publisher.interfaces.browser import IDefaultBrowserLayer
-
 from grokcore.view.components import View, ViewSupport
 from grokcore.view.components import PageTemplate, PageTemplateFile
 from grokcore.view.interfaces import IGrokSecurityView
-from grokcore.view.components import DirectoryResource
 from grokcore.view.directive import (
-    layer, template, templatedir, skin, path, view)
+    layer, template, templatedir, path, view)
 from grokcore.view.util import url, make_checker
 
 # Import this module so that it's available as soon as you import the

Modified: grokcore.view/branches/zca-only/src/grokcore/view/components.py
===================================================================
--- grokcore.view/branches/zca-only/src/grokcore/view/components.py	2011-03-16 07:50:33 UTC (rev 120971)
+++ grokcore.view/branches/zca-only/src/grokcore/view/components.py	2011-03-16 13:18:01 UTC (rev 120972)
@@ -20,14 +20,9 @@
 
 from zope import component
 from zope import interface
-from zope.browserresource import directory
-from zope.browserresource.interfaces import IResourceFactoryFactory
+from zope.location import Location
 from zope.pagetemplate import pagetemplate, pagetemplatefile
 from zope.pagetemplate.engine import TrustedAppPT
-from zope.ptresource.ptresource import PageTemplateResourceFactory
-from zope.publisher.browser import BrowserPage
-from zope.publisher.interfaces import NotFound
-from zope.publisher.publish import mapply
 
 import martian.util
 from grokcore.view import interfaces, util
@@ -45,13 +40,13 @@
         This is also available as self.request.response, but the
         response attribute is provided as a convenience.
         """
-        return self.request.response
+        return IResponse(self.request)
 
     @property
     def body(self):
         """The text of the request body.
         """
-        return self.request.bodyStream.getCacheStream().read()
+        return self.request.body
 
     def redirect(self, url, status=None, trusted=False):
         """Redirect to `url`.
@@ -74,8 +69,7 @@
         hosts than the one the request was sent to are forbidden and
         will raise a :exc:`ValueError`.
         """
-        return self.request.response.redirect(
-            url, status=status, trusted=trusted)
+        return self.response.redirect(url, status=status, trusted=trusted)
 
     def url(self, obj=None, name=None, data=None):
         """Return string for the URL based on the obj and name.
@@ -112,11 +106,13 @@
         return util.url(self.request, obj, name, data)
 
 
-class View(ViewSupport, BrowserPage):
+class View(Location, ViewSupport):
     interface.implements(interfaces.IGrokView)
 
     def __init__(self, context, request):
-        super(View, self).__init__(context, request)
+        self.context = context
+        self.request = request
+
         self.__name__ = getattr(self, '__view_name__', None)
 
         if getattr(self, 'module_info', None) is not None:
@@ -128,16 +124,11 @@
             self.static = None
 
     def __call__(self):
-        mapply(self.update, (), self.request)
-        if self.request.response.getStatus() in (302, 303):
-            # A redirect was triggered somewhere in update().  Don't
-            # continue rendering the template or doing anything else.
-            return
-
+        self.update()
         template = getattr(self, 'template', None)
         if template is not None:
             return self._render_template()
-        return mapply(self.render, (), self.request)
+        return self.render()
 
     def _render_template(self):
         return self.template.render(self)
@@ -328,48 +319,3 @@
 
 
 _marker = object()
-
-
-class DirectoryResource(directory.DirectoryResource):
-    forbidden_names = ('.svn', )
-
-    def get(self, name, default=_marker):
-
-        for pat in self.forbidden_names:
-            if fnmatch.fnmatch(name, pat):
-                if default is _marker:
-                    raise NotFound(None, name)
-                else:
-                    return default
-
-        path = self.context.path
-        filename = os.path.join(path, name)
-        isfile = os.path.isfile(filename)
-        isdir = os.path.isdir(filename)
-
-        if not (isfile or isdir):
-            if default is _marker:
-                raise NotFound(None, name)
-            return default
-
-        if isfile:
-            ext = os.path.splitext(os.path.normcase(name))[1][1:]
-            factory = component.queryUtility(IResourceFactoryFactory, ext,
-                                             self.default_factory)
-            if factory is PageTemplateResourceFactory:
-                factory = self.default_factory
-        else:
-            factory = self.directory_factory
-
-        rname = self.__name__ + '/' + name
-        resource = factory(filename, self.context.checker, rname)(self.request)
-        resource.__parent__ = self
-        return resource
-
-
-class DirectoryResourceFactory(directory.DirectoryResourceFactory):
-    # We need this to allow hooking up our own DirectoryResource class.
-    factoryClass = DirectoryResource
-
-
-DirectoryResource.directory_factory = DirectoryResourceFactory

Modified: grokcore.view/branches/zca-only/src/grokcore/view/configure.zcml
===================================================================
--- grokcore.view/branches/zca-only/src/grokcore/view/configure.zcml	2011-03-16 07:50:33 UTC (rev 120971)
+++ grokcore.view/branches/zca-only/src/grokcore/view/configure.zcml	2011-03-16 13:18:01 UTC (rev 120972)
@@ -2,8 +2,6 @@
   xmlns="http://namespaces.zope.org/zope"
   xmlns:grok="http://namespaces.zope.org/grok">
 
-  <include package="zope.browserresource" />
-
   <!-- ZPT support -->
   <grok:grok package=".templatereg" />
 

Modified: grokcore.view/branches/zca-only/src/grokcore/view/directive.py
===================================================================
--- grokcore.view/branches/zca-only/src/grokcore/view/directive.py	2011-03-16 07:50:33 UTC (rev 120971)
+++ grokcore.view/branches/zca-only/src/grokcore/view/directive.py	2011-03-16 13:18:01 UTC (rev 120972)
@@ -19,8 +19,8 @@
 import martian
 from martian.error import GrokImportError
 from martian.directive import StoreOnce
+from zope.interface import Interface
 from zope.interface.interface import TAGGED_DATA
-from zope.publisher.interfaces.browser import IBrowserView
 
 
 def validateLocalPath(directive, value):
@@ -88,18 +88,11 @@
         context.setTaggedValue(directive.dotted_name(), value)
 
 
-class skin(martian.Directive):
-    # We cannot do any better than to check for a class scope. Ideally we
-    # would've checked whether the context is indeed an Interface class.
-    scope = martian.CLASS
-    store = TaggedValueStoreOnce()
-    validate = martian.validateText
-
-
 class path(martian.Directive):
     scope = martian.CLASS
     store = martian.ONCE
     validate = martian.validateText
 
+
 class view(OneInterfaceOrClassOnClassOrModule):
-    default = IBrowserView
+    default = Interface

Modified: grokcore.view/branches/zca-only/src/grokcore/view/ftesting.zcml
===================================================================
--- grokcore.view/branches/zca-only/src/grokcore/view/ftesting.zcml	2011-03-16 07:50:33 UTC (rev 120971)
+++ grokcore.view/branches/zca-only/src/grokcore/view/ftesting.zcml	2011-03-16 13:18:01 UTC (rev 120972)
@@ -6,56 +6,21 @@
    package="grokcore.view">
 
   <include package="zope.component" file="meta.zcml" />
-  <include package="zope.security" file="meta.zcml" />
-  <include package="zope.securitypolicy" file="meta.zcml" />
-  <include package="zope.principalregistry" file="meta.zcml" />
-  <include package="zope.publisher" file="meta.zcml" />
-  <include package="zope.browserpage" file="meta.zcml" />
-  <include package="zope.app.publication" file="meta.zcml" />
   <include package="grokcore.view" file="meta.zcml" />
 
   <include package="zope.security" />
-  <include package="zope.principalregistry" />
-  <include package="zope.login" />
-  <include package="zope.password" />
   <include package="zope.site" />
   <include package="zope.container" />
   <include package="zope.publisher" />
   <include package="zope.traversing" />
   <include package="zope.traversing.browser" />
-  <include package="zope.app.appsetup" />
-  <include package="zope.app.publication" />
 
   <include package="grokcore.view" />
   <grok:grok package="grokcore.view.ftests" />
 
-  <securityPolicy
-      component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy"
-      />
-
   <browser:defaultView
       for="grokcore.component.interfaces.IContext"
       name="index"
       />
 
-  <unauthenticatedPrincipal
-      id="zope.anybody"
-      title="Unauthenticated User"
-      />
-  <grant
-      permission="zope.View"
-      principal="zope.anybody"
-      />
-
-  <principal
-      id="zope.mgr"
-      title="Manager"
-      login="mgr"
-      password="mgrpw"
-      />
-
-  <role id="zope.Manager" title="Site Manager" />
-  <grantAll role="zope.Manager" />
-  <grant role="zope.Manager" principal="zope.mgr" />
-
 </configure>

Modified: grokcore.view/branches/zca-only/src/grokcore/view/interfaces.py
===================================================================
--- grokcore.view/branches/zca-only/src/grokcore/view/interfaces.py	2011-03-16 07:50:33 UTC (rev 120971)
+++ grokcore.view/branches/zca-only/src/grokcore/view/interfaces.py	2011-03-16 13:18:01 UTC (rev 120972)
@@ -14,7 +14,6 @@
 """Grok interfaces
 """
 from zope.interface import Interface, Attribute
-from zope.publisher.interfaces.browser import IBrowserPage, IBrowserView
 
 
 class IBaseClasses(Interface):
@@ -36,11 +35,6 @@
 
         This directive can only be used on class level."""
 
-    def skin(skin):
-        """Declare this layer as a named skin.
-
-        This directive can only be used on class level."""
-
     def template(template):
         """Declare the template name for a view.
 
@@ -86,7 +80,7 @@
     IGrokSecurityView = Attribute('Marker interface for permissive views.')
 
 
-class IGrokView(IBrowserPage, IBrowserView):
+class IGrokView(Interface):
     """Grok views all provide this interface."""
 
     context = Attribute('context', "Object that the view presents.")
@@ -155,12 +149,7 @@
         filled in from the request (in that case they *must* be
         present in the request)."""
 
-    def __call__():
-        """This is the main method called by Zope to render the
-        view. You can use that method if you whish to render the
-        view."""
 
-
 class ITemplateFileFactory(Interface):
     """Utility that generates templates from files in template directories.
     """

Deleted: grokcore.view/branches/zca-only/src/grokcore/view/meta/directoryresource.py
===================================================================
--- grokcore.view/branches/zca-only/src/grokcore/view/meta/directoryresource.py	2011-03-16 07:50:33 UTC (rev 120971)
+++ grokcore.view/branches/zca-only/src/grokcore/view/meta/directoryresource.py	2011-03-16 13:18:01 UTC (rev 120972)
@@ -1,84 +0,0 @@
-#############################################################################
-#
-# Copyright (c) 2006-2007 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Grokkers for resource directories."""
-
-import os
-
-from zope import interface, component
-from zope.security.checker import NamesChecker
-from zope.publisher.interfaces.browser import IDefaultBrowserLayer
-
-import martian
-from martian.error import GrokError
-
-import grokcore.view
-from grokcore.view import components
-
-allowed_resource_names = (
-    'GET', 'HEAD', 'publishTraverse', 'browserDefault', 'request', '__call__')
-
-allowed_resourcedir_names = allowed_resource_names + ('__getitem__', 'get')
-
-
-def _get_resource_path(module_info, path):
-    resource_path = module_info.getResourcePath(path)
-    if os.path.isdir(resource_path):
-        static_module = module_info.getSubModuleInfo(path)
-        if static_module is not None:
-            if static_module.isPackage():
-                raise GrokError(
-                    "The '%s' resource directory must not "
-                    "be a python package." % path, module_info.getModule())
-            else:
-                raise GrokError(
-                    "A package can not contain both a '%s' "
-                    "resource directory and a module named "
-                    "'%s.py'" % (path, path), module_info.getModule())
-    return resource_path
-
-
-def _register(config, resource_path, name, layer):
-    # public checker by default
-    checker = NamesChecker(allowed_resourcedir_names)
-    resource_factory = components.DirectoryResourceFactory(
-        resource_path, checker, name)
-
-    adapts = (layer,)
-    provides = interface.Interface
-    config.action(
-        discriminator=('adapter', adapts, provides, name),
-        callable=component.provideAdapter,
-        args=(resource_factory, adapts, provides, name),
-        )
-    return True
-
-
-class DirectoryResourceGrokker(martian.ClassGrokker):
-    martian.component(components.DirectoryResource)
-
-    martian.directive(grokcore.view.name, default=None)
-    martian.directive(grokcore.view.path)
-    martian.directive(grokcore.view.layer, default=IDefaultBrowserLayer)
-
-    def grok(self, name, factory, module_info, **kw):
-        # Need to store the module info object on the directory resource
-        # class so that it can look up the actual directory.
-        factory.module_info = module_info
-        return super(DirectoryResourceGrokker, self).grok(
-            name, factory, module_info, **kw)
-
-    def execute(self, factory, config, name, path, layer, **kw):
-        resource_path = _get_resource_path(factory.module_info, path)
-        name = name or factory.module_info.dotted_name
-        return _register(config, resource_path, name, layer)

Deleted: grokcore.view/branches/zca-only/src/grokcore/view/meta/skin.py
===================================================================
--- grokcore.view/branches/zca-only/src/grokcore/view/meta/skin.py	2011-03-16 07:50:33 UTC (rev 120971)
+++ grokcore.view/branches/zca-only/src/grokcore/view/meta/skin.py	2011-03-16 13:18:01 UTC (rev 120972)
@@ -1,53 +0,0 @@
-#############################################################################
-#
-# Copyright (c) 2006-2007 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Grokkers for the skin support."""
-
-
-import zope.component.interface
-from zope.interface.interface import InterfaceClass
-from zope.publisher.interfaces.browser import IBrowserRequest
-from zope.publisher.interfaces.browser import IBrowserSkinType
-
-import martian
-from martian.error import GrokError
-
-import grokcore.view
-
-_skin_not_used = object()
-
-
-class SkinInterfaceDirectiveGrokker(martian.InstanceGrokker):
-    martian.component(InterfaceClass)
-
-    def grok(self, name, interface, module_info, config, **kw):
-        skin = grokcore.view.skin.bind(default=_skin_not_used).get(interface)
-        if skin is _skin_not_used:
-            # The skin directive is not actually used on the found interface.
-            return False
-
-        if not interface.extends(IBrowserRequest):
-            # For layers it is required to extend IBrowserRequest.
-            raise GrokError(
-                "The grok.skin() directive is used on interface %r. "
-                "However, %r does not extend IBrowserRequest which is "
-                "required for interfaces that are used as layers and are to "
-                "be registered as a skin."
-                % (interface.__identifier__, interface.__identifier__),
-                interface,
-                )
-        config.action(
-            discriminator=('utility', IBrowserSkinType, skin),
-            callable=zope.component.interface.provideInterface,
-            args=(skin, interface, IBrowserSkinType))
-        return True

Modified: grokcore.view/branches/zca-only/src/grokcore/view/meta/views.py
===================================================================
--- grokcore.view/branches/zca-only/src/grokcore/view/meta/views.py	2011-03-16 07:50:33 UTC (rev 120971)
+++ grokcore.view/branches/zca-only/src/grokcore/view/meta/views.py	2011-03-16 13:18:01 UTC (rev 120972)
@@ -15,8 +15,6 @@
 import sys
 
 from zope import interface, component
-from zope.publisher.interfaces.browser import IDefaultBrowserLayer
-from zope.publisher.interfaces.browser import IBrowserPage
 
 import martian
 from martian.error import GrokError
@@ -28,6 +26,7 @@
 from grokcore.view import components
 from grokcore.view import templatereg
 
+
 def default_view_name(component, module=None, **data):
     return component.__name__.lower()
 
@@ -40,7 +39,8 @@
     def grok(self, name, factory, module_info, **kw):
         # Need to store the module info to look for a template
         factory.module_info = module_info
-        return super(TemplateGrokker, self).grok(name, factory, module_info, **kw)
+        return super(TemplateGrokker, self).grok(
+            name, factory, module_info, **kw)
 
     def execute(self, factory, config, **kw):
         # Associate templates to a view or a component. We set the
@@ -63,7 +63,8 @@
     def associate_template(self, module_info, factory):
         component_name = martian.component.bind().get(self).__name__.lower()
         templatereg.associate_template(
-            module_info, factory, component_name, self.has_render, self.has_no_render)
+            module_info, factory, component_name,
+            self.has_render, self.has_no_render)
 
     def has_render(self, factory):
         render = getattr(factory, 'render', None)
@@ -81,7 +82,7 @@
 class ViewGrokker(martian.ClassGrokker):
     martian.component(components.View)
     martian.directive(grokcore.component.context)
-    martian.directive(grokcore.view.layer, default=IDefaultBrowserLayer)
+    martian.directive(grokcore.view.layer, default=interface.Interface)
     martian.directive(grokcore.component.provides, default=interface.Interface)
     martian.directive(grokcore.component.name, get_default=default_view_name)
 
@@ -106,17 +107,3 @@
             args=(factory, adapts, provides, name),
             )
         return True
-
-
-class ViewSecurityGrokker(martian.ClassGrokker):
-    martian.component(components.View)
-    martian.directive(grokcore.security.require, name='permission')
-
-    def execute(self, factory, config, permission, **kw):
-        for method_name in IBrowserPage:
-            config.action(
-                discriminator=('protectName', factory, method_name),
-                callable=protect_getattr,
-                args=(factory, method_name, permission),
-                )
-        return True

Deleted: grokcore.view/branches/zca-only/src/grokcore/view/publication.py
===================================================================
--- grokcore.view/branches/zca-only/src/grokcore/view/publication.py	2011-03-16 07:50:33 UTC (rev 120971)
+++ grokcore.view/branches/zca-only/src/grokcore/view/publication.py	2011-03-16 13:18:01 UTC (rev 120972)
@@ -1,86 +0,0 @@
-# -*- coding: utf-8 -*-
-from zope.security.proxy import removeSecurityProxy
-from zope.security.checker import selectChecker
-from zope.publisher.interfaces.browser import IBrowserView
-from zope.app.publication.browser import BrowserPublication
-from zope.app.publication.requestpublicationfactories import BrowserFactory
-from grokcore.view import IGrokSecurityView
-
-
-class ZopePublicationSansProxy(object):
-    """Mixin that makes a publisher remove security proxies.
-
-    This mixin overrides three methods from the `IPublication`
-    interface (defined in `zope.publisher.interfaces`) to alter their
-    security behavior.  The normal Zope machinery wraps a security
-    proxy around the application object returned by
-    `getApplication()`, and around each of the objects returned as
-    `traverseName()` is then called for each URL component.  The
-    versions here strip the security proxy off instead, returning the
-    bare object (unless the object is a non-Grok view, in which case
-    we leave the proxy installed for important security
-    reasons).  Non-Grok views however, are handled like Grok views, if
-    they provide `grokcore.view.IGrokSecurityView`.
-
-    Finally, when `callObject()` is asked to render
-    the view, we quickly re-install a security proxy on the object, make
-    sure that the current user is indeed allowed to invoke `__call__()`,
-    then pass the bare object to the rendering machinery.
-
-    The result is that, in place of the elaborate series of security
-    checks made during the processing of a normal Zope request, Grok
-    makes only a single security check: to see if the view can be
-    permissibly rendered or not.
-
-    """
-    def getApplication(self, request):
-        result = super(ZopePublicationSansProxy, self).getApplication(request)
-        return removeSecurityProxy(result)
-
-    def traverseName(self, request, ob, name):
-        result = super(ZopePublicationSansProxy, self).traverseName(
-            request, ob, name)
-        bare_result = removeSecurityProxy(result)
-        if IBrowserView.providedBy(bare_result):
-            if IGrokSecurityView.providedBy(bare_result):
-                return bare_result
-            else:
-                return result
-        else:
-            return bare_result
-
-    def callObject(self, request, ob):
-        checker = selectChecker(ob)
-        if checker is not None:
-            checker.check(ob, '__call__')
-        return super(ZopePublicationSansProxy, self).callObject(request, ob)
-
-
-class GrokBrowserPublication(ZopePublicationSansProxy, BrowserPublication):
-    """Combines `BrowserPublication` with the Grok sans-proxy mixin.
-
-    In addition to the three methods that are overridden by the
-    `ZopePublicationSansProxy`, this class overrides a fourth: the
-    `getDefaultTraversal()` method, which strips the security proxy from
-    the object being returned by the normal method.
-
-    """
-    def getDefaultTraversal(self, request, ob):
-        obj, path = super(GrokBrowserPublication, self).getDefaultTraversal(
-            request, ob)
-        return removeSecurityProxy(obj), path
-
-
-class GrokBrowserFactory(BrowserFactory):
-    """Returns the classes Grok uses for browser requests and publication.
-
-    When an instance of this class is called, it returns a 2-element
-    tuple containing:
-
-    - The request class that Grok uses for browser requests.
-    - The publication class that Grok uses to publish to a browser.
-
-    """
-    def __call__(self):
-        request, publication = super(GrokBrowserFactory, self).__call__()
-        return request, GrokBrowserPublication

Deleted: grokcore.view/branches/zca-only/src/grokcore/view/publication_security.zcml
===================================================================
--- grokcore.view/branches/zca-only/src/grokcore/view/publication_security.zcml	2011-03-16 07:50:33 UTC (rev 120971)
+++ grokcore.view/branches/zca-only/src/grokcore/view/publication_security.zcml	2011-03-16 13:18:01 UTC (rev 120972)
@@ -1,21 +0,0 @@
-<configure
-  xmlns="http://namespaces.zope.org/zope"
-  xmlns:grok="http://namespaces.zope.org/grok">
-
-  <include package="zope.app.publication" />
-  <include package="zope.app.publication" file="meta.zcml" />
-
-  <!-- this overrides Zope 3's publication factories because they have
-       the same name; we also need to change the priority because of
-       the ZCML discriminator -->
-
-  <publisher
-      name="BROWSER"
-      factory=".publication.GrokBrowserFactory"
-      methods="GET POST HEAD"
-      mimetypes="*"
-      priority="11"
-      />
-
-  <grok:grok package=".publication" />
-</configure>

Modified: grokcore.view/branches/zca-only/src/grokcore/view/tests/test_all.py
===================================================================
--- grokcore.view/branches/zca-only/src/grokcore/view/tests/test_all.py	2011-03-16 07:50:33 UTC (rev 120971)
+++ grokcore.view/branches/zca-only/src/grokcore/view/tests/test_all.py	2011-03-16 13:18:01 UTC (rev 120972)
@@ -44,7 +44,7 @@
 
 def test_suite():
     suite = unittest.TestSuite()
-    for name in ['view', 'skin', 'template', 'directoryresource']:
+    for name in ['view', 'template']:
         suite.addTest(suiteFromPackage(name))
     suite.addTest(doctest.DocFileSuite(
         '../templatereg.txt',

Modified: grokcore.view/branches/zca-only/src/grokcore/view/tests/view/update_redirect.py
===================================================================
--- grokcore.view/branches/zca-only/src/grokcore/view/tests/view/update_redirect.py	2011-03-16 07:50:33 UTC (rev 120971)
+++ grokcore.view/branches/zca-only/src/grokcore/view/tests/view/update_redirect.py	2011-03-16 13:18:01 UTC (rev 120972)
@@ -5,15 +5,17 @@
   >>> grok.testing.grok(__name__)
 
   >>> manfred = Mammoth()
-  >>> from zope.publisher.browser import TestRequest
-  >>> request = TestRequest()
+
+  >>> from webob import Request
+  >>> request = Request.blank('/')
+
   >>> from zope.component import getMultiAdapter
   >>> view = getMultiAdapter((manfred, request), name='cavepainting')
   >>> print view()
   None
   >>> print view.response.getStatus()
   302
-  >>> print view.response.getHeader('Location')
+  >>> print view.response.headers('Location')
   somewhere-else
 
 """



More information about the checkins mailing list