#NEWLINE# def write( self , arg ) : #NEWLINE# #INDENT# self . send_headers ( ) #NEWLINE# if ( not isinstance ( arg , binary_type ) ) : #NEWLINE# #INDENT# raise TypeError ( ( '%r is not a byte' % arg ) ) #NEWLINE# #UNINDENT# arglen = len ( arg ) #NEWLINE# tosend = arglen #NEWLINE# if ( self . response_length is not None ) : #NEWLINE# #INDENT# if ( self . sent >= self . response_length ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# tosend = min ( ( self . response_length - self . sent ) , tosend ) #NEWLINE# if ( tosend < arglen ) : #NEWLINE# #INDENT# arg = arg [ : tosend ] #NEWLINE# #UNINDENT# #UNINDENT# if ( self . chunked and ( tosend == 0 ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# self . sent += tosend #NEWLINE# util . write ( tosend . sock , arg , self . chunked )