[Zope3-checkins] CVS: Zope3/src/zope/publisher - browser.py:1.4.2.1 ftp.py:1.1.2.1 http.py:1.6.2.1 publish.py:1.4.2.1

Sidnei da Silva sidnei@x3ng.com.br
Tue, 11 Feb 2003 09:42:07 -0500


Update of /cvs-repository/Zope3/src/zope/publisher
In directory cvs.zope.org:/tmp/cvs-serv18615/src/zope/publisher

Modified Files:
      Tag: paris-copypasterename-branch
	browser.py ftp.py http.py publish.py 
Log Message:
Updating from HEAD to make sure everything still works before merging

=== Zope3/src/zope/publisher/browser.py 1.4 => 1.4.2.1 ===
--- Zope3/src/zope/publisher/browser.py:1.4	Mon Dec 30 21:52:18 2002
+++ Zope3/src/zope/publisher/browser.py	Tue Feb 11 09:41:35 2003
@@ -53,7 +53,7 @@
 REC = 12 # RECORD|RECORDS
 EMPTY = 16
 CONVERTED = 32
-DEFAULTABLE_METHODS = 'GET', 'POST'
+DEFAULTABLE_METHODS = 'GET', 'POST', 'HEAD'
 
 
 def field2string(v):
@@ -268,9 +268,8 @@
 
         environ = self._environ
         form = self.form
-        method = environ.get('REQUEST_METHOD', 'GET')
 
-        if method != 'GET':
+        if self.method != 'GET':
             # Process form if not a GET request.
             fp = self._body_instream
         else:
@@ -607,7 +606,7 @@
         'See IPublisherRequest'
 
         ob = super(BrowserRequest, self).traverse(object)
-        method = self._environ.get('REQUEST_METHOD', 'GET').upper()
+        method = self.method
 
         base_needed = 0
         if self._path_suffix:


=== Zope3/src/zope/publisher/ftp.py 1.1 => 1.1.2.1 ===
--- Zope3/src/zope/publisher/ftp.py:1.1	Mon Feb  3 10:08:51 2003
+++ Zope3/src/zope/publisher/ftp.py	Tue Feb 11 09:41:35 2003
@@ -16,7 +16,7 @@
 $Id$
 """
 
-from zope.publisher.interfaces.ftp import IFTPView
+from zope.publisher.interfaces.ftp import IFTPPresentation
 from zope.publisher.interfaces.ftp import IFTPCredentials
 from zope.publisher.base import BaseResponse, BaseRequest
 
@@ -38,7 +38,7 @@
 class FTPRequest(BaseRequest):
     __implements__ = BaseRequest.__implements__, IFTPCredentials
 
-    _presentation_type = IFTPView
+    _presentation_type = IFTPPresentation
 
     __slots__ = '_auth'
 


=== Zope3/src/zope/publisher/http.py 1.6 => 1.6.2.1 ===
--- Zope3/src/zope/publisher/http.py:1.6	Mon Feb  3 10:01:17 2003
+++ Zope3/src/zope/publisher/http.py	Tue Feb 11 09:41:35 2003
@@ -25,6 +25,8 @@
 from zope.publisher.interfaces.http import IHTTPRequest
 from zope.publisher.interfaces.http import IHTTPApplicationRequest
 from zope.publisher.interfaces.http import IHTTPPublisher
+from zope.publisher.interfaces.http import IHTTPPresentation
+
 from zope.publisher.interfaces import Redirect
 from zope.publisher.interfaces.http import IHTTPResponse
 from zope.publisher.interfaces.http import IHTTPApplicationResponse
@@ -258,6 +260,9 @@
     other variables, form data, and then cookies.
     """
 
+    _presentation_type = IHTTPPresentation
+
+
     __implements__ = (BaseRequest.__implements__,
                       IHTTPCredentials, IHTTPRequest, IHTTPApplicationRequest,
                       )
@@ -273,6 +278,7 @@
         '_app_server',    # The server path of the application url
         '_orig_env',      # The original environment
         '_endswithslash', # Does the given path end with /
+        'method',         # The upper-cased request method (REQUEST_METHOD)
         )
 
     retry_max_count = 3    # How many times we're willing to retry
@@ -291,6 +297,8 @@
         else:
             self._auth = None
 
+        self.method = environ.get("REQUEST_METHOD", 'GET').upper()
+
         self._environ = environ
 
         self.__setupCookies()
@@ -900,45 +908,6 @@
         Outputs the response body.
         """
         self.output(self._body)
-
-
-    def _formatException(etype, value, tb, limit=None):
-        import traceback
-        result=['Traceback (innermost last):']
-        if limit is None:
-            if hasattr(sys, 'tracebacklimit'):
-                limit = sys.tracebacklimit
-        n = 0
-        while tb is not None and (limit is None or n < limit):
-            frame = tb.tb_frame
-            lineno = tb.tb_lineno
-            co = frame.f_code
-            filename = co.co_filename
-            name = co.co_name
-            locals = frame.f_locals
-            globals = frame.f_globals
-            modname = globals.get('__name__', filename)
-            result.append('  Module %s, line %d, in %s'
-                          % (modname,lineno,name))
-            try:
-                result.append('    (Object: %s)' %
-                               locals[co.co_varnames[0]].__name__)
-            except:
-                pass
-
-            try:
-                result.append('    (Info: %s)' %
-                               unicode(locals['__traceback_info__']))
-            except: pass
-            tb = tb.tb_next
-            n = n+1
-        result.append(' '.join(traceback.format_exception_only(etype, value)))
-        return result
-
-
-    def _createTracebackString(self, t, v, tb):
-        tb = self._formatException(t, v, tb, 200)
-        return '\n'.join(tb)
 
 
 class DefaultPublisher:


=== Zope3/src/zope/publisher/publish.py 1.4 => 1.4.2.1 ===
--- Zope3/src/zope/publisher/publish.py:1.4	Thu Jan  2 11:56:49 2003
+++ Zope3/src/zope/publisher/publish.py	Tue Feb 11 09:41:35 2003
@@ -110,8 +110,14 @@
         args.append(v)
 
     args = tuple(args)
+
+    if __debug__:
+        return debug_call(object, args)
+    
     return object(*args)
 
+def debug_call(object, args):
+    return object(*args)
 
 def publish(request, handle_errors=True):
     try: # finally to clean up to_raise and close request