f
This commit is contained in:
@@ -138,11 +138,11 @@ def verify_imports(venv_py: Path, packages: List[str]) -> bool:
|
||||
"python-dateutil": "dateutil",
|
||||
"beautifulsoup4": "bs4",
|
||||
"pillow-heif": "pillow_heif",
|
||||
"pillow-jxl-plugin": "pillow_jxl_plugin",
|
||||
"pillow-jxl-plugin": "pillow_jxl",
|
||||
"pyopenssl": "OpenSSL",
|
||||
"pysocks": "socks",
|
||||
"service-identity": "service_identity",
|
||||
"show-in-file-manager": "show_in_file_manager",
|
||||
"show-in-file-manager": "showinfm",
|
||||
"opencv-python-headless": "cv2",
|
||||
"mpv": "mpv",
|
||||
"pyside6": "PySide6",
|
||||
@@ -642,16 +642,23 @@ def main(argv: Optional[List[str]] = None) -> int:
|
||||
|
||||
args = p.parse_args(argv)
|
||||
|
||||
workspace_root = Path(__file__).resolve().parent.parent
|
||||
# Determine default repo root: prefer <workspace>/hydrusnetwork when present
|
||||
script_dir = Path(__file__).resolve().parent
|
||||
if (script_dir / "hydrus_client.py").exists():
|
||||
workspace_root = script_dir
|
||||
else:
|
||||
workspace_root = script_dir.parent
|
||||
|
||||
if args.repo_root:
|
||||
repo_root = Path(args.repo_root).expanduser().resolve()
|
||||
else:
|
||||
candidate = workspace_root / "hydrusnetwork"
|
||||
if candidate.exists():
|
||||
repo_root = candidate
|
||||
else:
|
||||
if (workspace_root / "hydrus_client.py").exists():
|
||||
repo_root = workspace_root
|
||||
else:
|
||||
candidate = workspace_root / "hydrusnetwork"
|
||||
if candidate.exists():
|
||||
repo_root = candidate
|
||||
else:
|
||||
repo_root = workspace_root
|
||||
|
||||
venv_py = find_venv_python(repo_root, args.venv, args.venv_name)
|
||||
|
||||
@@ -822,14 +829,15 @@ def main(argv: Optional[List[str]] = None) -> int:
|
||||
cmd = [str(venv_py), str(client_path)] + client_args
|
||||
|
||||
# Determine headless vs GUI
|
||||
first_run = is_first_run(repo_root)
|
||||
if args.gui:
|
||||
headless = False
|
||||
elif args.headless:
|
||||
headless = True
|
||||
else:
|
||||
headless = not first_run
|
||||
if not args.quiet and first_run:
|
||||
# Default to GUI for the client launcher
|
||||
headless = False
|
||||
|
||||
if not args.quiet and is_first_run(repo_root):
|
||||
print("First run detected: defaulting to GUI unless --headless is specified.")
|
||||
|
||||
env = os.environ.copy()
|
||||
|
||||
Reference in New Issue
Block a user