summaryrefslogtreecommitdiffstats
path: root/net-print/hplip/files/hplip-3.9.10-browser.patch
blob: 46c4f634f36d865f79336d6a5029e30fa77fb63f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--- base/utils.py.old	2009-11-14 15:23:29.000000000 +0100
+++ base/utils.py	2009-11-14 15:37:53.000000000 +0100
@@ -812,13 +812,15 @@
     return True
 
 
-BROWSERS = ['firefox', 'mozilla', 'konqueror', 'galeon', 'skipstone'] # in preferred order
-BROWSER_OPTS = {'firefox': '-new-window', 'mozilla' : '', 'konqueror': '', 'galeon': '-w', 'skipstone': ''}
+BROWSERS = ['firefox', 'mozilla', 'konqueror', 'epiphany', 'skipstone'] # in preferred order
+BROWSER_OPTS = {'firefox': '-new-tab', 'mozilla': '', 'konqueror': '', 'epiphany': '--new-tab', 'skipstone': ''}
 
 
 def find_browser():
     if platform_avail and platform.system() == 'Darwin':
         return "open"
+    if platform_avail and platform.system() == 'Linux' and which("xdg-open"):
+        return "xdg-open"
     else:
         for b in BROWSERS:
             if which(b):
@@ -832,11 +834,14 @@
         cmd = 'open "%s"' % url
         log.debug(cmd)
         os.system(cmd)
+    if platform_avail and platform.system() == 'Linux' and which("xdg-open"):
+        cmd = 'xdg-open "%s"' % url
+        log.debug(cmd)
+        os.system(cmd)
     else:
         for b in BROWSERS:
-            bb = which(b)
-            if bb:
-                bb = os.path.join(bb, b)
+            if b:
+                bb = which(b, return_full_path='True')
                 if use_browser_opts:
                     cmd = """%s %s "%s" &""" % (bb, BROWSER_OPTS[b], url)
                 else: