python: patched webbrowser module for Haiku (#4199)

This commit is contained in:
Philipp Wolfer
2019-09-26 18:01:23 +02:00
committed by Jérôme Duval
parent 76596f6c9c
commit e3fdb45984
6 changed files with 100 additions and 3 deletions

View File

@@ -696,3 +696,32 @@ index 97973bc..b2e4095 100644
--
2.21.0
From f55317a2a10d85c3240225d3c22f76e155cbe911 Mon Sep 17 00:00:00 2001
From: Philipp Wolfer <phil@parolu.io>
Date: Mon, 23 Sep 2019 09:14:58 +0200
Subject: [PATCH] webbrowser: Support for default browsers on Haiku
---
Lib/webbrowser.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index 0af36c4301..0a39655ab9 100755
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -527,6 +527,11 @@ def register_standard_browsers():
"netscape", "opera", iexplore):
if shutil.which(browser):
register(browser, None, BackgroundBrowser(browser))
+ elif sys.platform[:5] == "haiku":
+ # First try to use the default configured browser
+ register("haiku-default", None, GenericBrowser("open"))
+ # Fall back to WebPositive as the standard browser of Haiku
+ register("webpositive", None, BackgroundBrowser("WebPositive"))
else:
# Prefer X browsers if present
if os.environ.get("DISPLAY"):
--
2.23.0