1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 01:38:21 +08:00

Add: fake module PIL for webui (#4374)

* Add: fake module PIL for webui

* Fix: Load runtime before module PIL

* Upd: Error message of MAA loading failure

* Upd: Adjust timing of import fake module
This commit is contained in:
SarContDeli
2024-11-19 12:37:59 +08:00
committed by GitHub
parent bc5e6ed86a
commit bd680eb3a8
7 changed files with 65 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
import argparse
import os
import sys
import queue
import argparse
import threading
from multiprocessing import Process
from typing import Dict, List, Union
@@ -9,6 +10,12 @@ import inflection
from filelock import FileLock
from rich.console import Console, ConsoleRenderable
# Since this file does not run under the same process or subprocess of app.py
# the following code needs to be repeated
# Import fake module before import pywebio to avoid importing unnecessary module PIL
from module.webui.fake_pil_module import *
import_fake_pil_module()
from module.config.utils import filepath_config
from module.logger import logger, set_file_logger, set_func_logger
from module.submodule.submodule import load_mod
@@ -141,6 +148,9 @@ class ProcessManager:
from module.config.config import AzurLaneConfig
# Remove fake PIL module, because subprocess will use it
remove_fake_pil_module()
AzurLaneConfig.stop_event = e
try:
# Run alas