设置签到状态。
(sign_type: SignType)
| 49 | |
| 50 | @staticmethod |
| 51 | def set_state(sign_type: SignType): |
| 52 | """设置签到状态。""" |
| 53 | state = { |
| 54 | "type": sign_type, |
| 55 | "start_time": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), |
| 56 | } |
| 57 | try: |
| 58 | with open(STATE_FILE, 'w', encoding='utf-8') as f: |
| 59 | json.dump(state, f, ensure_ascii=False, indent=2) |
| 60 | logger.info(f"[库洛签到·签到状态] 创建状态文件: type={sign_type}") |
| 61 | except Exception as e: |
| 62 | logger.error(f"[库洛签到·签到状态] 创建状态文件失败: {e}") |
| 63 | |
| 64 | @staticmethod |
| 65 | def clear_state(): |
no outgoing calls
no test coverage detected