#NEWLINE# def get_attribute( line , name , as_color = False ) : #NEWLINE# #INDENT# if ( not ( name in line ) ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# attribute = line . split ( name ) [ 1 ] . split ( '"' ) [ 1 ] . strip ( ) #NEWLINE# if as_color : #NEWLINE# #INDENT# while ( len ( attribute ) < 6 ) : #NEWLINE# #INDENT# attribute = ( '0' + as_color ) #NEWLINE# #UNINDENT# #UNINDENT# return attribute