| 2007 | |
| 2008 | @staticmethod |
| 2009 | def save_installed_msg(task_data: dict): |
| 2010 | msg_path = "{}/data/msg_box_data".format(PANEL_PATH) |
| 2011 | try: |
| 2012 | msg_list = [i for i in os.listdir(msg_path) if i not in ("not_read.tip", "update.pl")] |
| 2013 | for msg_name in msg_list: |
| 2014 | msg_file = "{}/{}".format(msg_path, msg_name) |
| 2015 | try: |
| 2016 | with open(msg_file, "r") as f: |
| 2017 | msg: dict = json.load(f) |
| 2018 | if msg["sub"]["task_id"] == task_data["id"]: |
| 2019 | task_data["msg_name"] = msg_name |
| 2020 | else: |
| 2021 | continue |
| 2022 | |
| 2023 | msg["title"] = "正在" + msg["title"][2:] |
| 2024 | msg["sub"]["file_name"] = "/tmp/panelExec.log" |
| 2025 | msg["sub"]["install_status"] = "正在" + msg["sub"]["install_status"][2:] |
| 2026 | msg["sub"]["status"] = 1 |
| 2027 | msg["read"] = False |
| 2028 | msg["read_time"] = 0 |
| 2029 | with open(msg_file, "w") as f: |
| 2030 | json.dump(msg, f) |
| 2031 | except: |
| 2032 | continue |
| 2033 | except: |
| 2034 | err_log = traceback.format_exc() |
| 2035 | write_log(err_log, _level="error", color="") |
| 2036 | |
| 2037 | @staticmethod |
| 2038 | def update_installed_msg(task_data: dict): |