[Zope-Checkins] SVN: Products.Five/branches/publication-refactor2/browser/metaconfigure.py All browser views, implement IPublishTraverse and has such

2006-04-21 Thread Michael Kerrin
Log message for revision 67256:
  All browser views, implement IPublishTraverse and has such
  they must do the __of__(context) call on the returned object.
  

Changed:
  U   Products.Five/branches/publication-refactor2/browser/metaconfigure.py

-=-
Modified: Products.Five/branches/publication-refactor2/browser/metaconfigure.py
===
--- Products.Five/branches/publication-refactor2/browser/metaconfigure.py   
2006-04-21 19:54:38 UTC (rev 67255)
+++ Products.Five/branches/publication-refactor2/browser/metaconfigure.py   
2006-04-21 20:05:25 UTC (rev 67256)
@@ -195,10 +195,10 @@
 return getattr(self, pages[name])
 view = zapi.queryView(self, name, request)
 if view is not None:
-return view
+return view.__of__(self)
 
 m = class_.publishTraverse.__get__(self)
-return m(request, name)
+return m(request, name).__of__(self)
 
 else:
 def publishTraverse(self, request, name,
@@ -208,7 +208,7 @@
 return getattr(self, pages[name])
 view = zapi.queryView(self, name, request)
 if view is not None:
-return view
+return view.__of__(self)
 
 raise NotFoundError(self, name, request)
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/publication-refactor2/meta.zcml try loading the zope.app.publication meta file

2006-04-21 Thread Michael Kerrin
Log message for revision 67252:
  try loading the zope.app.publication meta file
  

Changed:
  U   Products.Five/branches/publication-refactor2/meta.zcml

-=-
Modified: Products.Five/branches/publication-refactor2/meta.zcml
===
--- Products.Five/branches/publication-refactor2/meta.zcml  2006-04-21 
18:57:50 UTC (rev 67251)
+++ Products.Five/branches/publication-refactor2/meta.zcml  2006-04-21 
19:00:51 UTC (rev 67252)
@@ -195,4 +195,7 @@
   
   
 
+  
+  
+
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/publication-refactor2/configure.zcml register the Zope2 request object with the zope3 publisher

2006-04-21 Thread Michael Kerrin
Log message for revision 67251:
  register the Zope2 request object with the zope3 publisher
  

Changed:
  U   Products.Five/branches/publication-refactor2/configure.zcml

-=-
Modified: Products.Five/branches/publication-refactor2/configure.zcml
===
--- Products.Five/branches/publication-refactor2/configure.zcml 2006-04-21 
18:42:37 UTC (rev 67250)
+++ Products.Five/branches/publication-refactor2/configure.zcml 2006-04-21 
18:57:50 UTC (rev 67251)
@@ -16,6 +16,14 @@
   
   
 
+  
+
   
   http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/publication-refactor2/ define Zope2 specific request traversal type and

2006-04-21 Thread Michael Kerrin
Log message for revision 67247:
  define Zope2 specific request traversal type and
  configure the IPublisTraverse adapter in ZPublisher.Publication
  

Changed:
  U   Products.Five/branches/publication-refactor2/browser/metaconfigure.py
  U   Products.Five/branches/publication-refactor2/configure.zcml
  U   Products.Five/branches/publication-refactor2/interfaces.py

-=-
Modified: Products.Five/branches/publication-refactor2/browser/metaconfigure.py
===
--- Products.Five/branches/publication-refactor2/browser/metaconfigure.py   
2006-04-21 18:10:19 UTC (rev 67246)
+++ Products.Five/branches/publication-refactor2/browser/metaconfigure.py   
2006-04-21 18:14:08 UTC (rev 67247)
@@ -20,6 +20,7 @@
 """
 import os
 
+from zope.app import zapi
 from zope.interface import Interface
 from zope.configuration.exceptions import ConfigurationError
 from zope.publisher.interfaces.browser import IBrowserRequest, \

Modified: Products.Five/branches/publication-refactor2/configure.zcml
===
--- Products.Five/branches/publication-refactor2/configure.zcml 2006-04-21 
18:10:19 UTC (rev 67246)
+++ Products.Five/branches/publication-refactor2/configure.zcml 2006-04-21 
18:14:08 UTC (rev 67247)
@@ -44,4 +44,20 @@

interface="zope.publisher.interfaces.browser.IBrowserRequest"
/>
 
+  
+  
+
+  
+
 

Modified: Products.Five/branches/publication-refactor2/interfaces.py
===
--- Products.Five/branches/publication-refactor2/interfaces.py  2006-04-21 
18:10:19 UTC (rev 67246)
+++ Products.Five/branches/publication-refactor2/interfaces.py  2006-04-21 
18:14:08 UTC (rev 67247)
@@ -27,6 +27,10 @@
 find the method to be published.
 """
 
+class IZope2Request(Interface):
+"""Marks the Zope2 request"""
+pass
+
 class IMenuItemType(IInterface):
 """Menu item type
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PageTemplates/ A new test and a new fix.

2006-04-21 Thread Lennart Regebro
Log message for revision 67246:
  A new test and a new fix.
  

Changed:
  U   Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py
  U   Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py

-=-
Modified: Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py
2006-04-21 18:04:43 UTC (rev 67245)
+++ Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py
2006-04-21 18:10:19 UTC (rev 67246)
@@ -134,6 +134,14 @@
 self.ZBindings_edit(self._default_bindings)
 self.pt_edit(text, content_type, encoding)
 
+def pt_render(self, namespace, source=False, sourceAnnotations=False,
+  showtal=False):
+if namespace is None:
+namespace = self.pt_getContext()
+return super(ZopePageTemplate, self).pt_render(namespace, source, 
sourceAnnotations,
+  showtal)
+
+
 def pt_getEngine(self):
 return getEngine()
 

Modified: 
Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py  
2006-04-21 18:04:43 UTC (rev 67245)
+++ Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py  
2006-04-21 18:10:19 UTC (rev 67246)
@@ -94,6 +94,12 @@
 pt = self.app.pt1
 self.assertEqual(pt(), self.result)
 
+def testPtErrors(self):
+request = self.app.REQUEST
+self._addPT('pt1', text=self.text, REQUEST=request)
+pt = self.app.pt1
+pt.pt_render(None, source=1)
+self.assertEqual(pt.pt_errors(None), None)
 
 class DummyFileUpload:
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/publication-refactor2/lib/python/Products/ Link in branched version of Five.

2006-04-21 Thread Michael Kerrin
Log message for revision 67245:
  Link in branched version of Five.
  

Changed:
  _U  Zope/branches/publication-refactor2/lib/python/Products/

-=-

Property changes on: Zope/branches/publication-refactor2/lib/python/Products
___
Name: svn:externals
   - Five svn://svn.zope.org/repos/main/Products.Five/tags/1.3.3

   + Five 
svn://svn.zope.org/repos/main/Products.Five/branches/publication-refactor2



___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/publication-refactor2/ Create a branch for holding some changes in Five for

2006-04-21 Thread Michael Kerrin
Log message for revision 67243:
  Create a branch for holding some changes in Five for
  the publication-refactor2 branch of Zope2.
  

Changed:
  A   Products.Five/branches/publication-refactor2/

-=-
Copied: Products.Five/branches/publication-refactor2 (from rev 67242, 
Products.Five/trunk)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PageTemplates/ A quick and dirty fix for the macro problem, that may or may not work.

2006-04-21 Thread Lennart Regebro
Log message for revision 67240:
  A quick and dirty fix for the macro problem, that may or may not work.
  

Changed:
  U   Zope/trunk/lib/python/Products/PageTemplates/TALES.py
  U   Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py

-=-
Modified: Zope/trunk/lib/python/Products/PageTemplates/TALES.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/TALES.py   2006-04-21 
17:38:53 UTC (rev 67239)
+++ Zope/trunk/lib/python/Products/PageTemplates/TALES.py   2006-04-21 
17:46:24 UTC (rev 67240)
@@ -259,6 +259,9 @@
 context=context,
 default=default,
 target_language=target_language)
+
+def getValue(self, name, default=None):
+return self.vars.get(name, default)
 
 class TALESTracebackSupplement:
 """Implementation of ITracebackSupplement"""

Modified: 
Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py  
2006-04-21 17:38:53 UTC (rev 67239)
+++ Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py  
2006-04-21 17:46:24 UTC (rev 67240)
@@ -71,7 +71,7 @@
 This is in the slot
   
 
-
+
 
   This is the header
   
@@ -80,14 +80,12 @@
 
 
 """
-self.result = """
-
+self.result = """
   This is the header
   
 This is in the slot
   
 
-
 """   
 
 def testMacroExpansion(self):

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/publication-refactor2/lib/python/ Finish committing changes from the publication-refactor branch.

2006-04-21 Thread Michael Kerrin
Log message for revision 67238:
  Finish committing changes from the publication-refactor branch.
  
  Also fixed bug in the traversal when we were always getting
  unauthorized errors when trying to use Five views. This was
  because I had left out some code from the Five.traversable.
  

Changed:
  _U  Zope/branches/publication-refactor2/lib/python/
  U   Zope/branches/publication-refactor2/lib/python/ZPublisher/BaseRequest.py
  U   Zope/branches/publication-refactor2/lib/python/ZPublisher/Publication.py
  U   Zope/branches/publication-refactor2/lib/python/ZPublisher/Test.py
  U   Zope/branches/publication-refactor2/lib/python/ZServer/HTTPResponse.py
  U   Zope/branches/publication-refactor2/lib/python/Zope2/Startup/__init__.py
  U   Zope/branches/publication-refactor2/lib/python/Zope2/Startup/handlers.py
  U   
Zope/branches/publication-refactor2/lib/python/Zope2/Startup/zopeschema.xml
  _U  Zope/branches/publication-refactor2/lib/python/zope/

-=-

Property changes on: Zope/branches/publication-refactor2/lib/python
___
Name: svn:externals
   - ZConfigsvn://svn.zope.org/repos/main/ZConfig/tags/ZConfig-2.3.1
BTrees -r 41153 
svn://svn.zope.org/repos/main/ZODB/branches/3.6/src/BTrees
persistent -r 41153 
svn://svn.zope.org/repos/main/ZODB/branches/3.6/src/persistent
ThreadedAsync  -r 41153 
svn://svn.zope.org/repos/main/ZODB/branches/3.6/src/ThreadedAsync
transaction-r 41153 
svn://svn.zope.org/repos/main/ZODB/branches/3.6/src/transaction
ZEO-r 41153 svn://svn.zope.org/repos/main/ZODB/branches/3.6/src/ZEO
ZODB   -r 41153 svn://svn.zope.org/repos/main/ZODB/branches/3.6/src/ZODB
ZopeUndo   -r 41153 
svn://svn.zope.org/repos/main/ZODB/branches/3.6/src/ZopeUndo
zdaemon-r 40792 svn://svn.zope.org/repos/main/zdaemon/trunk/src/zdaemon
pytz   -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/pytz
zodbcode   -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zodbcode
ClientCookie   -r 41215 
svn://svn.zope.org/repos/main/Zope3/trunk/src/ClientCookie
mechanize  -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/mechanize
docutils   svn://svn.zope.org/repos/main/docutils/tags/0.4.0


   + ZConfigsvn://svn.zope.org/repos/main/ZConfig/tags/ZConfig-2.3.1
BTrees -r 41153 
svn://svn.zope.org/repos/main/ZODB/branches/3.6/src/BTrees
persistent -r 41153 
svn://svn.zope.org/repos/main/ZODB/branches/3.6/src/persistent
ThreadedAsync  -r 41153 
svn://svn.zope.org/repos/main/ZODB/branches/3.6/src/ThreadedAsync
transaction-r 41153 
svn://svn.zope.org/repos/main/ZODB/branches/3.6/src/transaction
ZEO-r 41153 svn://svn.zope.org/repos/main/ZODB/branches/3.6/src/ZEO
ZODB   -r 41153 svn://svn.zope.org/repos/main/ZODB/branches/3.6/src/ZODB
ZopeUndo   -r 41153 
svn://svn.zope.org/repos/main/ZODB/branches/3.6/src/ZopeUndo
zdaemon-r 40792 svn://svn.zope.org/repos/main/zdaemon/trunk/src/zdaemon
pytz   -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/pytz
zodbcode   -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zodbcode
ClientCookie   -r 41215 
svn://svn.zope.org/repos/main/Zope3/trunk/src/ClientCookie
mechanize  -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/mechanize
docutils   svn://svn.zope.org/repos/main/docutils/tags/0.4.0
twisted
svn://svn.twistedmatrix.com/svn/Twisted/branches/releases/2.1.x/twisted


Modified: 
Zope/branches/publication-refactor2/lib/python/ZPublisher/BaseRequest.py
===
--- Zope/branches/publication-refactor2/lib/python/ZPublisher/BaseRequest.py
2006-04-21 17:36:54 UTC (rev 67237)
+++ Zope/branches/publication-refactor2/lib/python/ZPublisher/BaseRequest.py
2006-04-21 17:37:21 UTC (rev 67238)
@@ -255,6 +255,10 @@
 # Set the posttraverse for duration of the traversal here
 self._post_traverse = post_traverse = []
 
+# Con Zope 3 into using Zope 2's checkPermission
+import Products.Five.security
+Products.Five.security.newInteraction()
+
 entry_name = ''
 try:
 # We build parents in the wrong order, so we

Modified: 
Zope/branches/publication-refactor2/lib/python/ZPublisher/Publication.py
===
--- Zope/branches/publication-refactor2/lib/python/ZPublisher/Publication.py
2006-04-21 17:36:54 UTC (rev 67237)
+++ Zope/branches/publication-refactor2/lib/python/ZPublisher/Publication.py
2006-04-21 17:37:21 UTC (rev 67238)
@@ -251,7 +251,7 @@
 except TraversalError:
 raise NotFound(ob, name)
 
-return ob2
+return ob2.__of__(ob)
 
 if nm == '.':
 return ob
@@ -360,12 +360,12 @@
 # have an empty or missing docstring are not published.
 doc = getattr(subobject, '__d

[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py Macro expansion currenty fails. I checked in a test that reproduces the error.

2006-04-21 Thread Lennart Regebro
Log message for revision 67230:
  Macro expansion currenty fails. I checked in a test that reproduces the error.
  

Changed:
  U   Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py

-=-
Modified: 
Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py  
2006-04-21 16:38:39 UTC (rev 67229)
+++ Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py  
2006-04-21 16:40:03 UTC (rev 67230)
@@ -58,6 +58,44 @@
 pt = self.app.pt1
 self.assertEqual(pt.document_src(), self.text)
 
+class ZPTMacros(unittest.TestCase):
+def setUp(self):
+transaction.begin()
+self.app = makerequest(Zope2.app())
+f = self.app.manage_addProduct['PageTemplates'].manage_addPageTemplate
+self._addPT = f
+self.title = 'title of page template'
+self.text = """
+
+  
+This is in the slot
+  
+
+
+
+  This is the header
+  
+This will be replaced
+  
+
+
+"""
+self.result = """
+
+  This is the header
+  
+This is in the slot
+  
+
+
+"""   
+
+def testMacroExpansion(self):
+request = self.app.REQUEST
+self._addPT('pt1', text=self.text, REQUEST=request)
+pt = self.app.pt1
+self.assertEqual(pt(), self.result)
+
 
 class DummyFileUpload:
 
@@ -71,7 +109,9 @@
 

 def test_suite():
-return unittest.makeSuite(ZPTRegressions)
+suite = unittest.makeSuite(ZPTRegressions)
+suite.addTests(unittest.makeSuite(ZPTMacros))
+return suite
 
 if __name__ == '__main__':
 unittest.main(defaultTest='test_suite')

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/publication-refactor2/lib/python/ZPublisher/ commit the merge from the old publication-refactor branch.

2006-04-21 Thread Michael Kerrin
Log message for revision 67229:
  commit the merge from the old publication-refactor branch.
  

Changed:
  U   Zope/branches/publication-refactor2/lib/python/ZPublisher/BaseRequest.py
  U   Zope/branches/publication-refactor2/lib/python/ZPublisher/BaseResponse.py
  U   Zope/branches/publication-refactor2/lib/python/ZPublisher/HTTPRequest.py
  U   Zope/branches/publication-refactor2/lib/python/ZPublisher/HTTPResponse.py
  A   Zope/branches/publication-refactor2/lib/python/ZPublisher/Publication.py
  U   Zope/branches/publication-refactor2/lib/python/ZPublisher/Publish.py
  U   Zope/branches/publication-refactor2/lib/python/ZPublisher/Test.py
  U   
Zope/branches/publication-refactor2/lib/python/ZPublisher/tests/testPublish.py

-=-
Modified: 
Zope/branches/publication-refactor2/lib/python/ZPublisher/BaseRequest.py
===
--- Zope/branches/publication-refactor2/lib/python/ZPublisher/BaseRequest.py
2006-04-21 16:37:33 UTC (rev 67228)
+++ Zope/branches/publication-refactor2/lib/python/ZPublisher/BaseRequest.py
2006-04-21 16:38:39 UTC (rev 67229)
@@ -14,13 +14,13 @@
 
 $Id$
 """
-from urllib import quote
+
 import xmlrpc
+from urllib import quote
+from zope.publisher.interfaces import NotFound
+
 from zExceptions import Forbidden
 
-from zope.event import notify
-from zope.app.publication.interfaces import EndRequestEvent
-
 UNSPECIFIED_ROLES=''
 
 try:
@@ -80,12 +80,23 @@
 """
 if other is None: other=kw
 else: other.update(kw)
-self.other=other
+self.other = other
+self.environ = {}
+# Publication will be overriden by ZPublisher.Publish,
+# publish(), we assume that by default it's the "Zope2"
+# module. This is done so that tests using BaseRequest
+# directly don't break.
+from ZPublisher.Publication import get_publication
+self.publication = get_publication(module_name="Zope2")
 
+def setPublication(self, publication):
+self.publication = publication
+
 def close(self):
 self.other.clear()
-self._held=None
-notify(EndRequestEvent(None, self))
+self._held = None
+self.publication.endRequest(self, None)
+self.publication = None
 
 def processInputs(self):
 """Do any input processing that could raise errors
@@ -155,7 +166,7 @@
 
 def __contains__(self, key):
 return self.has_key(key)
-
+
 def keys(self):
 keys = {}
 keys.update(self.common)
@@ -219,40 +230,19 @@
 
 if method=='GET' or method=='POST' and not isinstance(response,
   xmlrpc.Response):
-# Probably a browser
-no_acquire_flag=0
 # index_html is still the default method, only any object can
 # override it by implementing its own __browser_default__ method
 method = 'index_html'
-elif self.maybe_webdav_client:
-# Probably a WebDAV client.
-no_acquire_flag=1
-else:
-no_acquire_flag=0
 
 URL=request['URL']
-parents=request['PARENTS']
-object=parents[-1]
+parents = request['PARENTS']
+object = parents[-1]
 del parents[:]
 
-roles = getRoles(None, None, object, UNSPECIFIED_ROLES)
-
-# if the top object has a __bobo_traverse__ method, then use it
-# to possibly traverse to an alternate top-level object.
-if hasattr(object,'__bobo_traverse__'):
-try:
-object=object.__bobo_traverse__(request)
-roles = getRoles(None, None, object, UNSPECIFIED_ROLES)
-except: pass
-
 if not path and not method:
 return response.forbiddenError(self['URL'])
 
-# Traverse the URL to find the object:
-if hasattr(object, '__of__'):
-# Try to bind the top-level object to the request
-# This is how you get 'self.REQUEST'
-object=object.__of__(RequestContainer(REQUEST=request))
+roles = getRoles(None, None, object, UNSPECIFIED_ROLES)
 parents.append(object)
 
 steps=self.steps
@@ -270,9 +260,7 @@
 # We build parents in the wrong order, so we
 # need to make sure we reverse it when we're doe.
 while 1:
-bpth = getattr(object, '__before_publishing_traverse__', None)
-if bpth is not None:
-bpth(object, self)
+self.publication.callTraversalHooks(self, object)
 
 path = request.path = request['TraversalRequestNameStack']
 # Check for method:
@@ -318,72 +306,16 @@
   "Object name begins with an underscore at: %s" % URL)
 else: return response.forbiddenError(entry_name)
 
-if hasattr(object,'__bobo_traverse__'):
-  

[Zope-Checkins] SVN: Zope/branches/publication-refactor2/ Create new branch of the trunk for the publication refactoring

2006-04-21 Thread Michael Kerrin
Log message for revision 67220:
  Create new branch of the trunk for the publication refactoring
  which will hopefully solve some weird problem we are having.
  

Changed:
  A   Zope/branches/publication-refactor2/

-=-
Copied: Zope/branches/publication-refactor2 (from rev 67219, Zope/trunk)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/publication-refactor/lib/python/ Refactor some of the Zope2 traversal. This includes using

2006-04-21 Thread Michael Kerrin
Log message for revision 67219:
  Refactor some of the Zope2 traversal. This includes using
  IPublishTraverse to do the traversal, and using Zope3 to
  find the views.
  

Changed:
  U   Zope/branches/publication-refactor/lib/python/Products/Five/configure.zcml
  U   Zope/branches/publication-refactor/lib/python/ZPublisher/BaseRequest.py
  U   Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py
  U   Zope/branches/publication-refactor/lib/python/ZPublisher/Publish.py
  U   Zope/branches/publication-refactor/lib/python/ZPublisher/Test.py

-=-
Modified: 
Zope/branches/publication-refactor/lib/python/Products/Five/configure.zcml
===
--- Zope/branches/publication-refactor/lib/python/Products/Five/configure.zcml  
2006-04-21 14:18:10 UTC (rev 67218)
+++ Zope/branches/publication-refactor/lib/python/Products/Five/configure.zcml  
2006-04-21 14:20:05 UTC (rev 67219)
@@ -60,4 +60,11 @@
provides="zope.publisher.interfaces.ITraversingRequest"
/>
 
+  
+
 

Modified: 
Zope/branches/publication-refactor/lib/python/ZPublisher/BaseRequest.py
===
--- Zope/branches/publication-refactor/lib/python/ZPublisher/BaseRequest.py 
2006-04-21 14:18:10 UTC (rev 67218)
+++ Zope/branches/publication-refactor/lib/python/ZPublisher/BaseRequest.py 
2006-04-21 14:20:05 UTC (rev 67219)
@@ -230,16 +230,9 @@
 
 if method=='GET' or method=='POST' and not isinstance(response,
   xmlrpc.Response):
-# Probably a browser
-no_acquire_flag=0
 # index_html is still the default method, only any object can
 # override it by implementing its own __browser_default__ method
 method = 'index_html'
-elif self.maybe_webdav_client:
-# Probably a WebDAV client.
-no_acquire_flag=1
-else:
-no_acquire_flag=0
 
 URL=request['URL']
 parents = request['PARENTS']
@@ -315,7 +308,7 @@
 
 try:
 subobject = self.publication.traverseName(
-self, object, entry_name, no_acquire_flag)
+self, object, entry_name)
 except NotFound:
 if debug_mode:
 return response.debugError(
@@ -323,30 +316,6 @@
 else:
 return response.notFoundError(URL)
 
-# Ensure that the object has a docstring, or that the parent
-# object has a pseudo-docstring for the object. Objects that
-# have an empty or missing docstring are not published.
-doc = getattr(subobject, '__doc__', None)
-if doc is None:
-doc = getattr(object, '%s__doc__' % entry_name, None)
-if not doc:
-return response.debugError(
-"The object at %s has an empty or missing " \
-"docstring. Objects must have a docstring to be " \
-"published." % URL
-)
-
-# Hack for security: in Python 2.2.2, most built-in types
-# gained docstrings that they didn't have before. That caused
-# certain mutable types (dicts, lists) to become publishable
-# when they shouldn't be. The following check makes sure that
-# the right thing happens in both 2.2.2+ and earlier versions.
-
-if not typeCheck(subobject):
-return response.debugError(
-"The object at %s is not publishable." % URL
-)
-
 roles = getRoles(
 object, (not got) and entry_name or None, subobject,
 roles)

Modified: 
Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py
===
--- Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py 
2006-04-21 14:18:10 UTC (rev 67218)
+++ Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py 
2006-04-21 14:20:05 UTC (rev 67219)
@@ -16,9 +16,10 @@
 import sys
 import transaction
 import types
+import xmlrpc
 
 from zope.event import notify
-from zope.component import queryUtility
+from zope.component import queryUtility, queryMultiAdapter
 from zope.interface import implements
 from zope.publisher.interfaces import IRequest, IPublication
 from zope.publisher.interfaces import NotFound, IPublicationRequest
@@ -30,12 +31,16 @@
 from zope.app.publication.interfaces import BeforeTraverseEvent
 from zope.app.publication.interfaces import IBrowserRequestFactory
 from zope.app.publication.interfaces import IRequestPublicationFactory
+from zope.app.travers

[Zope-Checkins] SVN: Zope/branches/publication-refactor/lib/python/ Using a new ITraversalRequest adapter to adapt the Zope2 requests.traversal method to

2006-04-21 Thread Lennart Regebro
Log message for revision 67200:
  Using a new ITraversalRequest adapter to adapt the Zope2 requests.traversal 
method to 
  the Zope3 version.
  

Changed:
  U   Zope/branches/publication-refactor/lib/python/Products/Five/configure.zcml
  U   Zope/branches/publication-refactor/lib/python/Products/Five/interfaces.py
  U   Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py

-=-
Modified: 
Zope/branches/publication-refactor/lib/python/Products/Five/configure.zcml
===
--- Zope/branches/publication-refactor/lib/python/Products/Five/configure.zcml  
2006-04-21 09:38:13 UTC (rev 67199)
+++ Zope/branches/publication-refactor/lib/python/Products/Five/configure.zcml  
2006-04-21 09:51:55 UTC (rev 67200)
@@ -50,5 +50,14 @@
   
+   
+  
+  
 
 

Modified: 
Zope/branches/publication-refactor/lib/python/Products/Five/interfaces.py
===
--- Zope/branches/publication-refactor/lib/python/Products/Five/interfaces.py   
2006-04-21 09:38:13 UTC (rev 67199)
+++ Zope/branches/publication-refactor/lib/python/Products/Five/interfaces.py   
2006-04-21 09:51:55 UTC (rev 67200)
@@ -27,6 +27,10 @@
 find the method to be published.
 """
 
+class IZope2Request(Interface):
+"""Marks the Zope2 request"""
+pass
+
 class IMenuItemType(IInterface):
 """Menu item type
 

Modified: 
Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py
===
--- Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py 
2006-04-21 09:38:13 UTC (rev 67199)
+++ Zope/branches/publication-refactor/lib/python/ZPublisher/Publication.py 
2006-04-21 09:51:55 UTC (rev 67200)
@@ -49,7 +49,7 @@
 _marker = object()
 
 class Zope3HTTPRequestTraverser(object):
-implements(IPublisherRequest)
+implements(zope.publisher.interfaces.ITraversingRequest)
 
 def __init__(self, request):
 self.request = request
@@ -61,12 +61,7 @@
 return self.request.traverse(path, self.request.response,
  self.request.publication.validated_hook)
 
-## XXX - Five declares that HTTPRequest implements IPublisherRequest
-## but in fact it doesn't, the traverse method API is all wrong.
-## component.provideAdapter(Zope3HTTPRequestTraverser, (HTTPRequest,),
-##  IPublisherRequest)
 
-
 class ZopePublication(object):
 """Base Zope2 publication specification.
 """
@@ -229,7 +224,8 @@
  sys.exc_info()[2],
  )
 except:
-return request.response.exception()
+request.response.exception()
+return request.response
 finally:
 self._abort()
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins