#NEWLINE# def setCopyableState( self , state ) : #NEWLINE# #INDENT# '\n        Initialize this L{twisted.web.distrib.Request} based on the copied\n        state so that it closely resembles a L{twisted.web.server.Request}.\n        ' #NEWLINE# for k in ( 'host' , 'client' ) : #NEWLINE# #INDENT# tup = state [ k ] #NEWLINE# addrdesc = { #NEWLINE# #INDENT# 'INET' : 'TCP' , #NEWLINE# 'UNIX' : 'UNIX' , #NEWLINE# #UNINDENT# } [ tup [ 0 ] ] #NEWLINE# addr = { #NEWLINE# #INDENT# 'TCP' : ( lambda : address . IPv4Address ( addrdesc , tup [ 1 ] , tup [ 2 ] , _bwHack = 'INET' ) ) , #NEWLINE# 'UNIX' : ( lambda : address . UNIXAddress ( tup [ 1 ] ) ) , #NEWLINE# #UNINDENT# } [ addrdesc ] ( ) #NEWLINE# state [ k ] = addr #NEWLINE# #UNINDENT# state [ 'requestHeaders' ] = Headers ( dict ( state [ 'requestHeaders' ] ) ) #NEWLINE# pb . RemoteCopy . setCopyableState ( self , state ) #NEWLINE# self . content = cStringIO . StringIO ( self . content_data ) #NEWLINE# self . finish = self . remote . remoteMethod ( 'finish' ) #NEWLINE# self . setHeader = self . remote . remoteMethod ( 'setHeader' ) #NEWLINE# self . addCookie = self . remote . remoteMethod ( 'addCookie' ) #NEWLINE# self . setETag = self . remote . remoteMethod ( 'setETag' ) #NEWLINE# self . setResponseCode = self . remote . remoteMethod ( 'setResponseCode' ) #NEWLINE# self . setLastModified = self . remote . remoteMethod ( 'setLastModified' ) #NEWLINE# self . _write = self . remote . remoteMethod ( 'write' )