Skip to content

Commit

Permalink
web: support showing browser inside termux
Browse files Browse the repository at this point in the history
  • Loading branch information
SoulMelody committed Jul 10, 2024
1 parent f11f144 commit b7e3555
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libresvip/web/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
import pathlib
import re
import secrets
import shutil
import textwrap
import traceback
import uuid
import webbrowser
import zipfile
from concurrent.futures import ThreadPoolExecutor
from operator import not_
Expand Down Expand Up @@ -2072,6 +2074,10 @@ def main() -> None:
arg_parser.add_argument("--daemon", action="store_true")
args, argv = arg_parser.parse_known_args()

if shutil.which("termux-open-url") is not None:
# a workaround for termux platform, from https://github.com/python/cpython/issues/90371#issuecomment-1460738762
webbrowser.register("termux-open-url '%s'", None)

secrets_path = app_dir.user_config_path / "secrets.txt"
if not secrets_path.exists():
secrets_path.parent.mkdir(parents=True, exist_ok=True)
Expand Down

0 comments on commit b7e3555

Please sign in to comment.