[Zope3-checkins] CVS: Zope3/src/zope/app/services - viewpackage.py:1.4

Jim Fulton jim@zope.com
Fri, 7 Feb 2003 10:10:24 -0500


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

Modified Files:
	viewpackage.py 
Log Message:
view packages were broken by the addition of the 'attribute' field in
page configurations. This was because the page configuration
contstructor changed in a non-backward-compatible way.  This wasn't
caught be the test for adding templates to page folders.

- Fixed the test

- Changed view package setObject to use keyword arguments when
  creating a page config.

- provided a default value for the attribute field in the page config 
  class.



=== Zope3/src/zope/app/services/viewpackage.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/services/viewpackage.py:1.3	Mon Feb  3 12:29:09 2003
+++ Zope3/src/zope/app/services/viewpackage.py	Fri Feb  7 10:09:51 2003
@@ -40,6 +40,8 @@
     description = ''
     title = ''
     factoryName = None
+    attribute = None
+    template = None
 
     def __init__(self):
         super(ViewPackage, self).__init__()
@@ -55,10 +57,14 @@
         name = super(ViewPackage, base).setObject(name, object)
         template = getItem(self, name)
         template = getPhysicalPathString(template)
-        config = PageConfiguration(self.forInterface, name,
-                                   self.permission,
-                                   self.factoryName, template,
-                                   self.layer)
+        config = PageConfiguration(
+            forInterface=self.forInterface,
+            viewName=name,
+            permission=self.permission,
+            class_=self.factoryName,
+            template=template,
+            layer=self.layer,
+            )
         configure = traverse(self, 'configure')
         id = configure.setObject('', config)
         config = getItem(configure, id)