#NEWLINE# def replace( self , name , value = None ) : #NEWLINE# #INDENT# "\n        Remove all existing occurrences of the query argument 'name', *if it\n        exists*, then add the argument with the given value.\n\n        C{None} indicates that the argument has no value.\n        " #NEWLINE# ql = self . queryList ( False ) #NEWLINE# i = 0 #NEWLINE# for ( k , v ) in ql : #NEWLINE# #INDENT# if ( k == name ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# i += 1 #NEWLINE# #UNINDENT# q = filter ( ( lambda x : ( x [ 0 ] != name ) ) , ql ) #NEWLINE# q . insert ( i , ( name , value ) ) #NEWLINE# return self . _pathMod ( self . pathList ( copy = False ) , q )