[Zope3-checkins] CVS: Zope3/src/zope/app/pagetemplate - viewpagetemplatefile.py:1.5

Godefroid Chapelle gotcha@swing.be
Fri, 11 Apr 2003 18:16:17 -0400


Update of /cvs-repository/Zope3/src/zope/app/pagetemplate
In directory cvs.zope.org:/tmp/cvs-serv9040/app/pagetemplate

Modified Files:
	viewpagetemplatefile.py 
Log Message:
- added usage argument to ZCML menu directive
  The menu usage is used by the configuration to initialize 
  the page view usage in case a page is registered as a
  menu item included in a menu declared with a usage argument.

- added corresponding tests

- various ZCML refactorings to improve usage initialization

- added tests for menu and usage on page directive



=== Zope3/src/zope/app/pagetemplate/viewpagetemplatefile.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/pagetemplate/viewpagetemplatefile.py:1.4	Tue Apr  8 08:21:37 2003
+++ Zope3/src/zope/app/pagetemplate/viewpagetemplatefile.py	Fri Apr 11 18:15:46 2003
@@ -46,7 +46,7 @@
         # parameter template_usage needed such as the publisher machinery
         # can find it and extract it from the request
         if not template_usage:
-            template_usage = self.usage
+            template_usage = self.usage or getattr(instance, 'usage', u'')
         keywords["template_usage"] = template_usage
         namespace = self.pt_getContext(
             request=instance.request,