Exemplo n.º 1
0
def CheckTuitu():
    users = list_all_users(0)
    for acc in users:
        AR = AutomatorRecorder(acc)
        ts = AR.get("tuitu_status", UDD["tuitu_status"])
        if ts['max'] is not None:
            print("USER: "******" Normal: ", ts['max'])
Exemplo n.º 2
0
def list_account():
    """
    获取账号列表
    ---
    tags:
      - 账号
    description:

    responses:
      2xx:
        description: 成功
      4xx:
        description: 参数有误等
    """
    data = []
    count = 0

    all_users = list_all_users()
    count = len(all_users)

    for username in all_users:
        try:
            user = AutomatorRecorder(username).getuser()
        except Exception as e:
            return NotFoundError(e)
        if user is not None:
            data.append({
                'username': user.get('account'),
                'password': '******',
                'taskname': user.get('taskfile'),
                'tags': '-'
            })

    return ListReply(data, count)
Exemplo n.º 3
0
def CheckTuitu():
    users = list_all_users(0)
    for acc in users:
        AR = AutomatorRecorder(acc)
        ts = AR.get("tuitu_status", UDD["tuitu_status"])
        if ts['max'] is not None or ts["Hmax"] is not None:
            print("USER: "******" ")
            if ts['max'] is not None:
                print("Normal ", ts["max"], end=" ")
            if ts["Hmax"] is not None:
                print("Hard ", ts["Hmax"], end=" ")
            print("")
Exemplo n.º 4
0
def CheckState():
    users = list_all_users(0)
    for acc in users:
        AR = AutomatorRecorder(acc)
        uj = AR.getuser()
        print("USER: "******" TASK: ",
              "NONE" if uj["taskfile"] == "" else uj["taskfile"],
              "STATUS ",
              end="")
        rs = AR.get_run_status()
        if rs["error"] is None:
            if rs["finished"]:
                print("FINISHED.")
            else:
                print("CURRENT: ", rs["current"])
        else:
            print("ERROR: ", rs["error"])
Exemplo n.º 5
0
def CheckStateReturn():
    users = list_all_users(0)
    acc_task_info = []
    for acc in users:
        AR = AutomatorRecorder(acc)
        uj = AR.getuser()
        acc_task_tmpinfo = "账号:%s 任务:%s 状态:" % (acc, "NONE" if uj["taskfile"]
                                                == "" else uj["taskfile"])
        rs = AR.get_run_status()
        if rs["error"] is None:
            if rs["finished"]:
                acc_task_tmpinfo = acc_task_tmpinfo + "FINISHED."
            else:
                acc_task_tmpinfo = acc_task_tmpinfo + "CURRENT:%s" % rs[
                    "current"]
        else:
            acc_task_tmpinfo = acc_task_tmpinfo + "ERROR:%s" % rs["error"]
        acc_task_info.append(acc_task_tmpinfo)
        acc_task_info.append('\n')
    acc_task_info = ''.join(acc_task_info).replace(',', '\n').replace("'", '')
    return acc_task_info
Exemplo n.º 6
0
def RunFirstTime():
    users = list_all_users(0)
    for acc in users:
        Restart(acc)
    execute(False, 3)
Exemplo n.º 7
0
def readjson():  # 读取账号
    # 2020-07-18 增加读取json账号
    # 等待一段时间再上限,建议将配置逻辑合并到AutomatorRecord中,调用getuser函数获取配置
    # 等刷图等逻辑合并到配置文件中后,可以弃用read()函数,runmain传参只需传入配置文件路径
    # 然后在Automator内部调用getuser获取account,password等一系列配置
    return list_all_users(0)