feat: add local library and refresh interface

This commit is contained in:
dinlo
2026-07-15 20:19:54 +08:00
parent e1b2485156
commit a8b0b4f34e
4 changed files with 364 additions and 82 deletions
+28
View File
@@ -0,0 +1,28 @@
@echo off
setlocal
cd /d "%~dp0"
rem Prevent an inherited PYTHONPATH/PYTHONHOME from another application
rem (for example Hermes) from loading packages outside this project's .venv.
set "PYTHONPATH="
set "PYTHONHOME="
if not exist ".venv\Scripts\python.exe" (
echo [ERROR] Virtual environment .venv was not found.
echo Create it and install dependencies first:
echo py -3.12 -m venv .venv
echo .venv\Scripts\python -m pip install fastapi uvicorn pydantic beautifulsoup4 lxml httpx deep-translator markdown bleach trafilatura python-multipart
pause
exit /b 1
)
".venv\Scripts\python.exe" main.py
set "EXIT_CODE=%ERRORLEVEL%"
if not "%EXIT_CODE%"=="0" (
echo.
echo [ERROR] Application stopped with code %EXIT_CODE%.
pause
)
exit /b %EXIT_CODE%