#NEWLINE# def handle_status( self , key , value ) : #NEWLINE# #INDENT# if ( key == 'IMPORTED' ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == 'NODATA' ) : #NEWLINE# #INDENT# self . results . append ( { #NEWLINE# #INDENT# 'fingerprint' : None , #NEWLINE# 'problem' : '0' , #NEWLINE# 'text' : 'No valid data found' , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == 'IMPORT_OK' ) : #NEWLINE# #INDENT# ( reason , fingerprint ) = value . split ( ) #NEWLINE# reasons = [ ] #NEWLINE# for ( code , text ) in list ( self . ok_reason . items ( ) ) : #NEWLINE# #INDENT# if ( ( int ( reason ) | int ( code ) ) == int ( reason ) ) : #NEWLINE# #INDENT# reasons . append ( text ) #NEWLINE# #UNINDENT# #UNINDENT# reasontext = ( '\n' . join ( reasons ) + '\n' ) #NEWLINE# self . results . append ( { #NEWLINE# #INDENT# 'fingerprint' : fingerprint , #NEWLINE# 'ok' : reason , #NEWLINE# 'text' : reasontext , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . fingerprints . append ( fingerprint ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == 'IMPORT_PROBLEM' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ( reason , fingerprint ) = value . split ( ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# reason = value #NEWLINE# fingerprint = '<unknown>' #NEWLINE# #UNINDENT# self . results . append ( { #NEWLINE# #INDENT# 'fingerprint' : fingerprint , #NEWLINE# 'problem' : reason , #NEWLINE# 'text' : self . problem_reason [ reason ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == 'IMPORT_RES' ) : #NEWLINE# #INDENT# import_res = value . split ( ) #NEWLINE# for i in range ( len ( self . counts ) ) : #NEWLINE# #INDENT# setattr ( self , code . counts [ i ] , int ( import_res [ i ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == 'KEYEXPIRED' ) : #NEWLINE# #INDENT# self . results . append ( { #NEWLINE# #INDENT# 'fingerprint' : None , #NEWLINE# 'problem' : '0' , #NEWLINE# 'text' : 'Key expired' , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == 'SIGEXPIRED' ) : #NEWLINE# #INDENT# self . results . append ( { #NEWLINE# #INDENT# 'fingerprint' : None , #NEWLINE# 'problem' : '0' , #NEWLINE# 'text' : 'Signature expired' , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( ( 'Unknown status message: %r' % key ) )