def process_input(input, decode=False, path=False): if decode: #decode the provided string if path: res = url.decodePathElement(input) else: res = url.decodeQueryElement(input) else: #encode the provided string if path: res = url.encodePathElement(input) else: res = url.encodeQueryElement(input) return res
def process_input(input, decode=False, path=False): if decode: # decode the provided string if path: res = url.decodePathElement(input) else: res = url.decodeQueryElement(input) else: # encode the provided string if path: res = url.encodePathElement(input) else: res = url.encodeQueryElement(input) return res