コード例 #1
0
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
コード例 #2
0
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