update project configuration and add development tools

- Add Python virtual environment patterns to .gitignore
- Replace .codebuddy with .clinerules in .gitignore
- Add .pid file for process tracking
- Add comprehensive .pylintrc configuration for Python linting
- Update start.bat with English translations and simplified functions
This commit is contained in:
Falck
2026-04-19 12:00:02 +08:00
parent 282a42081b
commit e72818399c
76 changed files with 953 additions and 152 deletions

View File

@@ -306,7 +306,8 @@ class DashboardPlugin(Plugin):
f.write(f"<?php\n{php_vars}\n?>\n{php_content}")
result = subprocess.run(
["php", "-f", tmp_file],
capture_output=True, text=True, timeout=10
capture_output=True, text=True, timeout=10,
encoding='utf-8', errors='replace'
)
return result.stdout if result.returncode == 0 else f"<pre>{result.stderr}</pre>"
finally:
@@ -319,7 +320,8 @@ class DashboardPlugin(Plugin):
@staticmethod
def _get_php_version() -> str:
try:
res = subprocess.run(['php', '-r', 'echo phpversion();'], capture_output=True, text=True, timeout=5)
res = subprocess.run(['php', '-r', 'echo phpversion();'], capture_output=True, text=True, timeout=5,
encoding='utf-8', errors='replace')
return res.stdout if res.returncode == 0 else 'N/A'
except Exception:
return 'N/A'

View File

@@ -104,7 +104,7 @@ class HttpServer:
self.wfile.write(resp.body.encode("utf-8"))
else:
self.wfile.write(resp.body)
except BrokenPipeError:
except (BrokenPipeError, ConnectionAbortedError, ConnectionResetError):
pass # 忽略客户端断开
def log_message(self, format, *args):

View File

@@ -589,7 +589,8 @@ class LogTerminalPlugin(Plugin):
f.write(f"<?php\n{php_vars}\n?>\n{php_content}")
result = subprocess.run(
["php", "-f", tmp_file],
capture_output=True, text=True, timeout=10
capture_output=True, text=True, timeout=10,
encoding='utf-8', errors='replace'
)
return result.stdout if result.returncode == 0 else f"<pre>{result.stderr}</pre>"
finally:

View File

@@ -134,7 +134,8 @@ class PkgManagerPlugin(Plugin):
result = subprocess.run(
["php", "-f", tmp_file],
capture_output=True, text=True, timeout=10, cwd=views_dir
capture_output=True, text=True, timeout=10, cwd=views_dir,
encoding='utf-8', errors='replace'
)
return result.stdout if result.returncode == 0 else f"<pre>{result.stderr}</pre>"
finally:

View File

@@ -99,7 +99,8 @@ class WebUIServer:
result = subprocess.run(
["php", "-f", tmp_file],
capture_output=True, text=True, timeout=10, cwd=views_dir
capture_output=True, text=True, timeout=10, cwd=views_dir,
encoding='utf-8', errors='replace'
)
if result.returncode != 0: