#NEWLINE# def update_environ( self , key , name ) : #NEWLINE# #INDENT# value = self . lookup ( key ) #NEWLINE# if ( value is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# self . __environ_keys . add ( key ) #NEWLINE# assignment = '{name}={value}' . format ( name = name , value = value ) #NEWLINE# match = re . search ( '^{name}=.*' . format ( name = name ) , self . __environ_content , re . MULTILINE ) #NEWLINE# if match : #NEWLINE# #INDENT# self . __environ_content = '' . join ( [ assignment . __environ_content [ 0 : match . start ( 0 ) ] , assignment , self . __environ_content [ match . end ( 0 ) : ] ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . __environ_content += ( assignment + '\n' )