[Checkins] SVN: five.grok/trunk/ Port five.grok to Zope 2.12. (There is still few tests failures).

Sylvain Viollon sylvain at infrae.com
Tue Nov 3 09:16:56 EST 2009


Log message for revision 105461:
  Port five.grok to Zope 2.12. (There is still few tests failures).
  
  

Changed:
  U   five.grok/trunk/README.txt
  U   five.grok/trunk/buildout.cfg
  U   five.grok/trunk/setup.py
  U   five.grok/trunk/src/five/grok/__init__.py
  U   five.grok/trunk/src/five/grok/absoluteurl.py
  U   five.grok/trunk/src/five/grok/components.py
  U   five.grok/trunk/src/five/grok/configure.zcml
  U   five.grok/trunk/src/five/grok/ftesting.zcml
  U   five.grok/trunk/src/five/grok/ftests/site/folder_site.py
  U   five.grok/trunk/src/five/grok/ftests/site/local_site.py
  U   five.grok/trunk/src/five/grok/ftests/test_grok_functional.py
  U   five.grok/trunk/src/five/grok/ftests/view/layers.py
  U   five.grok/trunk/src/five/grok/ftests/view/resource.py
  U   five.grok/trunk/src/five/grok/meta.py
  U   five.grok/trunk/src/five/grok/meta.zcml

-=-
Modified: five.grok/trunk/README.txt
===================================================================
--- five.grok/trunk/README.txt	2009-11-03 10:31:08 UTC (rev 105460)
+++ five.grok/trunk/README.txt	2009-11-03 14:16:55 UTC (rev 105461)
@@ -57,26 +57,9 @@
 Note
 ~~~~
 
-``five.grok`` have some dependencies on Zope 3 eggs. With Zope 2, you
-can fake those dependencies in buildout with the help of
-``plone.recipe.zope2instance``.
-
-The minium required configuration to install Zope would be::
-
-  [zope2]
-  recipe = plone.recipe.zope2install
-  url = http://www.zope.org/Products/Zope/2.10.9/Zope-2.10.9-final.tgz
-  skip-fake-eggs =
-     zope.app.publisher
-     zope.component
-     zope.i18n
-     zope.interface
-     zope.testing
-
 And for this release we recommend to pin down the following version in
 your buildout::
 
-  five.grok = 1.0  
   grokcore.annotation = 1.1
   grokcore.component = 1.7
   grokcore.formlib = 1.4
@@ -84,18 +67,11 @@
   grokcore.site = 1.1
   grokcore.view = 1.12.2
   grokcore.viewlet = 1.3
-  five.localsitemanager = 1.1
+  five.localsitemanager = 2.0.1
   martian = 0.11.1
-  zope.app.publisher = 3.5.1
-  zope.app.zcmlfiles = 3.4.3
-  zope.component = 3.4.0
-  zope.i18n = 3.4.0
-  zope.interface = 3.4.1
-  zope.schema = 3.4.0
-  zope.securitypolicy = 3.4.1
-  zope.testing = 3.7.6
 
-Zope 2.10 is required as bare minimum.
+Zope 2.12 is required. If you whish to use a previous version of Zope
+2, look at the version 1.0 of five.grok.
 
 
 More information

Modified: five.grok/trunk/buildout.cfg
===================================================================
--- five.grok/trunk/buildout.cfg	2009-11-03 10:31:08 UTC (rev 105460)
+++ five.grok/trunk/buildout.cfg	2009-11-03 14:16:55 UTC (rev 105461)
@@ -2,10 +2,10 @@
 parts =
     zope2
     instance
-    zopepy
     test
 extensions = buildout.dumppickedversions
 develop = .
+extends = http://download.zope.org/Zope2/index/2.12.1/versions.cfg
 versions = versions
 
 [versions]
@@ -16,30 +16,17 @@
 grokcore.site = 1.1
 grokcore.view = 1.12.2
 grokcore.viewlet = 1.3
-five.localsitemanager = 1.1
+five.localsitemanager = 2.0.1
 martian = 0.11.1
-zope.app.publisher = 3.5.1
-zope.app.zcmlfiles = 3.4.3
-zope.component = 3.4.0
-zope.i18n = 3.4.0
-zope.interface = 3.4.1
-zope.schema = 3.4.0
-zope.securitypolicy = 3.4.1
-zope.testing = 3.7.6
+Zope2 = 2.12.1
 
+# This is needed in order to set up the mkzopeinstance script
 [zope2]
-recipe = plone.recipe.zope2install
-url = http://www.zope.org/Products/Zope/2.10.9/Zope-2.10.9-final.tgz
-skip-fake-eggs =
-   zope.app.publisher
-   zope.component
-   zope.i18n
-   zope.interface
-   zope.testing
+recipe = zc.recipe.egg
+eggs = Zope2
 
 [instance]
 recipe = plone.recipe.zope2instance
-zope2-location = ${zope2:location}
 user = admin:admin
 http-address = 8080
 debug-mode = on
@@ -51,15 +38,7 @@
     five.grok
 products =
 
-[zopepy]
-recipe = zc.recipe.egg
-eggs = ${instance:eggs}
-interpreter = zopepy
-extra-paths = ${zope2:location}/lib/python
-scripts = zopepy
-
 [test]
 recipe = zc.recipe.testrunner
 eggs = ${instance:eggs}
-extra-paths = ${zope2:location}/lib/python
 defaults = ['-m', 'five.grok', '--tests-pattern', '^f?tests$', '-v']

Modified: five.grok/trunk/setup.py
===================================================================
--- five.grok/trunk/setup.py	2009-11-03 10:31:08 UTC (rev 105460)
+++ five.grok/trunk/setup.py	2009-11-03 14:16:55 UTC (rev 105461)
@@ -29,7 +29,8 @@
       install_requires=[
         'setuptools',
         'martian',
-        'five.localsitemanager < 2.0dev',
+        'Zope2',
+        'five.localsitemanager > 2.0dev',
         'grokcore.component',
         'grokcore.formlib >= 1.4',
         'grokcore.view >= 1.12.1',

Modified: five.grok/trunk/src/five/grok/__init__.py
===================================================================
--- five.grok/trunk/src/five/grok/__init__.py	2009-11-03 10:31:08 UTC (rev 105460)
+++ five.grok/trunk/src/five/grok/__init__.py	2009-11-03 14:16:55 UTC (rev 105461)
@@ -21,9 +21,9 @@
 from grokcore.formlib import *
 
 from five.grok.components import Model, Container, Site, LocalUtility
-from five.grok.components import View, Form, AddForm
+from five.grok.components import Form, AddForm
 from five.grok.components import EditForm, DisplayForm
-from five.grok.components import ViewletManager, Viewlet
+from five.grok.components import ViewletManager
 from five.grok.formlib import AutoFields
 
 # backwards compatibility. Probably not needed by many, but just in case.
@@ -35,7 +35,7 @@
 from five.grok.components import ZopeTwoPageTemplateFile as PageTemplateFile
 
 # Override DirectoryResource to use Zope 2 one
-from five.grok.components import ZopeTwoDirectoryResource as DirectoryResource
+#from five.grok.components import ZopeTwoDirectoryResource as DirectoryResource
 
 # Only export public API
 from five.grok.interfaces import IFiveGrokAPI

Modified: five.grok/trunk/src/five/grok/absoluteurl.py
===================================================================
--- five.grok/trunk/src/five/grok/absoluteurl.py	2009-11-03 10:31:08 UTC (rev 105460)
+++ five.grok/trunk/src/five/grok/absoluteurl.py	2009-11-03 14:16:55 UTC (rev 105461)
@@ -16,7 +16,7 @@
 from zope.traversing.browser.interfaces import IAbsoluteURL
 from zope.publisher.interfaces.browser import IBrowserRequest
 
-from five.grok.interfaces import IFiveGrokView
+from grokcore.view.interfaces import IGrokView
 
 from Acquisition import aq_parent, aq_inner
 
@@ -26,7 +26,7 @@
 
 class ViewAbsoluteURL(absoluteurl.AbsoluteURL, grok.MultiAdapter):
 
-    grok.adapts(IFiveGrokView, IBrowserRequest)
+    grok.adapts(IGrokView, IBrowserRequest)
     grok.provides(IAbsoluteURL)
 
     def _obj(self):

Modified: five.grok/trunk/src/five/grok/components.py
===================================================================
--- five.grok/trunk/src/five/grok/components.py	2009-11-03 10:31:08 UTC (rev 105460)
+++ five.grok/trunk/src/five/grok/components.py	2009-11-03 14:16:55 UTC (rev 105461)
@@ -20,7 +20,7 @@
 
 from zope.annotation.interfaces import IAttributeAnnotatable
 from zope.app.pagetemplate.viewpagetemplatefile import ViewMapper
-from zope.app.component.interfaces import IPossibleSite
+from zope.location.interfaces import IPossibleSite
 from zope import interface, component
 
 from grokcore.component.interfaces import IContext
@@ -34,21 +34,21 @@
 import grokcore.view
 import grokcore.security
 
-from five.grok.interfaces import IFiveGrokView
-
-from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile \
-    as BaseViewPageTemplateFile
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
 from Products.Five.browser.pagetemplatefile import getEngine
 from Products.Five.browser import resource
 from Products.Five.formlib import formbase
 from Products.Five.viewlet.manager import ViewletManagerBase as \
     ZopeTwoBaseViewletManager
+from zope.pagetemplate.pagetemplate import PageTemplate as ZopePageTemplate
+
 from Products.PageTemplates.Expressions import SecureModuleImporter
-from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
 from OFS.SimpleItem import SimpleItem
 from OFS.Folder import Folder
 
 import Acquisition
+from AccessControl import getSecurityManager
+from Acquisition import aq_get
 
 
 class Model(SimpleItem):
@@ -65,93 +65,66 @@
     interface.implements(IAttributeAnnotatable, IContext)
 
 
-class Site(BaseSite):
-    interface.implements(IAttributeAnnotatable, IContext, IPossibleSite)
+class Site(Model, BaseSite):
+    interface.implements(IPossibleSite)
 
 
 class LocalUtility(SimpleItem):
     pass
 
 
-class View(grokcore.view.View, Acquisition.Explicit):
+class View(grokcore.view.View):
+    martian.baseclass()
 
-    interface.implements(IFiveGrokView)
 
-    def __init__(self, *args):
-        super(View, self).__init__(*args)
-        if not (self.static is None):
-            # static should be wrapper correctly with acquisition,
-            # otherwise you will not be able to compute URL for
-            # resources.
-            self.static = self.static.__of__(self)
-
-    # We let getPhysicalPath to be acquired. This make static URL's
-    # work, and prevent us to inherit from Acquisition.Implicit
-    getPhysicalPath = Acquisition.Acquired
-
-
-# TODO: This should probably move to Products.Five.browser
-
 class ViewAwareZopePageTemplate(ZopePageTemplate):
 
     def pt_getEngine(self):
         return getEngine()
 
-    def pt_getContext(self):
-        try:
-            root = self.getPhysicalRoot()
-        except AttributeError:
-            try:
-                root = self.context.getPhysicalRoot()
-            except AttributeError:
-                root = None
+    def pt_getContext(self, instance, request=None, **kw):
+        namespace = super(ViewAwareZopePageTemplate, self).pt_getContext(**kw)
+        namespace['request'] = request
+        namespace['view'] = instance
+        namespace['context'] = context = instance.context
+        namespace['views'] = ViewMapper(context, request)
 
-        view = self._getContext()
-        here = Acquisition.aq_inner(self.context)
+        # get the root
+        obj = context
+        root = None
+        meth = aq_get(obj, 'getPhysicalRoot', None)
+        if meth is not None:
+            root = meth()
 
-        request = getattr(root, 'REQUEST', None)
-        c = {'template': self,
-             'here': here,
-             'context': here,
-             'container': here,
-             'nothing': None,
-             'options': {},
-             'root': root,
-             'request': request,
-             'modules': SecureModuleImporter,
-             }
-        if view is not None:
-            c['view'] = view
-            c['views'] = ViewMapper(here, request)
+        namespace.update(here=obj,
+                         # philiKON thinks container should be the view,
+                         # but BBB is more important than aesthetics.
+                         container=obj,
+                         root=root,
+                         modules=SecureModuleImporter,
+                         traverse_subpath=[],  # BBB, never really worked
+                         user = getSecurityManager().getUser())
+        return namespace
 
-        if hasattr(self, 'pt_grokContext'):
-            c.update(self.pt_grokContext)
 
-        return c
-
-
-class ViewPageTemplateFile(BaseViewPageTemplateFile):
-
-    def pt_getContext(self):
-        c = super(ViewPageTemplateFile, self).pt_getContext()
-        if hasattr(self, 'pt_grokContext'):
-            c.update(self.pt_grokContext)
-
-        return c
-
 class ZopeTwoPageTemplate(PageTemplate):
 
     def setFromString(self, string):
-        self._template = ViewAwareZopePageTemplate(id=None, text=string)
+        zpt = ViewAwareZopePageTemplate()
+        if martian.util.not_unicode_or_ascii(string):
+            raise ValueError("Invalid page template. Page templates must be "
+                             "unicode or ASCII.")
+        zpt.write(string)
+        self._template = zpt
 
     def setFromFilename(self, filename, _prefix=None):
         self._template = ViewPageTemplateFile(filename, _prefix)
 
     def render(self, view):
         namespace = self.getNamespace(view)
-        template = self._template.__of__(view)
-        template.pt_grokContext = namespace
-        return template()
+        template = self._template
+        namespace.update(template.pt_getContext(view, view.request))
+        return template.pt_render(namespace)
 
 
 class ZopeTwoPageTemplateFile(ZopeTwoPageTemplate):
@@ -198,12 +171,6 @@
     def __init__(self, *args):
         super(GrokForm, self).__init__(*args)
         self.__name__ = self.__view_name__
-        # super seems not to work correctly since this is needed again.
-        self.static = component.queryAdapter(
-            self.request, interface.Interface,
-            name = self.module_info.package_dotted_name)
-        if not (self.static is None):
-            self.static = self.static.__of__(self)
 
 
 class Form(GrokForm, formbase.PageForm, View):
@@ -211,6 +178,7 @@
     martian.baseclass()
     template = default_form_template
 
+
 class AddForm(GrokForm, formbase.AddForm, View):
 
     martian.baseclass()
@@ -240,15 +208,6 @@
 
     martian.baseclass()
 
-    def __init__(self, context, request, view):
-        super(ViewletManager, self).__init__(context, request, view)
-        if not (self.static is None):
-            # XXX See View
-            self.static = self.static.__of__(self)
-
-    # XXX See View
-    getPhysicalPath = Acquisition.Acquired
-
     def filter(self, viewlets):
         # XXX Need Zope 2 filter
         return ZopeTwoBaseViewletManager.filter(self, viewlets)
@@ -257,16 +216,3 @@
         # XXX Need Zope 2 __getitem__
         return ZopeTwoBaseViewletManager.__getitem__(self, key)
 
-
-class Viewlet(BaseViewlet, Acquisition.Explicit):
-
-    martian.baseclass()
-
-    def __init__(self, context, request, view, manager):
-        super(Viewlet, self).__init__(context, request, view, manager)
-        if not (self.static is None):
-            # XXX See View
-            self.static = self.static.__of__(self)
-
-    # XXX See View
-    getPhysicalPath = Acquisition.Acquired

Modified: five.grok/trunk/src/five/grok/configure.zcml
===================================================================
--- five.grok/trunk/src/five/grok/configure.zcml	2009-11-03 10:31:08 UTC (rev 105460)
+++ five.grok/trunk/src/five/grok/configure.zcml	2009-11-03 14:16:55 UTC (rev 105461)
@@ -5,6 +5,8 @@
     xmlns:grok="http://namespaces.zope.org/grok"
     i18n_domain="five.grok">
 
+  <include package="Products.Five" />
+
   <include package="five.grok" file="meta.zcml" />
 
   <include package="five.localsitemanager" />
@@ -15,7 +17,7 @@
   <grok:grok package=".subscribers" />
   <grok:grok package=".absoluteurl" />
 
-  <utility component=".meta.setupUtility" />
+  <utility component="grokcore.site.meta.setupUtility" />
 
   <browser:defaultView
       for="grokcore.component.interfaces.IContext"

Modified: five.grok/trunk/src/five/grok/ftesting.zcml
===================================================================
--- five.grok/trunk/src/five/grok/ftesting.zcml	2009-11-03 10:31:08 UTC (rev 105460)
+++ five.grok/trunk/src/five/grok/ftesting.zcml	2009-11-03 14:16:55 UTC (rev 105461)
@@ -2,15 +2,10 @@
     xmlns="http://namespaces.zope.org/zope"
     xmlns:grok="http://namespaces.zope.org/grok">
 
-  <!-- This file acts kinda like a virtual "site.zcml" during ftesting.
-   five.grok's zcml needs to be included. /-->
-  <include package="five.grok" file="meta.zcml" />
   <include package="five.grok" />
 
   <!-- And also grok all the ftests /-->
   <grok:grok package="five.grok.ftests" />
-
-  <include package="zope.app.basicskin" />
   <include package="zope.app.rotterdam" />
 
 </configure>

Modified: five.grok/trunk/src/five/grok/ftests/site/folder_site.py
===================================================================
--- five.grok/trunk/src/five/grok/ftests/site/folder_site.py	2009-11-03 10:31:08 UTC (rev 105460)
+++ five.grok/trunk/src/five/grok/ftests/site/folder_site.py	2009-11-03 14:16:55 UTC (rev 105461)
@@ -5,7 +5,7 @@
   >>> universe._setObject("earth", World(id="earth"))
   'earth'
 
-  >>> from zope.app.component.site import setSite
+  >>> from zope.site.hooks import setSite
   >>> setSite(universe.earth)
 
   >>> universe.earth.objectIds()

Modified: five.grok/trunk/src/five/grok/ftests/site/local_site.py
===================================================================
--- five.grok/trunk/src/five/grok/ftests/site/local_site.py	2009-11-03 10:31:08 UTC (rev 105460)
+++ five.grok/trunk/src/five/grok/ftests/site/local_site.py	2009-11-03 14:16:55 UTC (rev 105461)
@@ -2,19 +2,15 @@
   >>> from five.grok.ftests.site.local_site import *
   >>> universe = getRootFolder()
 
-  >>> universe._setObject("earth", World(id="earth"))
-  'earth'
-  >>> from zope.app.component import interfaces
+  >>> universe["earth"] = World(id="earth")
+  >>> from zope.location import interfaces
   >>> from zope.interface.verify import verifyObject
   >>> verifyObject(interfaces.ISite, universe.earth)
   True
 
-  >>> from zope.app.component.site import setSite
+  >>> from zope.site.hooks import setSite
   >>> setSite(universe.earth)
 
-  >>> universe.earth.getSiteManager()
-  <PersistentComponents ...>
-
   >>> from zope import component
   >>> manager = component.getUtility(IEnergyManager)
   >>> manager

Modified: five.grok/trunk/src/five/grok/ftests/test_grok_functional.py
===================================================================
--- five.grok/trunk/src/five/grok/ftests/test_grok_functional.py	2009-11-03 10:31:08 UTC (rev 105460)
+++ five.grok/trunk/src/five/grok/ftests/test_grok_functional.py	2009-11-03 14:16:55 UTC (rev 105461)
@@ -10,6 +10,7 @@
 from Testing.ZopeTestCase import installProduct
 installProduct('PageTemplates')
 
+import Zope2 ; Zope2.startup()
 
 def http_call(method, path, data=None, **kw):
     """Function to help make RESTful calls.

Modified: five.grok/trunk/src/five/grok/ftests/view/layers.py
===================================================================
--- five.grok/trunk/src/five/grok/ftests/view/layers.py	2009-11-03 10:31:08 UTC (rev 105460)
+++ five.grok/trunk/src/five/grok/ftests/view/layers.py	2009-11-03 14:16:55 UTC (rev 105461)
@@ -1,18 +1,18 @@
 """
   >>> from five.grok.ftests.view.layers import *
   >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
- 
+
   >>> from Products.Five.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
-  >>> browser.open("http://localhost/++skin++Basic/manfred/@@cavedrawings")
+  >>> browser.open("http://localhost/manfred/@@cavedrawings")
   >>> print browser.contents
   <html>
   <body>
   <h1>Hello, world!</h1>
   </body>
   </html>
-  
+
   >>> browser.open("http://localhost/++skin++Rotterdam/manfred/@@moredrawings")
   >>> print browser.contents
   Pretty
@@ -23,20 +23,21 @@
 
 """
 from five import grok
-from zope.app.basicskin import IBasicSkin
 from zope.app.rotterdam import rotterdam
 
-grok.layer(IBasicSkin)
 
 class MySkinLayer(grok.IBrowserRequest):
     grok.skin('myskin')
 
+
 class Mammoth(grok.Model):
     pass
 
+
 class CaveDrawings(grok.View):
     pass
 
+
 cavedrawings = grok.PageTemplate("""\
 <html>
 <body>
@@ -45,6 +46,7 @@
 </html>
 """)
 
+
 class MoreDrawings(grok.View):
     grok.layer(rotterdam)
 

Modified: five.grok/trunk/src/five/grok/ftests/view/resource.py
===================================================================
--- five.grok/trunk/src/five/grok/ftests/view/resource.py	2009-11-03 10:31:08 UTC (rev 105460)
+++ five.grok/trunk/src/five/grok/ftests/view/resource.py	2009-11-03 14:16:55 UTC (rev 105461)
@@ -21,7 +21,7 @@
   >>> print browser.contents
   <tal:test>This template should be considered as a file.</tal:test>
   >>> print browser.headers['content-type']
-  text/html; charset=iso-8859-15
+  text/plain; charset=iso-8859-15
 
   Set a content, and ask the view on it. In a view, you should be able
   to get the resource URL:

Modified: five.grok/trunk/src/five/grok/meta.py
===================================================================
--- five.grok/trunk/src/five/grok/meta.py	2009-11-03 10:31:08 UTC (rev 105460)
+++ five.grok/trunk/src/five/grok/meta.py	2009-11-03 14:16:55 UTC (rev 105461)
@@ -27,7 +27,7 @@
 from martian.error import GrokError
 
 from Products.Five.security import protectClass, protectName
-from Globals import InitializeClass as initializeClass
+from App.class_init import InitializeClass as initializeClass
 
 import os.path
 
@@ -84,41 +84,41 @@
     return True
 
 
-class DirectoryResourceGrokker(martian.ClassGrokker):
-    martian.component(components.ZopeTwoDirectoryResource)
+# class DirectoryResourceGrokker(martian.ClassGrokker):
+#     martian.component(components.ZopeTwoDirectoryResource)
 
-    martian.directive(grokcore.view.name, default=None)
-    martian.directive(grokcore.view.path)
-    martian.directive(grokcore.view.layer, default=IDefaultBrowserLayer)
+#     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 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_resource(config, resource_path, name, layer)
+#     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_resource(config, resource_path, name, layer)
 
 
-class StaticResourcesGrokker(martian.GlobalGrokker):
+# class StaticResourcesGrokker(martian.GlobalGrokker):
 
-    def grok(self, name, module, module_info, config, **kw):
-        # we're only interested in static resources if this module
-        # happens to be a package
-        if not module_info.isPackage():
-            return False
-        resource_path = _get_resource_path(module_info, 'static')
+#     def grok(self, name, module, module_info, config, **kw):
+#         # we're only interested in static resources if this module
+#         # happens to be a package
+#         if not module_info.isPackage():
+#             return False
+#         resource_path = _get_resource_path(module_info, 'static')
 
-        if not os.path.exists(resource_path):
-            return False
+#         if not os.path.exists(resource_path):
+#             return False
 
-        name = module_info.dotted_name
-        layer = IDefaultBrowserLayer
-        return _register_resource(config, resource_path, name, layer)
+#         name = module_info.dotted_name
+#         layer = IDefaultBrowserLayer
+#         return _register_resource(config, resource_path, name, layer)
 
 
 class ViewletSecurityGrokker(martian.ClassGrokker):
@@ -151,26 +151,3 @@
 
         return True
 
- at grokcore.component.provider(grokcore.site.interfaces.IUtilityInstaller)
-def setupUtility(site, utility, provides, name=u'',
-                 name_in_container=None, public=False, setup=None):
-    """Set up a utility in a site in Zope2. It's different than Zope3,
-    because before Zope 2.12, setting up an object using [] doesn't
-    work. See the original implementation for more details.
-    """
-    site_manager = site.getSiteManager()
-
-    if not public:
-        container = site_manager
-    else:
-        container = site
-
-    if name_in_container is None:
-        name_in_container = INameChooser(container).chooseName(
-            utility.__class__.__name__, utility)
-    container._setObject(name_in_container, utility)
-
-    if setup is not None:
-        setup(utility)
-
-    site_manager.registerUtility(utility, provided=provides, name=name)

Modified: five.grok/trunk/src/five/grok/meta.zcml
===================================================================
--- five.grok/trunk/src/five/grok/meta.zcml	2009-11-03 10:31:08 UTC (rev 105460)
+++ five.grok/trunk/src/five/grok/meta.zcml	2009-11-03 14:16:55 UTC (rev 105461)
@@ -9,7 +9,7 @@
   <include package="grokcore.site" file="meta.zcml" />
 
   <!-- Load minimal support of grokcore.view, views + templates  -->
-  <include package="grokcore.view" file="meta-minimal.zcml" />
+  <include package="grokcore.view" file="meta.zcml" />
   <include package="grokcore.viewlet" file="meta.zcml" />
   <include package="grokcore.formlib" file="meta.zcml" />
 



More information about the checkins mailing list