def _add_query_parameter(url, name, value):
 if (value is None):
  return url
 else:
  parsed = list(urlparse.urlparse(url))
  q = parse_qsl(parsed[4])
  q.append((name, value))
  parsed[4] = urllib.urlencode(q)
  return urlparse.urlunparse(parsed)

def _add_query_parameter ( url , name , value ) : if ( value is None ) : return url else : parsed = list ( urlparse . urlparse ( url ) ) q = parse_qsl ( parsed [ 4 ] ) q . append ( ( name , value ) ) parsed [ 4 ] = urllib . urlencode ( q ) return urlparse . urlunparse ( parsed )
adds a query parameter to a url args: url: string .