[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/Browser - IBrowserPublication.py:1.1.2.1 Request.py:1.1.2.1.2.1 IBrowserGetPublication.py:NONE

Jim Fulton jim@zope.com
Wed, 20 Mar 2002 18:43:02 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/Publisher/Browser
In directory cvs.zope.org:/tmp/cvs-serv21411/Zope/Publisher/Browser

Modified Files:
      Tag: Zope3-publisher-refactor-branch
	Request.py 
Added Files:
      Tag: Zope3-publisher-refactor-branch
	IBrowserPublication.py 
Removed Files:
      Tag: Zope3-publisher-refactor-branch
	IBrowserGetPublication.py 
Log Message:
Began significant refactoring of publication framework.

- Added accessor functions, getResponse and getPublication.

- Moved some methods between existing interfaces as seem best, and
  added new new interfaces.

- Getting rid of payloads.




=== Added File Zope3/lib/python/Zope/Publisher/Browser/IBrowserPublication.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# 
##############################################################################
"""

Revision information:
$Id: IBrowserPublication.py,v 1.1.2.1 2002/03/20 23:42:31 jim Exp $
"""

from Zope.Publisher.IPublication import IPublication

class IBrowserGetPublication (IPublication):
    """
    Object publication framework.
    """

    def getDefaultTraversal(request, ob):
        """Get the default published object for the request
        
        Allows a default view to be added to traversal.
        Returns (ob, steps_reversed).
        """



=== Zope3/lib/python/Zope/Publisher/Browser/Request.py 1.1.2.1 => 1.1.2.1.2.1 ===
         self.cookies=cookies
 
-    def supports_retry(self):
+    def supportsRetry(self):
         if self.retry_count < self.retry_max_count:
             if STAGGER_RETRIES:
                 time.sleep(whrandom.uniform(0, 2**(self.retry_count)))
@@ -380,11 +380,13 @@
     def __str__(self):
         return self.payload.debugInfo(self)
 
-    def traverse(self, publication, object):
+    def traverse(self, object):
         """
         Traverses to an object and returns it.
         Private.
         """
+
+        publication = self.getPublication()
         
         traversal_altered = 0 # flag for adding traversal steps
         add_steps = None
@@ -510,7 +512,6 @@
     #  to implement IBrowserPublisher
     _viewtype = IBrowserPublisher
 
-    # XXX this doesn't belong here
     def getEffectiveURL(self):
         return self.effective_url or self.URL
 

=== Removed File Zope3/lib/python/Zope/Publisher/Browser/IBrowserGetPublication.py ===