[Checkins] SVN: zope.browserzcml2/trunk/src/zope/browserzcml2/zcml.py shift some things around and improve docstrings

Philipp von Weitershausen philikon at philikon.de
Fri Apr 21 13:36:55 EDT 2006


Log message for revision 67237:
  shift some things around and improve docstrings
  

Changed:
  U   zope.browserzcml2/trunk/src/zope/browserzcml2/zcml.py

-=-
Modified: zope.browserzcml2/trunk/src/zope/browserzcml2/zcml.py
===================================================================
--- zope.browserzcml2/trunk/src/zope/browserzcml2/zcml.py	2006-04-21 17:35:25 UTC (rev 67236)
+++ zope.browserzcml2/trunk/src/zope/browserzcml2/zcml.py	2006-04-21 17:36:54 UTC (rev 67237)
@@ -32,36 +32,9 @@
 from zope.app.pagetemplate import ViewPageTemplateFile
 from zope.app.component.metaconfigure import adapter
 
-class IPageTemplateDirective(IViewCharacteristics, IRegisterInMenu):
-
-    template = zope.configuration.fields.Path(
-        title=_(u"Template"),
-        description=_(u"""
-        Refers to a file containing a page template (should end in
-        extension '.pt' or '.html')."""),
-        required=True
-        )
-
-def pageTemplate(
-    _context, template,                                 # IPageTemplateDirective
-    for_, name, permission, layer=IDefaultBrowserLayer, # IViewCharacteristics
-    menu=None, title=None):                             # IRegisterInMenu
-
-    class TemplatePage(zope.formlib.Page):
-        __call__ = ViewPageTemplateFile(template)
-
-    page(_context, TemplatePage,
-         for_, name, permission, layer,
-         menu, title)
-
 class IPageDirective(IViewCharacteristics, IRegisterInMenu):
-    """Define multiple pages without repeating all of the parameters.
+    """Define a browser page"""
 
-    The pages directive allows multiple page views to be defined
-    without repeating the 'for', 'permission', 'class', 'layer',
-    'allowed_attributes', and 'allowed_interface' attributes.
-    """
-
     factory = zope.configuration.fields.GlobalObject(
         title=_(u"Factory"),
         description=_(u"Adapter factory that returns the browser page. "
@@ -87,14 +60,34 @@
 
     _handle_menu(_context, menu, title, (for_,), name, permission, layer)
 
-class IPagesFromClassDirective(IViewCharacteristics):
-    """Define multiple pages without repeating all of the parameters.
 
-    The pages directive allows multiple page views to be defined
-    without repeating the 'for', 'permission', 'class', 'layer',
-    'allowed_attributes', and 'allowed_interface' attributes.
-    """
+class IPageTemplateDirective(IViewCharacteristics, IRegisterInMenu):
+    """Define a browser page from a page template"""
 
+    template = zope.configuration.fields.Path(
+        title=_(u"Template"),
+        description=_(u"""
+        Refers to a file containing a page template (should end in
+        extension '.pt' or '.html')."""),
+        required=True
+        )
+
+def pageTemplate(
+    _context, template,                                 # IPageTemplateDirective
+    for_, name, permission, layer=IDefaultBrowserLayer, # IViewCharacteristics
+    menu=None, title=None):                             # IRegisterInMenu
+
+    class TemplatePage(zope.formlib.Page):
+        __call__ = ViewPageTemplateFile(template)
+
+    page(_context, TemplatePage,
+         for_, name, permission, layer,
+         menu, title)
+
+
+class IPagesFromClassDirective(IViewCharacteristics):
+    """Define multiple pages from a single class"""
+
     class_ = zope.configuration.fields.GlobalObject(
         title=_(u"Class"),
         description=_(u"A class from which one or more browser pages will "



More information about the Checkins mailing list