[Zope3-checkins] CVS: Zope3/src/zope/publisher - base.py:1.3 browser.py:1.3 http.py:1.3 publish.py:1.3 vfs.py:1.3 xmlrpc.py:1.3
Kapil Thangavelu
kvthan@wm.edu
Fri, 27 Dec 2002 11:40:56 -0500
Update of /cvs-repository/Zope3/src/zope/publisher
In directory cvs.zope.org:/tmp/cvs-serv25236
Modified Files:
base.py browser.py http.py publish.py vfs.py xmlrpc.py
Log Message:
geddon cleanup
- merge and sort imports
- global vars at top of modules
- subjective sort of classes
=== Zope3/src/zope/publisher/base.py 1.2 => 1.3 ===
--- Zope3/src/zope/publisher/base.py:1.2 Wed Dec 25 09:15:18 2002
+++ Zope3/src/zope/publisher/base.py Fri Dec 27 11:40:24 2002
@@ -25,19 +25,10 @@
from zope.publisher.interfaces import IPublication
from zope.publisher.interfaces import NotFound, DebugError, Unauthorized
-from zope.publisher.interfaces import IApplicationResponse
-from zope.publisher.interfaces import IApplicationRequest
-from zope.publisher.interfaces import IPublicationRequest
-from zope.publisher.interfaces import IPublisherResponse
-from zope.publisher.interfaces import IPublisherRequest
-
+from zope.publisher.interfaces import IRequest, IResponse
from zope.publisher.publish import mapply
-
-class IResponse(IPublisherResponse, IApplicationResponse):
- """The basic response contract
- """
-
+_marker = object()
class BaseResponse(object):
"""Base Response Class
@@ -140,13 +131,6 @@
def __set__(*args):
raise AttributeError, 'Unassignable attribute'
-
-
-class IRequest(IPublisherRequest, IPublicationRequest, IApplicationRequest):
- """The basic request contract
- """
-
-_marker = object()
class RequestEnvironment(RequestDataMapper):
_mapname = '_environ'
=== Zope3/src/zope/publisher/browser.py 1.2 => 1.3 ===
--- Zope3/src/zope/publisher/browser.py:1.2 Wed Dec 25 09:15:18 2002
+++ Zope3/src/zope/publisher/browser.py Fri Dec 27 11:40:24 2002
@@ -11,13 +11,51 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-__version__='$Revision$'[11:-2]
+"""
+
+$Id$
+"""
import re
-from types import ListType, TupleType
+from types import ListType, TupleType, StringType, StringTypes
+from cgi import FieldStorage, escape
+
+from zope.interfaces.i18n import IUserPreferredLanguages
+from zope.interfaces.i18n import IUserPreferredCharsets
+from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.publisher.interfaces.browser import IBrowserRequest
+from zope.publisher.interfaces.browser import IBrowserPublication
+from zope.publisher.interfaces.browser import IBrowserApplicationRequest
+from zope.publisher.interfaces import Redirect
+
+from zope.publisher.interfaces.browser import IBrowserView
+from zope.component import getAdapter
+from zope.publisher.http import HTTPRequest, HTTPResponse
+
+__metaclass__ = type # All classes are new style when run with Python 2.2+
__ArrayTypes = (ListType, TupleType)
+search_type = re.compile('(:[a-zA-Z][a-zA-Z0-9_]+|\\.[xy])$').search
+start_of_header_search=re.compile('(<head[^>]*>)', re.IGNORECASE).search
+base_re_search=re.compile('(<base.*?>)',re.I).search
+isRelative = re.compile("[-_.!~*a-zA-z0-9'()@&=+$,]+(/|$)").match
+
+
+def is_text_html(content_type):
+ return content_type.startswith('text/html')
+
+# Flas Constants
+SEQUENCE = 1
+DEFAULT = 2
+RECORD = 4
+RECORDS = 8
+REC = 12 # RECORD|RECORDS
+EMPTY = 16
+CONVERTED = 32
+DEFAULTABLE_METHODS = 'GET', 'POST'
+
+
def field2string(v):
if hasattr(v,'read'): v=v.read()
else: v=str(v)
@@ -129,78 +167,55 @@
get_converter=type_converters.get
+isCGI_NAME = {
+ # These fields are placed in request.environ instead of request.form.
+ 'SERVER_SOFTWARE' : 1,
+ 'SERVER_NAME' : 1,
+ 'GATEWAY_INTERFACE' : 1,
+ 'SERVER_PROTOCOL' : 1,
+ 'SERVER_PORT' : 1,
+ 'REQUEST_METHOD' : 1,
+ 'PATH_INFO' : 1,
+ 'PATH_TRANSLATED' : 1,
+ 'SCRIPT_NAME' : 1,
+ 'QUERY_STRING' : 1,
+ 'REMOTE_HOST' : 1,
+ 'REMOTE_ADDR' : 1,
+ 'AUTH_TYPE' : 1,
+ 'REMOTE_USER' : 1,
+ 'REMOTE_IDENT' : 1,
+ 'CONTENT_TYPE' : 1,
+ 'CONTENT_LENGTH' : 1,
+ 'SERVER_URL': 1,
+ }.has_key
-"""
-
-$Id$
-"""
-
-from zope.interfaces.i18n import IUserPreferredLanguages
-from zope.publisher.interfaces.browser import IBrowserView
-
-__metaclass__ = type # All classes are new style when run with Python 2.2+
-
-class BrowserLanguages:
-
- __implements__ = IUserPreferredLanguages
-
- def __init__(self, request):
- self.request = request
-
- def getPreferredLanguages(self):
- '''See interface IUserPreferredLanguages'''
- langs = []
- for lang in self.request.get('HTTP_ACCEPT_LANGUAGE', '').split(','):
- lang = lang.strip()
- if lang:
- langs.append(lang.split(';')[0])
- return langs
-
-
-class BrowserView:
-
- __implements__ = IBrowserView
-
- def __init__(self, context, request):
- self.context = context
- self.request = request
-
-
-
-"""
-
-$Id$
-"""
-
-import re
-
-from cgi import FieldStorage
-
-from types import StringType
-
-from zope.component import getAdapter
+hide_key={
+ 'HTTP_AUTHORIZATION':1,
+ 'HTTP_CGI_AUTHORIZATION': 1,
+ }.has_key
-from zope.publisher.http import HTTPRequest
-from zope.interfaces.i18n import IUserPreferredCharsets
+class record:
-from zope.publisher.interfaces.browser import IBrowserPresentation
-from zope.publisher.interfaces.browser import IBrowserRequest
-from zope.publisher.interfaces.browser import IBrowserPublication
-from zope.publisher.interfaces.browser import IBrowserApplicationRequest
+ def __getattr__(self, key, default=None):
+ if key in ('get', 'keys', 'items', 'values', 'copy',
+ 'has_key', '__contains__'):
+ return getattr(self.__dict__, key)
+ raise AttributeError, key
+ def __getitem__(self, key):
+ return self.__dict__[key]
-# Flas Constants
-SEQUENCE = 1
-DEFAULT = 2
-RECORD = 4
-RECORDS = 8
-REC = 12 # RECORD|RECORDS
-EMPTY = 16
-CONVERTED = 32
-DEFAULTABLE_METHODS = 'GET', 'POST'
+ def __str__(self):
+ L1 = self.__dict__.items()
+ L1.sort()
+ return ", ".join(map(lambda item: "%s: %s" % item, L1))
-search_type = re.compile('(:[a-zA-Z][a-zA-Z0-9_]+|\\.[xy])$').search
+ def __repr__(self):
+ L1 = self.__dict__.items()
+ L1.sort()
+ return ', '.join(
+ map(lambda item: "%s: %s" % (item[0], repr(item[1])), L1))
class BrowserRequest(HTTPRequest):
@@ -711,82 +726,6 @@
super(TestRequest, self).__init__(body_instream, outstream, _testEnv)
-# add class copied from Zope2
-class record:
-
- def __getattr__(self, key, default=None):
- if key in ('get', 'keys', 'items', 'values', 'copy',
- 'has_key', '__contains__'):
- return getattr(self.__dict__, key)
- raise AttributeError, key
-
- def __getitem__(self, key):
- return self.__dict__[key]
-
- def __str__(self):
- L1 = self.__dict__.items()
- L1.sort()
- return ", ".join(map(lambda item: "%s: %s" % item, L1))
-
- def __repr__(self):
- L1 = self.__dict__.items()
- L1.sort()
- return ', '.join(
- map(lambda item: "%s: %s" % (item[0], repr(item[1])), L1))
-
-
-
-import cgi
-if not hasattr(cgi, 'valid_boundary'):
- try: import cgi_hotfix
- except ImportError: pass
-
-isCGI_NAME = {
- # These fields are placed in request.environ instead of request.form.
- 'SERVER_SOFTWARE' : 1,
- 'SERVER_NAME' : 1,
- 'GATEWAY_INTERFACE' : 1,
- 'SERVER_PROTOCOL' : 1,
- 'SERVER_PORT' : 1,
- 'REQUEST_METHOD' : 1,
- 'PATH_INFO' : 1,
- 'PATH_TRANSLATED' : 1,
- 'SCRIPT_NAME' : 1,
- 'QUERY_STRING' : 1,
- 'REMOTE_HOST' : 1,
- 'REMOTE_ADDR' : 1,
- 'AUTH_TYPE' : 1,
- 'REMOTE_USER' : 1,
- 'REMOTE_IDENT' : 1,
- 'CONTENT_TYPE' : 1,
- 'CONTENT_LENGTH' : 1,
- 'SERVER_URL': 1,
- }.has_key
-
-hide_key={
- 'HTTP_AUTHORIZATION':1,
- 'HTTP_CGI_AUTHORIZATION': 1,
- }.has_key
-
-
-
-'''HTTP Response Output formatter
-
-$Id$'''
-__version__='$Revision$'[11:-2]
-
-import sys, re
-from types import StringTypes, UnicodeType, ClassType
-from cgi import escape
-
-from zope.publisher.http import HTTPResponse
-from zope.publisher.interfaces import Redirect
-
-
-start_of_header_search=re.compile('(<head[^>]*>)', re.IGNORECASE).search
-base_re_search=re.compile('(<base.*?>)',re.I).search
-isRelative = re.compile("[-_.!~*a-zA-z0-9'()@&=+$,]+(/|$)").match
-
class BrowserResponse(HTTPResponse):
"""Browser response
@@ -871,6 +810,28 @@
super(BrowserResponse, self).redirect(location, status)
+class BrowserLanguages:
+
+ __implements__ = IUserPreferredLanguages
+
+ def __init__(self, request):
+ self.request = request
+
+ def getPreferredLanguages(self):
+ '''See interface IUserPreferredLanguages'''
+ langs = []
+ for lang in self.request.get('HTTP_ACCEPT_LANGUAGE', '').split(','):
+ lang = lang.strip()
+ if lang:
+ langs.append(lang.split(';')[0])
+ return langs
+
+
+class BrowserView:
+
+ __implements__ = IBrowserView
+
+ def __init__(self, context, request):
+ self.context = context
+ self.request = request
-def is_text_html(content_type):
- return content_type.startswith('text/html')
=== Zope3/src/zope/publisher/http.py 1.2 => 1.3 ===
--- Zope3/src/zope/publisher/http.py:1.2 Wed Dec 25 09:15:18 2002
+++ Zope3/src/zope/publisher/http.py Fri Dec 27 11:40:24 2002
@@ -16,21 +16,29 @@
$Id$
"""
-import re, time, random
+import re, time, random, sys
from urllib import quote, splitport
-from types import StringType
-
-from zope.publisher.base import BaseRequest
-from zope.exceptions import NotFoundError
-
+from types import StringTypes, UnicodeType, ClassType
+from cgi import escape
from zope.publisher.interfaces.http import IHTTPCredentials
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 import Redirect
+from zope.publisher.interfaces.http import IHTTPResponse
+from zope.publisher.interfaces.http import IHTTPApplicationResponse
+from zope.interfaces.i18n import IUserPreferredCharsets
+from zope.interfaces.i18n import IUserPreferredCharsets
+from zope.component import queryAdapter
+from zope.exceptions.exceptionformatter import format_exception
+from zope.exceptions import NotFoundError
+from zope.publisher.base import BaseRequest, BaseResponse
from zope.publisher.base \
import RequestDataProperty, RequestDataMapper, RequestDataGetter
+
# Default Encoding
ENCODING = 'UTF-8'
@@ -42,6 +50,131 @@
_marker = object()
+base64 = None
+
+def sane_environment(env):
+ # return an environment mapping which has been cleaned of
+ # funny business such as REDIRECT_ prefixes added by Apache
+ # or HTTP_CGI_AUTHORIZATION hacks.
+ dict={}
+ for key, val in env.items():
+ while key.startswith('REDIRECT_'):
+ key=key[9:]
+ dict[key]=val
+ if 'HTTP_CGI_AUTHORIZATION' in dict:
+ dict['HTTP_AUTHORIZATION']=dict['HTTP_CGI_AUTHORIZATION']
+ try: del dict['HTTP_CGI_AUTHORIZATION']
+ except: pass
+ return dict
+
+
+def parse_cookie(
+ text,
+ result=None,
+ qparmre=re.compile(
+ '([\x00- ]*([^\x00- ;,="]+)="([^"]*)"([\x00- ]*[;,])?[\x00- ]*)'),
+ parmre=re.compile(
+ '([\x00- ]*([^\x00- ;,="]+)=([^\x00- ;,"]*)([\x00- ]*[;,])?[\x00- ]*)'),
+ ):
+
+ if result is None: result={}
+ already_have=result.has_key
+
+ mo_q = qparmre.match(text)
+
+ if mo_q:
+ # Match quoted correct cookies
+
+ l = len(mo_q.group(1))
+ name = unicode(mo_q.group(2), ENCODING)
+ value = unicode(mo_q.group(3), ENCODING)
+
+ else:
+ # Match evil MSIE cookies ;)
+
+ mo_p = parmre.match(text)
+
+ if mo_p:
+ l = len(mo_p.group(1))
+ name = unicode(mo_p.group(2), ENCODING)
+ value = unicode(mo_p.group(3), ENCODING)
+
+ else:
+ return result
+
+ if not already_have(name): result[name]=value
+
+ return apply(parse_cookie,(text[l:],result))
+
+
+# Possible HTTP status responses
+status_reasons = {
+100: 'Continue',
+101: 'Switching Protocols',
+102: 'Processing',
+200: 'OK',
+201: 'Created',
+202: 'Accepted',
+203: 'Non-Authoritative Information',
+204: 'No Content',
+205: 'Reset Content',
+206: 'Partial Content',
+207: 'Multi-Status',
+300: 'Multiple Choices',
+301: 'Moved Permanently',
+302: 'Moved Temporarily',
+303: 'See Other',
+304: 'Not Modified',
+305: 'Use Proxy',
+307: 'Temporary Redirect',
+400: 'Bad Request',
+401: 'Unauthorized',
+402: 'Payment Required',
+403: 'Forbidden',
+404: 'Not Found',
+405: 'Method Not Allowed',
+406: 'Not Acceptable',
+407: 'Proxy Authentication Required',
+408: 'Request Time-out',
+409: 'Conflict',
+410: 'Gone',
+411: 'Length Required',
+412: 'Precondition Failed',
+413: 'Request Entity Too Large',
+414: 'Request-URI Too Large',
+415: 'Unsupported Media Type',
+416: 'Requested range not satisfiable',
+417: 'Expectation Failed',
+422: 'Unprocessable Entity',
+423: 'Locked',
+424: 'Failed Dependency',
+500: 'Internal Server Error',
+501: 'Not Implemented',
+502: 'Bad Gateway',
+503: 'Service Unavailable',
+504: 'Gateway Time-out',
+505: 'HTTP Version not supported',
+507: 'Insufficient Storage',
+}
+
+status_codes={}
+# Add mappings for builtin exceptions and
+# provide text -> error code lookups.
+for key, val in status_reasons.items():
+ status_codes[val.replace(' ', '').lower()] = key
+ status_codes[val.lower()] = key
+ status_codes[key] = key
+ status_codes[str(key)] = key
+
+en = [n.lower() for n in dir(__builtins__) if n.endswith('Error')]
+
+for name in en:
+ status_codes[name] = 500
+
+
+accumulate_header = {'set-cookie': 1}.has_key
+
+
class URLGetter:
def __init__(self, request):
@@ -427,152 +560,6 @@
return d.keys()
-
-base64 = None
-
-def sane_environment(env):
- # return an environment mapping which has been cleaned of
- # funny business such as REDIRECT_ prefixes added by Apache
- # or HTTP_CGI_AUTHORIZATION hacks.
- dict={}
- for key, val in env.items():
- while key.startswith('REDIRECT_'):
- key=key[9:]
- dict[key]=val
- if 'HTTP_CGI_AUTHORIZATION' in dict:
- dict['HTTP_AUTHORIZATION']=dict['HTTP_CGI_AUTHORIZATION']
- try: del dict['HTTP_CGI_AUTHORIZATION']
- except: pass
- return dict
-
-
-def parse_cookie(
- text,
- result=None,
- qparmre=re.compile(
- '([\x00- ]*([^\x00- ;,="]+)="([^"]*)"([\x00- ]*[;,])?[\x00- ]*)'),
- parmre=re.compile(
- '([\x00- ]*([^\x00- ;,="]+)=([^\x00- ;,"]*)([\x00- ]*[;,])?[\x00- ]*)'),
- ):
-
- if result is None: result={}
- already_have=result.has_key
-
- mo_q = qparmre.match(text)
-
- if mo_q:
- # Match quoted correct cookies
-
- l = len(mo_q.group(1))
- name = unicode(mo_q.group(2), ENCODING)
- value = unicode(mo_q.group(3), ENCODING)
-
- else:
- # Match evil MSIE cookies ;)
-
- mo_p = parmre.match(text)
-
- if mo_p:
- l = len(mo_p.group(1))
- name = unicode(mo_p.group(2), ENCODING)
- value = unicode(mo_p.group(3), ENCODING)
-
- else:
- return result
-
- if not already_have(name): result[name]=value
-
- return apply(parse_cookie,(text[l:],result))
-
-
-
-
-'''HTTP Response Output formatter
-
-$Id$'''
-
-import sys, re
-from types import StringTypes, UnicodeType, ClassType
-from cgi import escape
-
-from zope.component import queryAdapter
-
-from zope.publisher.base import BaseResponse
-from zope.publisher.interfaces import Redirect
-from zope.publisher.interfaces.http import IHTTPResponse
-from zope.publisher.interfaces.http import IHTTPApplicationResponse
-from zope.exceptions.exceptionformatter import format_exception
-from zope.interfaces.i18n import IUserPreferredCharsets
-
-# Possible HTTP status responses
-status_reasons = {
-100: 'Continue',
-101: 'Switching Protocols',
-102: 'Processing',
-200: 'OK',
-201: 'Created',
-202: 'Accepted',
-203: 'Non-Authoritative Information',
-204: 'No Content',
-205: 'Reset Content',
-206: 'Partial Content',
-207: 'Multi-Status',
-300: 'Multiple Choices',
-301: 'Moved Permanently',
-302: 'Moved Temporarily',
-303: 'See Other',
-304: 'Not Modified',
-305: 'Use Proxy',
-307: 'Temporary Redirect',
-400: 'Bad Request',
-401: 'Unauthorized',
-402: 'Payment Required',
-403: 'Forbidden',
-404: 'Not Found',
-405: 'Method Not Allowed',
-406: 'Not Acceptable',
-407: 'Proxy Authentication Required',
-408: 'Request Time-out',
-409: 'Conflict',
-410: 'Gone',
-411: 'Length Required',
-412: 'Precondition Failed',
-413: 'Request Entity Too Large',
-414: 'Request-URI Too Large',
-415: 'Unsupported Media Type',
-416: 'Requested range not satisfiable',
-417: 'Expectation Failed',
-422: 'Unprocessable Entity',
-423: 'Locked',
-424: 'Failed Dependency',
-500: 'Internal Server Error',
-501: 'Not Implemented',
-502: 'Bad Gateway',
-503: 'Service Unavailable',
-504: 'Gateway Time-out',
-505: 'HTTP Version not supported',
-507: 'Insufficient Storage',
-}
-
-status_codes={}
-# Add mappings for builtin exceptions and
-# provide text -> error code lookups.
-for key, val in status_reasons.items():
- status_codes[val.replace(' ', '').lower()] = key
- status_codes[val.lower()] = key
- status_codes[key] = key
- status_codes[str(key)] = key
-
-en = [n.lower() for n in dir(__builtins__) if n.endswith('Error')]
-
-for name in en:
- status_codes[name] = 500
-
-
-accumulate_header = {'set-cookie': 1}.has_key
-
-
-
class HTTPResponse (BaseResponse):
__implements__ = IHTTPResponse, IHTTPApplicationResponse, \
@@ -952,11 +939,6 @@
return '\n'.join(tb)
-"""blisher.py,v 1.1.2.2 2002/04/02 02:20:33 srichter Exp $
-"""
-from zope.publisher.interfaces.http import IHTTPPublisher
-
-
class DefaultPublisher:
__implements__ = IHTTPPublisher
@@ -965,15 +947,6 @@
'See IHTTPPublisher'
return getattr(self, name)
-
-
-"""Retrieval of browser character set information.
-
-$Id$
-"""
-
-from zope.interfaces.i18n import IUserPreferredCharsets
-
def sort_charsets(x, y):
if y[1] == 'utf-8':
=== Zope3/src/zope/publisher/publish.py 1.2 => 1.3 ===
--- Zope3/src/zope/publisher/publish.py:1.2 Wed Dec 25 09:15:18 2002
+++ Zope3/src/zope/publisher/publish.py Fri Dec 27 11:40:25 2002
@@ -11,9 +11,17 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Provide an apply-like facility that works with any mapping object
+"""
+Python Object Publisher -- Publish Python objects on web servers
+
+Provide an apply-like facility that works with any mapping object
+
+$Id$
"""
+
+import sys, os
+from zope.publisher.interfaces import Retry
from zope.proxy.introspection import removeAllProxies
_marker = [] # Create a new marker object.
@@ -104,17 +112,6 @@
args = tuple(args)
return object(*args)
-
-
-"""
-Python Object Publisher -- Publish Python objects on web servers
-
-$Id$
-"""
-
-
-import sys, os
-from zope.publisher.interfaces import Retry
def publish(request, handle_errors=1):
try: # finally to clean up to_raise and close request
=== Zope3/src/zope/publisher/vfs.py 1.2 => 1.3 ===
--- Zope3/src/zope/publisher/vfs.py:1.2 Wed Dec 25 09:15:18 2002
+++ Zope3/src/zope/publisher/vfs.py Fri Dec 27 11:40:25 2002
@@ -16,7 +16,18 @@
$Id$
"""
-from zope.publisher.base import BaseResponse
+import datetime
+
+from zope.component import queryAdapter
+from zope.publisher.interfaces.vfs import IVFSFilePublisher
+from zope.publisher.interfaces.vfs import IVFSView
+from zope.publisher.interfaces.vfs import IVFSCredentials
+from zope.app.interfaces.dublincore import IZopeDublinCore
+from zope.publisher.base import BaseResponse, BaseRequest
+
+zerotime = datetime.datetime.fromtimestamp(0)
+
+__metaclass__ = type # All classes are new style when run with Python 2.2+
class VFSResponse(BaseResponse):
@@ -52,35 +63,6 @@
# import traceback
# traceback.print_exc()
-
-"""
-
-$Id$
-"""
-__metaclass__ = type # All classes are new style when run with Python 2.2+
-
-from zope.publisher.interfaces.vfs import IVFSView
-
-class VFSView:
-
- __implements__ = IVFSView
-
- def __init__(self, context, request):
- self.context = context
- self.request = request
-
-
-"""
-
-$Id$
-"""
-
-from zope.publisher.base import BaseRequest
-from zope.publisher.interfaces.vfs import IVFSView
-from zope.publisher.interfaces.vfs import IVFSCredentials
-
-
-
class VFSRequest(BaseRequest):
__implements__ = BaseRequest.__implements__, IVFSCredentials
@@ -131,21 +113,13 @@
str(self.__class__), id(self), '/'.join(self._traversal_stack))
-"""VFS-View for IFile
-
-VFS-view implementation for a generic file.
-
-$Id$
-"""
-import datetime
-zerotime = datetime.datetime.fromtimestamp(0)
-
-from zope.component import queryAdapter
-
+class VFSView:
-from zope.publisher.interfaces.vfs import IVFSFilePublisher
+ __implements__ = IVFSView
-from zope.app.interfaces.dublincore import IZopeDublinCore
+ def __init__(self, context, request):
+ self.context = context
+ self.request = request
class VFSFileView(VFSView):
=== Zope3/src/zope/publisher/xmlrpc.py 1.2 => 1.3 ===
--- Zope3/src/zope/publisher/xmlrpc.py:1.2 Wed Dec 25 09:15:18 2002
+++ Zope3/src/zope/publisher/xmlrpc.py Fri Dec 27 11:40:25 2002
@@ -15,8 +15,21 @@
$Id$
"""
+
+import xmlrpclib
+from cgi import FieldStorage
+
from zope.publisher.interfaces.xmlrpc import IXMLRPCPublisher
+from zope.publisher.interfaces.xmlrpc import IXMLRPCPublication
+from zope.publisher.interfaces.xmlrpc import IXMLRPCPresentation
+from zope.publisher.interfaces.xmlrpc import IXMLRPCView
+
+from zope.publisher.http import HTTPRequest, HTTPResponse
from zope.publisher.http import DefaultPublisher
+from zope.proxy.introspection import removeAllProxies
+
+__metaclass__ = type # All classes are new style when run with Python 2.2+
+
class MethodPublisher(DefaultPublisher):
"""Simple XML-RPC publisher that is identical to the HTTP Default Publisher
@@ -26,20 +39,6 @@
__implements__ = IXMLRPCPublisher
-"""
-
-$Id$
-"""
-
-import xmlrpclib
-from cgi import FieldStorage
-from zope.publisher.http import HTTPRequest
-from zope.publisher.interfaces.xmlrpc import IXMLRPCPublisher
-from zope.publisher.interfaces.xmlrpc import IXMLRPCPublication
-from zope.publisher.interfaces.xmlrpc import IXMLRPCPresentation
-
-
-
class XMLRPCRequest(HTTPRequest):
__implements__ = HTTPRequest.__implements__, IXMLRPCPublication
@@ -48,15 +47,12 @@
# to implement IXMLRPCPublisher
_presentation_type = IXMLRPCPresentation
-
_args = ()
-
def _createResponse(self, outstream):
"""Create a specific XML-RPC response object."""
return XMLRPCResponse(outstream)
-
def processInputs(self):
'See IPublisherRequest'
@@ -96,17 +92,6 @@
body_instream, outstream, _testEnv, response)
-
-"""
-
-$Id$
-"""
-import xmlrpclib
-
-from zope.publisher.http import HTTPResponse
-from zope.proxy.introspection import removeAllProxies
-
-
class XMLRPCResponse(HTTPResponse):
"""XMLRPC response
"""
@@ -181,14 +166,6 @@
self.setBody(fault_text)
self.setStatus(200)
-
-"""
-
-$Id$
-"""
-__metaclass__ = type # All classes are new style when run with Python 2.2+
-
-from zope.publisher.interfaces.xmlrpc import IXMLRPCView
class XMLRPCView: