fix: greedy match for file_content extraction; tgapp: add running indicator, HTML formatting, single instance lock; misc improvements

This commit is contained in:
Liang Jiaqing
2026-02-13 13:34:21 +08:00
parent 6bc5f3e80d
commit 98c349a1e8
5 changed files with 45 additions and 23 deletions

View File

@@ -17,15 +17,17 @@ def get_screen_width():
except: return 1920
def start_streamlit(port):
global proc
global proc, tgproc
cmd = [
sys.executable, "-m", "streamlit", "run", "stapp.py",
"--server.port", str(port),
sys.executable, "-m", "streamlit", "run", "stapp.py",
"--server.port", str(port),
"--server.headless", "true",
"--theme.base", "dark" #以此默认开启暗黑模式,更有极客感
]
proc = subprocess.Popen(cmd)
atexit.register(proc.kill)
tgproc = subprocess.Popen([sys.executable, "tgapp.py"], creationflags=subprocess.CREATE_NO_WINDOW if os.name=='nt' else 0)
atexit.register(tgproc.kill)
def inject(text):
window.evaluate_js(f"""