[Checkins] SVN: grok/branches/jw-philipp-using-ndir-directives/ Merge from the trunk:

Philipp von Weitershausen philikon at philikon.de
Sun May 4 08:45:10 EDT 2008


Log message for revision 86355:
  Merge from the trunk:
  
  Log message for revision 86248:
    Now use grokcore.component 1.1. This has a new IContext interface.
  

Changed:
  U   grok/branches/jw-philipp-using-ndir-directives/CHANGES.txt
  U   grok/branches/jw-philipp-using-ndir-directives/setup.py
  U   grok/branches/jw-philipp-using-ndir-directives/src/grok/admin/objectinfo.txt
  U   grok/branches/jw-philipp-using-ndir-directives/src/grok/components.py
  U   grok/branches/jw-philipp-using-ndir-directives/src/grok/interfaces.py
  U   grok/branches/jw-philipp-using-ndir-directives/src/grok/meta.py
  U   grok/branches/jw-philipp-using-ndir-directives/versions.cfg

-=-
Modified: grok/branches/jw-philipp-using-ndir-directives/CHANGES.txt
===================================================================
--- grok/branches/jw-philipp-using-ndir-directives/CHANGES.txt	2008-05-04 12:43:07 UTC (rev 86354)
+++ grok/branches/jw-philipp-using-ndir-directives/CHANGES.txt	2008-05-04 12:45:10 UTC (rev 86355)
@@ -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/branches/jw-philipp-using-ndir-directives/setup.py
===================================================================
--- grok/branches/jw-philipp-using-ndir-directives/setup.py	2008-05-04 12:43:07 UTC (rev 86354)
+++ grok/branches/jw-philipp-using-ndir-directives/setup.py	2008-05-04 12:45:10 UTC (rev 86355)
@@ -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/branches/jw-philipp-using-ndir-directives/src/grok/admin/objectinfo.txt
===================================================================
--- grok/branches/jw-philipp-using-ndir-directives/src/grok/admin/objectinfo.txt	2008-05-04 12:43:07 UTC (rev 86354)
+++ grok/branches/jw-philipp-using-ndir-directives/src/grok/admin/objectinfo.txt	2008-05-04 12:45:10 UTC (rev 86355)
@@ -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/branches/jw-philipp-using-ndir-directives/src/grok/components.py
===================================================================
--- grok/branches/jw-philipp-using-ndir-directives/src/grok/components.py	2008-05-04 12:43:07 UTC (rev 86354)
+++ grok/branches/jw-philipp-using-ndir-directives/src/grok/components.py	2008-05-04 12:45:10 UTC (rev 86355)
@@ -660,6 +660,8 @@
     pass
 
 class ViewletManager(ViewletManagerBase):
+    interface.implements(interfaces.IViewletManager)
+    
     template = None
 
     def __init__(self, context, request, view):

Modified: grok/branches/jw-philipp-using-ndir-directives/src/grok/interfaces.py
===================================================================
--- grok/branches/jw-philipp-using-ndir-directives/src/grok/interfaces.py	2008-05-04 12:43:07 UTC (rev 86354)
+++ grok/branches/jw-philipp-using-ndir-directives/src/grok/interfaces.py	2008-05-04 12:45:10 UTC (rev 86355)
@@ -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/branches/jw-philipp-using-ndir-directives/src/grok/meta.py
===================================================================
--- grok/branches/jw-philipp-using-ndir-directives/src/grok/meta.py	2008-05-04 12:43:07 UTC (rev 86354)
+++ grok/branches/jw-philipp-using-ndir-directives/src/grok/meta.py	2008-05-04 12:45:10 UTC (rev 86355)
@@ -54,6 +54,7 @@
 from grok.util import get_name_classname
 from grok.rest import RestPublisher
 from grok.interfaces import IRESTSkinType
+from grok.interfaces import IViewletManager as IGrokViewletManager
 
 from grokcore.component.util import determine_module_component
 from grokcore.component.util import check_module_component
@@ -65,7 +66,7 @@
     def grok(self, name, module, module_info, config, **kw):
         viewletmanager = determine_module_component(module_info,
                                                     grok.viewletmanager,
-                                                    [grok.ViewletManager])
+                                                    IGrokViewletManager)
         grok.viewletmanager.set(module, viewletmanager)
         return True
 

Modified: grok/branches/jw-philipp-using-ndir-directives/versions.cfg
===================================================================
--- grok/branches/jw-philipp-using-ndir-directives/versions.cfg	2008-05-04 12:43:07 UTC (rev 86354)
+++ grok/branches/jw-philipp-using-ndir-directives/versions.cfg	2008-05-04 12:45:10 UTC (rev 86355)
@@ -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