#NEWLINE# def gotHeaders( self , headers ) : #NEWLINE# #INDENT# if ( self . status == '200' ) : #NEWLINE# #INDENT# if ( self . quiet == False ) : #NEWLINE# #INDENT# self . wget . write ( '200 OK\n' ) #NEWLINE# #UNINDENT# if ( 'content-length' in headers ) : #NEWLINE# #INDENT# self . totallength = int ( headers [ 'content-length' ] [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . totallength = 0 #NEWLINE# #UNINDENT# if ( 'content-type' in headers ) : #NEWLINE# #INDENT# self . contenttype = headers [ 'content-type' ] [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . contenttype = 'text/whatever' #NEWLINE# #UNINDENT# self . currentlength = 0.0 #NEWLINE# if ( self . totallength > 0 ) : #NEWLINE# #INDENT# if ( self . quiet == False ) : #NEWLINE# #INDENT# self . wget . write ( ( 'Length: %d (%s) [%s]\n' % ( self . totallength , sizeof_fmt ( self . totallength ) , self . contenttype ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . quiet == False ) : #NEWLINE# #INDENT# self . wget . write ( ( 'Length: unspecified [%s]\n' % self . contenttype ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( ( self . wget . limit_size > 0 ) and ( self . totallength > self . wget . limit_size ) ) : #NEWLINE# #INDENT# log . msg ( ( 'Not saving URL (%s) due to file size limit' % ( self . wget . url , ) ) ) #NEWLINE# self . fileName = os . path . devnull #NEWLINE# self . nomore = True #NEWLINE# #UNINDENT# if ( self . quiet == False ) : #NEWLINE# #INDENT# self . wget . write ( ( 'Saving to: `%s\n\n' % self . fakeoutfile ) ) #NEWLINE# #UNINDENT# #UNINDENT# return client . HTTPDownloader . gotHeaders ( self , self )