def get_status(self): """ 获取队列中序号、账号、执行目录、当前状态 """ q = self.tasks.get_attribute("queue") L = [] for ind, T in enumerate(q): if type(T) is not tuple or len(T) != 6: print("DEBUG: ", T) break (_, acc, taskname, rec, _, _) = T state = AutomatorRecorder.get_user_state(acc, rec) L += [(ind, acc, taskname, rec, state)] return L
def show(self): """ 显示当前全部设备状态 """ print("= 设备信息 =") for i, j in self.devices.items(): print(i, ": ", end="") if j.state == Device.DEVICE_OFFLINE: print("离线") elif j.state == Device.DEVICE_AVAILABLE: print("空闲", " 开机时间", time_period_format(time.time() - j.time_wake)) elif j.state == Device.DEVICE_BUSY: tm = time.time() print("正忙", " 开机时间", time_period_format(tm - j.time_wake), " 本次工作时间", time_period_format(tm - j.time_busy), end="") if j.cur_acc != "": print(" 当前任务:账号", j.cur_acc, AutomatorRecorder.get_user_state(j.cur_acc, j.cur_rec), end="") if j.emulator_launcher is not None: print(" [自动控制中]", end="") print()