Example #1
0
def ifExists(item, params, src):
    paramArr = __parseParams(params)
    paramSource = resolveVariable(item, paramArr[0].replace('%s', src))
    paramTrue = resolveVariable(item, paramArr[1].replace('%s', src))
    paramFalse = resolveVariable(item, paramArr[2].replace('%s', src))

    if isOnline(paramSource):
        return paramTrue
    else:
        return paramFalse
Example #2
0
def ifExists(params, src):
    paramArr = __parseParams(params)
    paramSource = paramArr[0].replace('%s', src)
    paramTrue = paramArr[1].replace('%s', src)
    paramFalse = paramArr[2].replace('%s', src)

    if isOnline(paramSource):
        return paramTrue
    else:
        return paramFalse