[Checkins] SVN: grok/branches/ksmith_mcweekly-layers/ grok.Layer renamed grok.ILayer, grok.ILayer inherits IDefaultBrowserLayer, tests updated and pass

Kevin Smith kevin at mcweekly.com
Wed Apr 25 19:02:19 EDT 2007


Log message for revision 74769:
  grok.Layer renamed grok.ILayer, grok.ILayer inherits IDefaultBrowserLayer, tests updated and pass

Changed:
  _U  grok/branches/ksmith_mcweekly-layers/
  _U  grok/branches/ksmith_mcweekly-layers/src/
  _U  grok/branches/ksmith_mcweekly-layers/src/grok/
  U   grok/branches/ksmith_mcweekly-layers/src/grok/__init__.py
  U   grok/branches/ksmith_mcweekly-layers/src/grok/components.py
  _U  grok/branches/ksmith_mcweekly-layers/src/grok/ftests/
  _U  grok/branches/ksmith_mcweekly-layers/src/grok/ftests/admin/
  _U  grok/branches/ksmith_mcweekly-layers/src/grok/ftests/catalog/
  _U  grok/branches/ksmith_mcweekly-layers/src/grok/ftests/form/
  U   grok/branches/ksmith_mcweekly-layers/src/grok/ftests/static/simple.py
  U   grok/branches/ksmith_mcweekly-layers/src/grok/ftests/static/simple_fixture/ellie.py
  _U  grok/branches/ksmith_mcweekly-layers/src/grok/ftests/view/
  U   grok/branches/ksmith_mcweekly-layers/src/grok/ftests/view/layer.py
  U   grok/branches/ksmith_mcweekly-layers/src/grok/meta.py

-=-

Property changes on: grok/branches/ksmith_mcweekly-layers
___________________________________________________________________
Name: svn:ignore
   - develop-eggs
eggs
bin
parts
.installed.cfg
build
dist

   + develop-eggs
eggs
bin
parts
.installed.cfg
build
dist
*.pyc



Property changes on: grok/branches/ksmith_mcweekly-layers/src
___________________________________________________________________
Name: svn:ignore
   - grok.egg-info

   + grok.egg-info
*.pyc



Property changes on: grok/branches/ksmith_mcweekly-layers/src/grok
___________________________________________________________________
Name: svn:ignore
   + *.pyc


Modified: grok/branches/ksmith_mcweekly-layers/src/grok/__init__.py
===================================================================
--- grok/branches/ksmith_mcweekly-layers/src/grok/__init__.py	2007-04-25 21:00:08 UTC (rev 74768)
+++ grok/branches/ksmith_mcweekly-layers/src/grok/__init__.py	2007-04-25 23:02:19 UTC (rev 74769)
@@ -30,11 +30,11 @@
     IContainerModifiedEvent, ContainerModifiedEvent)
 
 from grok.components import ClassGrokker, InstanceGrokker, ModuleGrokker
-from grok.components import Model, Adapter, MultiAdapter, View, XMLRPC, JSON, Layer
+from grok.components import Model, Adapter, MultiAdapter, View, XMLRPC, JSON
 from grok.components import PageTemplate, PageTemplateFile, Container, Traverser
 from grok.components import Site, GlobalUtility, LocalUtility, Annotation
 from grok.components import Application, Form, AddForm, EditForm, DisplayForm
-from grok.components import Indexes, Skin
+from grok.components import Indexes, Skin, ILayer
 from grok.directive import (context, name, template, templatedir, provides,
                             baseclass, global_utility, local_utility,
                             define_permission, require, site, layer)

Modified: grok/branches/ksmith_mcweekly-layers/src/grok/components.py
===================================================================
--- grok/branches/ksmith_mcweekly-layers/src/grok/components.py	2007-04-25 21:00:08 UTC (rev 74768)
+++ grok/branches/ksmith_mcweekly-layers/src/grok/components.py	2007-04-25 23:02:19 UTC (rev 74769)
@@ -31,6 +31,7 @@
 from zope.publisher.browser import BrowserPage
 from zope.publisher.interfaces import NotFound
 from zope.publisher.interfaces.browser import (IBrowserPublisher,
+                                               IDefaultBrowserLayer,
                                                IBrowserRequest)
 from zope.publisher.publish import mapply
 from zope.pagetemplate import pagetemplate, pagetemplatefile
@@ -504,7 +505,7 @@
 Indexes = IndexesClass('Indexes')
 
 
-class Layer(IBrowserRequest):
+class ILayer(IDefaultBrowserLayer):
     pass
 
 


Property changes on: grok/branches/ksmith_mcweekly-layers/src/grok/ftests
___________________________________________________________________
Name: svn:ignore
   + *.pyc



Property changes on: grok/branches/ksmith_mcweekly-layers/src/grok/ftests/admin
___________________________________________________________________
Name: svn:ignore
   + 



Property changes on: grok/branches/ksmith_mcweekly-layers/src/grok/ftests/catalog
___________________________________________________________________
Name: svn:ignore
   + *.pyc



Property changes on: grok/branches/ksmith_mcweekly-layers/src/grok/ftests/form
___________________________________________________________________
Name: svn:ignore
   + 


Modified: grok/branches/ksmith_mcweekly-layers/src/grok/ftests/static/simple.py
===================================================================
--- grok/branches/ksmith_mcweekly-layers/src/grok/ftests/static/simple.py	2007-04-25 21:00:08 UTC (rev 74768)
+++ grok/branches/ksmith_mcweekly-layers/src/grok/ftests/static/simple.py	2007-04-25 23:02:19 UTC (rev 74769)
@@ -52,13 +52,14 @@
   >>> print browser.contents
   inky darkness all around
 
-Static layer is not available to custom layers unless they subclass IDefaultBrowserLayer
 
+grok.ILayer now inherits IDefaultBrowserLayer
+
   >>> browser.open('http://localhost/++skin++mammothskin/@@/grok.ftests.static.simple_fixture/subdir/otherfile.txt')
-  Traceback (most recent call last):
-  ...
-  NotFound: ...
+  >>> print browser.contents
+  This is yet another file.
 
+
   >>> browser.open('http://localhost/++skin++Rotterdam/@@/grok.ftests.static.simple_fixture/subdir/otherfile.txt')
   >>> print browser.contents
   This is yet another file.

Modified: grok/branches/ksmith_mcweekly-layers/src/grok/ftests/static/simple_fixture/ellie.py
===================================================================
--- grok/branches/ksmith_mcweekly-layers/src/grok/ftests/static/simple_fixture/ellie.py	2007-04-25 21:00:08 UTC (rev 74768)
+++ grok/branches/ksmith_mcweekly-layers/src/grok/ftests/static/simple_fixture/ellie.py	2007-04-25 23:02:19 UTC (rev 74769)
@@ -13,7 +13,7 @@
 </body>
 </html>""")
 
-class MammothLayer(grok.Layer):
+class MammothLayer(grok.ILayer):
     pass
 
 class MammothSkin(grok.Skin):


Property changes on: grok/branches/ksmith_mcweekly-layers/src/grok/ftests/view
___________________________________________________________________
Name: svn:ignore
   + *.pyc


Modified: grok/branches/ksmith_mcweekly-layers/src/grok/ftests/view/layer.py
===================================================================
--- grok/branches/ksmith_mcweekly-layers/src/grok/ftests/view/layer.py	2007-04-25 21:00:08 UTC (rev 74768)
+++ grok/branches/ksmith_mcweekly-layers/src/grok/ftests/view/layer.py	2007-04-25 23:02:19 UTC (rev 74769)
@@ -36,7 +36,7 @@
 
 grok.layer(IBasicSkin)
 
-class MySkinLayer(grok.Layer):
+class MySkinLayer(grok.ILayer):
     pass
 
 class MySkin(grok.Skin):

Modified: grok/branches/ksmith_mcweekly-layers/src/grok/meta.py
===================================================================
--- grok/branches/ksmith_mcweekly-layers/src/grok/meta.py	2007-04-25 21:00:08 UTC (rev 74768)
+++ grok/branches/ksmith_mcweekly-layers/src/grok/meta.py	2007-04-25 23:02:19 UTC (rev 74769)
@@ -111,8 +111,8 @@
                                  default_permission)
             util.make_checker(factory, method_view, permission)
     
-class LayerGrokker(grok.ClassGrokker):
-    component_class = grok.Layer
+class ILayerGrokker(grok.ClassGrokker):
+    component_class = grok.ILayer
 
 
 class ViewGrokker(grok.ClassGrokker):



More information about the Checkins mailing list