[Zope3-checkins] CVS: zopeproducts/zwiki/browser - wiki.py:1.11 wikipage.py:1.13

Philipp von Weitershausen philikon at philikon.de
Thu Sep 25 11:07:04 EDT 2003


Update of /cvs-repository/zopeproducts/zwiki/browser
In directory cvs.zope.org:/tmp/cvs-serv3518/browser

Modified Files:
	wiki.py wikipage.py 
Log Message:
Fixes for parentgeddon:

- ContextWrappers are gone

- use setitem instead of setObject


=== zopeproducts/zwiki/browser/wiki.py 1.10 => 1.11 ===
--- zopeproducts/zwiki/browser/wiki.py:1.10	Tue Aug 12 22:44:38 2003
+++ zopeproducts/zwiki/browser/wiki.py	Thu Sep 25 11:06:32 2003
@@ -20,7 +20,6 @@
 from datetime import datetime
 from zope.component import \
      getAdapter, getService, getServiceManager, createObject
-from zope.app.context import ContextWrapper
 from zope.proxy import removeAllProxies
 from zope.app.interfaces.dublincore import ICMFDublinCore
 from zope.app.services.servicenames import HubIds
@@ -44,19 +43,17 @@
         if self.request.get('textindex'):
             # Get the environment
             sm = getServiceManager(content)
-            pkg = ContextWrapper(sm['default'], sm, name='default')
-            hub = ContextWrapper(pkg['HubIds-1'], sm, name='HubIds-1')
+            pkg = sm['default']
+            hub = pkg['HubIds-1']
             # Create, subscribe and add a Registration object.
             if 'WikiReg' not in pkg: 
                 reg = Registration()
-                pkg.setObject('WikiReg', reg)
-                reg = ContextWrapper(reg, pkg, name='WikiReg')
+                pkg['WikiReg'] = reg
                 reg.subscribe()
             # Create, subscribe and add an WikiTextIndex object
             if 'WikiTextIndex' not in pkg: 
                 index = WikiTextIndex()
-                pkg.setObject('WikiTextIndex', index)
-                index = ContextWrapper(index, pkg, name='WikiTextIndex')
+                pkg['WikiTextIndex'] = index
                 index.subscribe(hub, True)
 
         if self.request.get('frontpage'):
@@ -67,10 +64,10 @@
             dc.created = datetime.now()
             dc.modified = datetime.now()
             dc.creators = [u'wiki']
-            content.setObject('FrontPage', page)
-            
+            content['FrontPage'] = page
+
         return content
-    
+
 
 class WikiSearch(object):
     """Search Wiki Pages"""
@@ -118,10 +115,9 @@
         children = []
 
         for name, page in self.context.items():
-            wrapped = ContextWrapper(page, self.context, name=name)
-            hier = getAdapter(wrapped, IWikiPageHierarchy)
+            hier = getAdapter(page, IWikiPageHierarchy)
             if hier.getParents() == ():
-                children.append((wrapped, hier.findChildren())) 
+                children.append((page, hier.findChildren())) 
         return self._branchHTML(children)
 
     def _branchHTML(self, children):


=== zopeproducts/zwiki/browser/wikipage.py 1.12 => 1.13 ===
--- zopeproducts/zwiki/browser/wikipage.py:1.12	Tue Aug 19 03:12:18 2003
+++ zopeproducts/zwiki/browser/wikipage.py	Thu Sep 25 11:06:32 2003
@@ -22,7 +22,6 @@
 from zope.app.browser.form.submit import Update
 from zope.app.browser.form.vocabularywidget import VocabularyFieldEditWidget
 from zope.app.browser.form.widget import ListWidget
-from zope.app.context import ContextWrapper
 from zope.app.form.widget import CustomWidget
 from zope.app.interfaces.dublincore import ICMFDublinCore
 from zope.app.traversing import getParent, getPath, getName




More information about the Zope3-Checkins mailing list