Files
termux-packages/packages/sabnzbd/webbrowser.patch
termux-pacman-bot 72921351d0 addpkg(main/sabnzbd): v3.7.2
SABnzbd is an alternative to NZBGet, which is also packaged in Termux but is
now abandoned by the upstream developer.

In addition to the sabyenc3 dependency, it includes various enhancements like
service definition for `termux-services`, patch to support `termux-open-url`,
placing of `bash-completion` file etc. Before finilizing this package, I
inspected and sourced ideas from packaging of SABnzbd on Arch Linux, RHEL 8
and Ubuntu.
2023-04-14 19:30:59 +00:00

29 lines
850 B
Diff

diff --git a/sabnzbd/panic.py b/sabnzbd/panic.py
index 6e4b61f72..017dc9407 100644
--- a/sabnzbd/panic.py
+++ b/sabnzbd/panic.py
@@ -24,10 +24,7 @@ import logging
import tempfile
import ctypes
-try:
- import webbrowser
-except ImportError:
- webbrowser = None
+import subprocess
import sabnzbd
import sabnzbd.cfg as cfg
@@ -240,10 +237,7 @@ def launch_a_browser(url, force=False):
try:
if url and not url.startswith("http"):
url = "file:///%s" % url
- if webbrowser:
- webbrowser.open(url, 2, 1)
- else:
- logging.info("Not showing panic message in webbrowser, no support found")
+ subprocess.call(["termux-open-url", url])
except:
logging.warning(T("Cannot launch the browser, probably not found"))
logging.info("Traceback: ", exc_info=True)