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

@@ -1152,3 +1152,37 @@ index 6d4b3b3..8c42fb8 100644
--
2.21.0
From 21502a9c6059d24d14924f518667f800764f5e42 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 15eeb660e2..d73749d696 100755
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -644,6 +644,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"))
+
#
# Platform support for OS/2
--
2.23.0