[Checkins] SVN: grok/trunk/ Now use grokcore.component 1.1. This has a new IContext interface.

Martijn Faassen faassen at infrae.com
Sat May 3 11:58:22 EDT 2008


Log message for revision 86248:
  Now use grokcore.component 1.1. This has a new IContext interface.
  

Changed:
  U   grok/trunk/CHANGES.txt
  U   grok/trunk/setup.py
  U   grok/trunk/src/grok/admin/objectinfo.txt
  U   grok/trunk/src/grok/components.py
  U   grok/trunk/src/grok/interfaces.py
  U   grok/trunk/src/grok/meta.py
  U   grok/trunk/versions.cfg

-=-
Modified: grok/trunk/CHANGES.txt
===================================================================
--- grok/trunk/CHANGES.txt	2008-05-03 15:56:37 UTC (rev 86247)
+++ grok/trunk/CHANGES.txt	2008-05-03 15:58:22 UTC (rev 86248)
@@ -44,6 +44,12 @@
 
   for details.
 
+* There is now a new ``IContext`` interface available. If you make
+  your class implement that interface, it (and its subclasses) will be
+  candidates for being a context in a module (for automatic context
+  lookup if ``grok.context`` is not present). This relies on a feature
+  introduced in grokcore.component 1.1.
+
 Bug fixes
 ---------
 

Modified: grok/trunk/setup.py
===================================================================
--- grok/trunk/setup.py	2008-05-03 15:56:37 UTC (rev 86247)
+++ grok/trunk/setup.py	2008-05-03 15:58:22 UTC (rev 86248)
@@ -36,7 +36,7 @@
     zip_safe=False,
     install_requires=['setuptools',
                       'martian >= 0.9.3',
-                      'grokcore.component',
+                      'grokcore.component >= 1.1',
                       'simplejson',
                       'pytz',
                       'ZODB3',

Modified: grok/trunk/src/grok/admin/objectinfo.txt
===================================================================
--- grok/trunk/src/grok/admin/objectinfo.txt	2008-05-03 15:56:37 UTC (rev 86247)
+++ grok/trunk/src/grok/admin/objectinfo.txt	2008-05-03 15:58:22 UTC (rev 86248)
@@ -337,7 +337,7 @@
   (<InterfaceClass zope.app.folder.interfaces.IFolder>, <InterfaceClass persistent.interfaces.IPersistent>, <InterfaceClass zope.location.interfaces.IPossibleSite>, <InterfaceClass zope.app.container.interfaces.IContained>)
 
   >>> sweethome_info.getProvidedInterfaces()
-  (<InterfaceClass zope.annotation.interfaces.IAttributeAnnotatable>, <InterfaceClass zope.app.container.interfaces.IContainer>, <InterfaceClass zope.app.container.interfaces.IContained>, <InterfaceClass persistent.interfaces.IPersistent>)
+  (<InterfaceClass zope.annotation.interfaces.IAttributeAnnotatable>, <InterfaceClass zope.app.container.interfaces.IContainer>, <InterfaceClass zope.app.container.interfaces.IContained>, <InterfaceClass persistent.interfaces.IPersistent>, <InterfaceClass grokcore.component.interfaces.IContext>)
 
 Manfred again, is a bit too plain to give us interesting information:
 

Modified: grok/trunk/src/grok/components.py
===================================================================
--- grok/trunk/src/grok/components.py	2008-05-03 15:56:37 UTC (rev 86247)
+++ grok/trunk/src/grok/components.py	2008-05-03 15:58:22 UTC (rev 86248)
@@ -661,6 +661,8 @@
     pass
 
 class ViewletManager(ViewletManagerBase):
+    interface.implements(interfaces.IViewletManager)
+    
     template = None
 
     def __init__(self, context, request, view):

Modified: grok/trunk/src/grok/interfaces.py
===================================================================
--- grok/trunk/src/grok/interfaces.py	2008-05-03 15:56:37 UTC (rev 86247)
+++ grok/trunk/src/grok/interfaces.py	2008-05-03 15:58:22 UTC (rev 86248)
@@ -17,7 +17,10 @@
 from zope.publisher.interfaces.browser import IBrowserPage, IBrowserView
 from zope.formlib.interfaces import reConstraint
 from zope.interface.interfaces import IInterface
+from zope.viewlet.interfaces import IViewletManager as IViewletManagerBase
 
+from grokcore.component.interfaces import IContext
+
 class IGrokBaseClasses(interface.Interface):
     ClassGrokker = interface.Attribute("Base class to define a class "
                                        "grokker.")
@@ -496,3 +499,7 @@
     def render(view):
         """Renders the template"""
 
+class IViewletManager(IViewletManagerBase):
+    """The Grok viewlet manager.
+    """
+

Modified: grok/trunk/src/grok/meta.py
===================================================================
--- grok/trunk/src/grok/meta.py	2008-05-03 15:56:37 UTC (rev 86247)
+++ grok/trunk/src/grok/meta.py	2008-05-03 15:58:22 UTC (rev 86248)
@@ -54,6 +54,7 @@
 from grok.util import public_methods_from_class
 from grok.rest import RestPublisher
 from grok.interfaces import IRESTSkinType
+from grok.interfaces import IViewletManager as IGrokViewletManager
 
 from grokcore.component.meta import get_context, get_name, get_name_classname
 from grokcore.component.util import check_adapts
@@ -72,7 +73,7 @@
     def grok(self, name, module, module_info, config, **kw):
         viewletmanager = determine_module_component(module_info,
                                                     'grok.viewletmanager',
-                                                    [grok.ViewletManager])
+                                                    IGrokViewletManager)
         module.__grok_viewletmanager__ = viewletmanager
         return True
 

Modified: grok/trunk/versions.cfg
===================================================================
--- grok/trunk/versions.cfg	2008-05-03 15:56:37 UTC (rev 86247)
+++ grok/trunk/versions.cfg	2008-05-03 15:58:22 UTC (rev 86248)
@@ -6,7 +6,7 @@
 ZODB3 = 3.8
 docutils = 0.4
 martian = 0.9.3
-grokcore.component = 1.0.1
+grokcore.component = 1.1
 mechanize = 0.1.7b
 pytz = 2007k
 simplejson = 1.7.1



More information about the Checkins mailing list