Beispiel #1
0
def cycle(device):
    # 需要手机保持亮屏状态
    # 获取手机像素大小
    (w, h) = phone.get_size(device)

    # 滑动手机打开屏幕
    phone.swipe_down_to_up(device, w / 2, h)

    phone.go_home(device)

    phone_packages = phone.list_packages(device)
    run_apps = []
    for p in info.packages:
        if phone_packages.__contains__(info.packages[p]):
            run_apps.append(p)
Beispiel #2
0
def kuaikandian(device, w, h, gap=10):
    phone.go_home(device)
    phone.tap(device, COLUMNS[2], ROWS[4], gap)
Beispiel #3
0
def changdou(device, w, h, gap=10):
    phone.go_home(device)
    phone.tap(device, COLUMNS[1], ROWS[4], gap)
Beispiel #4
0
def eleme(device, w, h, gap=10):
    phone.go_home(device)
    phone.tap(device, COLUMNS[0], ROWS[4], gap)
Beispiel #5
0
def qingtuanshe(device, w, h, gap=10):
    phone.go_home(device)
    phone.tap(device, COLUMNS[3], ROWS[3], gap)
Beispiel #6
0
def momo(device, w, h, gap=10):
    phone.go_home(device)
    phone.tap(device, COLUMNS[2], ROWS[3], gap)
Beispiel #7
0
def kuge(device, w, h, gap=10):
    phone.go_home(device)
    phone.tap(device, COLUMNS[1], ROWS[3], gap)
Beispiel #8
0
def kuaiyin(device, w, h, gap=10):
    phone.go_home(device)
    phone.tap(device, COLUMNS[0], ROWS[3], gap)
Beispiel #9
0
def zhongqing(device, w, h, gap=10):
    phone.go_home(device)
    phone.tap(device, COLUMNS[3], ROWS[2], gap)
Beispiel #10
0
def yingke(device, w, h, gap=10):
    phone.go_home(device)
    phone.tap(device, COLUMNS[1], ROWS[2], gap)
Beispiel #11
0
def shuqi(device, w, h, gap=10):
    phone.go_home(device)
    phone.tap(device, COLUMNS[0], ROWS[2], gap)
Beispiel #12
0
def fanchang(device, w, h, gap=10):
    phone.go_home(device)
    phone.tap(device, COLUMNS[2], ROWS[1], gap)
Beispiel #13
0
def jingdong(device, w, h, gap=10):
    phone.go_home(device)
    phone.tap(device, COLUMNS[0], ROWS[1], gap)
Beispiel #14
0
def run(device):
    # 获取手机的大小
    (w, h) = phone.get_size(device)
    # 滑动手机打开屏幕
    phone.swipe_down_to_up(device, w / 2, h)
    # 回到手机主页
    phone.go_home(device)

    # 代码测试位置
    schedule.test(device, w, h)

    while True:
        if datetime.now().hour != 0:
            utils.schedule_apps(device, w, h)

        while datetime.now().hour.__eq__(0):
            print('所有程序的签到工作 ' + datetime.now().time().__str__())
            for a in info.apps:
                if utils.is_coordinate_checkin(a):
                    try:
                        getattr(checkin, a)(device, w, h)
                    except NotImplementedError as e:
                        print(a + ' checkin not implemented')
                        continue
                else:
                    try:
                        getattr(checkin, a)(device)
                    except NotImplementedError as e:
                        print(a + ' checkin not implemented')
                        continue
                    # 所有程序的签到工作
                    try:
                        getattr(sign, a)(device, w, h)
                    except NotImplementedError as e:
                        print(a + ' sign not implemented')
                        continue
                    phone.stop_app(device, info.packages[a])

            utils.tail_work(device, w, h, 0)

        while datetime.now().hour == 1:
            utils.tail_work(device, w, h, hour=1)

        while datetime.now().hour == 2:
            utils.tail_work(device, w, h, hour=2)

        while datetime.now().hour == 3:
            utils.tail_work(device, w, h, hour=3)

        while datetime.now().hour == 4:
            utils.tail_work(device, w, h, hour=4)

        while datetime.now().hour == 5:
            utils.tail_work(device, w, h, hour=5)

        while datetime.now().hour == 6:
            utils.tail_work(device, w, h, hour=6)

        while datetime.now().hour == 7:
            utils.tail_work(device, w, h, hour=7)

        while datetime.now().hour == 8:
            utils.tail_work(device, w, h, hour=8)

        while datetime.now().hour == 9:
            utils.tail_work(device, w, h, hour=9)

        while datetime.now().hour == 10:
            utils.tail_work(device, w, h, hour=10)

        while datetime.now().hour == 11:
            utils.tail_work(device, w, h, hour=11)

        while datetime.now().hour == 12:
            utils.tail_work(device, w, h, hour=12)

        while datetime.now().hour == 13:
            utils.tail_work(device, w, h, hour=13)

        while datetime.now().hour == 14:
            utils.tail_work(device, w, h, hour=14)

        while datetime.now().hour == 15:
            utils.tail_work(device, w, h, hour=15)

        while datetime.now().hour == 16:
            utils.tail_work(device, w, h, hour=16)

        while datetime.now().hour == 17:
            utils.tail_work(device, w, h, hour=17)

        while datetime.now().hour == 18:
            utils.tail_work(device, w, h, hour=18)

        while datetime.now().hour == 19:
            utils.tail_work(device, w, h, hour=19)

        while datetime.now().hour == 20:
            utils.tail_work(device, w, h, hour=20)

        while datetime.now().hour == 21:
            utils.tail_work(device, w, h, hour=21)

        while datetime.now().hour == 22:
            utils.tail_work(device, w, h, hour=22)

        while datetime.now().hour == 23:
            utils.tail_work(device, w, h, hour=23)