[Pkg-bazaar-commits] ./bzr-gtk/unstable r497: Make default browser detection portable

Martin Albisetti argentina at gmail.com
Fri Apr 10 07:44:43 UTC 2009


------------------------------------------------------------
revno: 497
committer: Martin Albisetti <argentina at gmail.com>
branch nick: gtk.patches
timestamp: Mon 2008-06-02 22:41:15 -0300
message:
  Make default browser detection portable
modified:
  revisionview.py
    ------------------------------------------------------------
    revno: 496.1.1
    committer: Sabin Iacob (m0n5t3r) <iacobs at m0n5t3r.info>
    branch nick: bzr-gtk.browser-select
    timestamp: Mon 2008-05-26 20:44:25 +0300
    message:
      use webbrowser.open instead of the debian-specific sensible-browser
    modified:
      revisionview.py
    ------------------------------------------------------------
    revno: 496.1.2
    committer: Sabin Iacob (m0n5t3r) <iacobs at m0n5t3r.info>
    branch nick: bzr-gtk.browser-select
    timestamp: Tue 2008-05-27 00:10:10 +0300
    message:
      also try xdg-open and sensible-browser
    modified:
      revisionview.py
-------------- next part --------------
=== modified file 'revisionview.py'
--- a/revisionview.py	2008-05-04 18:28:46 +0000
+++ b/revisionview.py	2008-05-26 21:10:10 +0000
@@ -20,7 +20,7 @@
 import gtk
 import pango
 import gobject
-import subprocess
+import webbrowser
 
 from bzrlib.plugins.gtk import icon_path
 from bzrlib.osutils import format_date
@@ -38,8 +38,11 @@
 PAGE_SIGNATURE = 2
 PAGE_BUGS = 3
 
+webbrowser.register('sensible-browser', None, webbrowser.GenericBrowser('sensible-browser'), -1)
+webbrowser.register('xdg-open', None, webbrowser.GenericBrowser('xdg-open'), -1)
+
 def _open_link(widget, uri):
-    subprocess.Popen(['sensible-browser', uri], close_fds=True)
+    webbrowser.open(uri)
 
 gtk.link_button_set_uri_hook(_open_link)
 



More information about the Pkg-bazaar-commits mailing list