Merge branch 'main' into claude/wonderful-brattain-d1cfe0
This commit is contained in:
commit
6ef04c1f37
10 files changed
+25
-18
No files matched your search
@@ -85,6 +85,7 @@ temp/
|
||||
config/*.json
|
||||
!config/README.md
|
||||
*.bak
|
||||
*.bak_*
|
||||
*.backup
|
||||
*.orig
|
||||
*.swp
|
||||
|
||||
@@ -399,10 +399,10 @@ pip install pillow paddlepaddle paddleocr numpy opencv-python
|
||||
|
||||
# 如果 paddlepaddle 安装失败,可以尝试:
|
||||
# CPU 版本(推荐)
|
||||
pip install paddlepaddle==2.5.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
pip install "paddlepaddle>=3.0.0" -i https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
|
||||
# 或 GPU 版本(需要 CUDA)
|
||||
pip install paddlepaddle-gpu==2.5.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
pip install "paddlepaddle-gpu>=3.0.0" -i https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
|
||||
# 安装 GUI 依赖(可选)
|
||||
pip install ttkbootstrap
|
||||
|
||||
@@ -77,9 +77,6 @@ def _load_local_shim(mod_name: str, rel_path: str) -> None:
|
||||
# 1) 先加载本地 shim 模块,确保后续 import 优先使用这些实现
|
||||
_load_local_shim("douyin_text_utils", "douyin/utils/douyin_text_utils.py")
|
||||
_load_local_shim("douyin_swipe_ops", "douyin/handlers/douyin_swipe_ops.py")
|
||||
_load_local_shim(
|
||||
"douyin_reservation_ops", "douyin/reservation/douyin_reservation_ops.py"
|
||||
)
|
||||
|
||||
# 2) 再把完整逻辑所在目录追加到 sys.path,供 `douyin_fudai` 等模块导入
|
||||
try:
|
||||
|
||||
@@ -291,9 +291,13 @@ class fudai_analyse:
|
||||
self.queue_full_waiting_at_earliest: bool = False
|
||||
|
||||
# 预约队列状态文件(供 WebGUI / 其他进程查看)
|
||||
self._reservations_state_path: str = os.path.join(
|
||||
os.path.dirname(__file__), "state", "reservations.json"
|
||||
)
|
||||
try:
|
||||
from douyin.core import path_config as _pc
|
||||
self._reservations_state_path: str = _pc.get_reservations_path()
|
||||
except Exception:
|
||||
self._reservations_state_path = os.path.join(
|
||||
os.path.dirname(__file__), "state", "reservations.json"
|
||||
)
|
||||
|
||||
# 运行时直播间标题和位置映射表(用于回退校验)
|
||||
# 格式:{room_pos: {"title": str, "title_raw": str, "has_fudai": bool, "fudai_content": str, "fudai_detail": Any}}
|
||||
@@ -301,7 +305,7 @@ class fudai_analyse:
|
||||
# 每次重新运行时丢弃磁盘上旧的映射表,确保只记录本次运行的结果。
|
||||
# 同时尝试删除旧的导出文件(JSON/CSV/MD),以避免 GUI 在未写入新数据前显示过期内容。
|
||||
try:
|
||||
state_dir = os.path.join(os.path.dirname(__file__), "state")
|
||||
state_dir = os.path.dirname(self._reservations_state_path)
|
||||
state_path = os.path.join(state_dir, "room_pos_map.json")
|
||||
csv_path = os.path.join(state_dir, "room_pos_map.csv")
|
||||
md_path = os.path.join(state_dir, "room_pos_map.md")
|
||||
|
||||
@@ -61,7 +61,11 @@ def get_state_dir() -> str:
|
||||
|
||||
|
||||
def get_reservations_path() -> str:
|
||||
"""返回预约队列状态文件的路径(实际位置在douyin/core/state/reservations.json)"""
|
||||
"""返回预约队列状态文件的路径(实际位置:douyin/core/state/reservations.json)。
|
||||
|
||||
该文件由 fudai_analyse 在 douyin/core/douyin_fudai.py 中写入,
|
||||
供 WebGUI / 桌面 GUI 跨进程读取。
|
||||
"""
|
||||
return os.path.join(PROJECT_ROOT, "douyin", "core", "state", "reservations.json")
|
||||
|
||||
|
||||
|
||||
Whitespace-only changes.
@@ -191,7 +191,6 @@ def create_mapping_tab(root: tk.Tk, notebook: ttk.Notebook, cfg: dict) -> ttk.Fr
|
||||
possible_paths = [
|
||||
os.path.join(base_dir, "douyin", "core", "state", "room_pos_map.json"),
|
||||
os.path.join(base_dir, "douyin", "core", "state", "reservations.json"),
|
||||
os.path.join(base_dir, "douyin", "state", "room_pos_map.json"),
|
||||
os.path.join(os.getcwd(), "douyin", "core", "state", "room_pos_map.json"),
|
||||
]
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ def load_reservations(base_dir: str | None = None) -> Dict[int, Any]:
|
||||
reservations_data: Dict[int, Any] = {}
|
||||
reservations_paths = [
|
||||
os.path.join(base_dir, "douyin", "core", "state", "reservations.json"),
|
||||
os.path.join(base_dir, "douyin", "state", "reservations.json"),
|
||||
os.path.join(os.getcwd(), "douyin", "core", "state", "reservations.json"),
|
||||
]
|
||||
for res_path in reservations_paths:
|
||||
|
||||
+4
-1
@@ -938,11 +938,14 @@ class ProcRunner:
|
||||
else os.getcwd()
|
||||
),
|
||||
"douyin",
|
||||
"core",
|
||||
"state",
|
||||
"reservations.json",
|
||||
)
|
||||
else:
|
||||
path = os.path.join(os.getcwd(), "douyin", "state", "reservations.json")
|
||||
path = os.path.join(
|
||||
os.getcwd(), "douyin", "core", "state", "reservations.json"
|
||||
)
|
||||
try:
|
||||
if os.path.exists(path):
|
||||
with open(path, "r", encoding="utf-8") as f:
|
||||
|
||||
@@ -11,12 +11,12 @@ numpy>=1.20.0
|
||||
# 计算机视觉库
|
||||
opencv-python>=4.5.0
|
||||
|
||||
# OCR识别 - 只需一个OCR引擎即可
|
||||
# 选项1: PaddleOCR(推荐,中文识别效果好)
|
||||
paddleocr>=2.7.0
|
||||
paddlepaddle>=2.5.0,<3.0.0
|
||||
# OCR识别(与 requirements.txt 保持一致)
|
||||
# PaddleOCR 3.0+ 需要 PaddlePaddle 3.0+
|
||||
paddleocr>=3.0.0
|
||||
paddlepaddle>=3.0.0
|
||||
|
||||
# 选项2: EasyOCR(更快,但识别准确度可能略低)
|
||||
# 选项2:EasyOCR(更快,但识别准确度可能略低)
|
||||
# easyocr>=1.7.0
|
||||
|
||||
# GUI依赖(可选)
|
||||
|
||||
Reference in new issue
Block a user