Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

about: improve portability of browse_url

Changeset 094b552e094c

Parent 2e8f70e45445

by Steve Borho

Changes to one file · Browse files at 094b552e094c Showing diff from parent 2e8f70e45445 Diff from another changeset...

 
22
23
24
 
 
 
 
25
26
27
28
29
30
 
 
 
 
 
 
 
 
 
31
32
33
 
22
23
24
25
26
27
28
29
 
 
 
 
 
30
31
32
33
34
35
36
37
38
39
40
41
@@ -22,12 +22,20 @@
  import win32api, win32con   win32api.ShellExecute(0, "open", url, None, "",   win32con.SW_SHOW) + elif sys.platform == 'darwin': + # use Mac OS X internet config module (removed in Python 3.0) + import ic + ic.launchurl(url)   else: - import gconf - client = gconf.client_get_default() - browser = client.get_string( - '/desktop/gnome/url-handlers/http/command') + '&' - os.system(browser % url) + try: + import gconf + client = gconf.client_get_default() + browser = client.get_string( + '/desktop/gnome/url-handlers/http/command') + '&' + os.system(browser % url) + except ImportError: + # If gconf is not found, fall back to old standard + os.system('firefox ' + url)   threading.Thread(target=start_browser).start()    def url_handler(dialog, link, user_data):