[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/publisher - browser.py:1.9

Godefroid Chapelle cvs-admin at zope.org
Sun Dec 7 05:05:22 EST 2003


Update of /cvs-repository/Zope3/src/zope/app/interfaces/publisher
In directory cvs.zope.org:/tmp/cvs-serv5496/app/interfaces/publisher

Modified Files:
	browser.py 
Log Message:
merge gotcha-usage-branch

this finishes support for usage :

top-level variable in page templates
initialized from ZCML

main goal is to use a unique template per skin

now, I should walk all templates that relies on dialog_macros.pt
and convert them to template.pt 




=== Zope3/src/zope/app/interfaces/publisher/browser.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/interfaces/publisher/browser.py:1.8	Wed Sep 24 13:22:06 2003
+++ Zope3/src/zope/app/interfaces/publisher/browser.py	Sun Dec  7 05:04:52 2003
@@ -22,6 +22,25 @@
 from zope.schema import TextLine, Text
 
 
+
+class IUsage(Interface):
+
+    usage = TextLine(
+        title=u"The template usage top-level variable",
+        description=u"""
+          See the usage documentation in the README.txt in the
+          zope/app/browser/skins directory.
+          If this view is associated with a menu item, this attribute should
+          not be supplied as the view will get its usage from the menu the
+          menu item is registered to.
+          This attribute is available for views not associated with a menu
+          item.
+          """,
+        required=False,
+        default=u""
+        )
+
+
 class IBrowserMenuItem(Interface):
     """A menu item represents one view. These views might be conditioned
     (using a filter) or being selected to be the default view of the menu."""
@@ -75,7 +94,7 @@
         required=False)
 
 
-class IBrowserMenu(Interface):
+class IBrowserMenu(IUsage):
     """A menu can contain a set of views that a represented asa
     collective."""
 
@@ -88,14 +107,6 @@
         title=_("A longer explanation of the menu"),
         description=_("A UI may display this with the item or display it "
                       "when the user requests more assistance."),
-        required=False)
-
-    usage = TextLine(
-        title=_("The templates usage top-level variable"),
-        description=_("See the usage documentation in the README.txt in the "
-                      "zope/app/browser/skins directory. If a view is "
-                      "associated with a menu item, the view will get its "
-                      "usage from the menu the menu item is registered to."),
         required=False)
 
     def getMenuItems(object=None):




More information about the Zope3-Checkins mailing list