def get_package(code):
    stat = check_update(code)
    print(stat)
    if stat == 0:
        stat = 'Sistema dos Correios fora do ar.'
    elif stat == 1:
        stat = None
    elif stat == 3:
        stat = None
    else:
        db.update_package(code, stat=stat, time=str(time()))
        stat = 10
    return stat
Exemple #2
0
def get_package(code):
    stat = check_update(code)
    print(stat)
    if stat == 0:
        stat = 'Sistema dos Correios fora do ar.'
    elif stat == 1:
        stat = None
    elif stat == 3:
        stat = None
    else:
        cursor = db.rastreiobot.update_one(
            {"code": code.upper()},
            {"$set": {
                "stat": stat,
                "time": str(time())
            }})
        stat = 10
    return stat
Exemple #3
0
def get_update(code):
    print("get_update")
    retorno = check_update(code)
    print("check up: ", retorno)
    return retorno