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

@@ -647,3 +647,37 @@ index 339ae8a..d537963 100644
--
2.19.1
From 4e03cd18f7d7305f8c3adb4e308f68af1959d5db Mon Sep 17 00:00:00 2001
From: Philipp Wolfer <phil@parolu.io>
Date: Mon, 23 Sep 2019 09:53:39 +0200
Subject: [PATCH] webbrowser: Support for default browsers on Haiku
---
Lib/webbrowser.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index 1a553f0e65..074898b62d 100755
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -614,6 +614,16 @@ if sys.platform == 'darwin':
register("chrome", None, MacOSXOSAScript('chrome'), -1)
register("MacOSX", None, MacOSXOSAScript('default'), -1)
+#
+# Platform support for Haiku
+#
+
+if 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"))
+
# OK, now that we know what the default preference orders for each
# platform are, allow user to override them with the BROWSER variable.
--
2.23.0