#NEWLINE# def parse_status( self , status , job_ids ) : #NEWLINE# #INDENT# tree = None #NEWLINE# rval = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for line in status . strip ( ) . splitlines ( ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# tree = et . fromstring ( line . strip ( ) ) #NEWLINE# assert ( tree . tag == 'Data' ) #NEWLINE# break #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# tree = None #NEWLINE# #UNINDENT# #UNINDENT# if ( tree is None ) : #NEWLINE# #INDENT# log . warning ( ( 'No valid qstat XML return from `qstat -x`, got the following: %s' % status ) ) #NEWLINE# return None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for job in tree . findall ( 'Job' ) : #NEWLINE# #INDENT# id = job . find ( 'Job_Id' ) . text #NEWLINE# if ( id in job_ids ) : #NEWLINE# #INDENT# state = job . find ( 'job_state' ) . text #NEWLINE# rval [ id ] = self . _get_job_state ( state ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return rval