You are not logged in Log in Join
You are here: Home » Members » adytumsolutions » PyCon2004 » StubOutZopeCode » wikipage_view

Log in
Name

Password

 
 
Zope2 Sprint »

StubOutZopeCode

"""
need - 

from medusa.http_date import build_http_date
from medusa.producers import hooked_producer
from medusa import http_server

"""
 
########################################
# this is from the ZServer.HTTPResponse
########################################

class ZServerHTTPResponse(HTTPResponse):
    # Set this value to 1 if streaming output in
    # HTTP/1.1 should use chunked encoding
    http_chunk=1
    http_chunk_size=1024

    # defaults
    _http_version='1.0'
    _http_connection='close'
    _server_version='Zope/2.0 ZServer/2.0'

    # using streaming response
    _streaming=0
    # using chunking transfer-encoding
    _chunking=0

    def __str__(self,
                html_search=re.compile('<html>',re.I).search,
                ):
		pass
		
    def write(self,data):
        """\
        Return data as a stream

        HTML data may be returned using a stream-oriented interface.
        This allows the browser to display partial results while
        computation of a response to proceed.

        The published object should first set any output headers or
        cookies on the response object.

        Note that published objects must not generate any errors
        after beginning stream-oriented output.

        """
        pass
        
    def _finish(self):
        pass		   
        
    def retry(self):
        """Return a request object to be used in a retry attempt
        """
        # This implementation is a bit lame, because it assumes that
        # only stdout stderr were passed to the constructor. OTOH, I
        # think that that's all that is ever passed.        
        pass
        

class ChannelPipe:
    """Experimental pipe from ZPublisher to a ZServer Channel.
    Should only be used by one thread at a time. Note also that
    the channel will be being handled by another thread, thus
    restrict access to channel to the push method only."""

    def __init__(self, request):
        self._channel=request.channel
        self._request=request
        self._shutdown=0
        self._close=0
        self._bytes=0


    def write(self, text, l=None):
        pass
        
    def close(self):
        pass
        
    def flush(self): pass # yeah, whatever
        pass
        
    def finish(self, response):
        pass
        
is_proxying_match = re.compile(r'[^ ]* [^ \\]*:').match
proxying_connection_re = re.compile ('Proxy-Connection: (.*)', re.IGNORECASE)

def make_response(request, headers):
    """Simple http response factory"""
	pass