[Pkg-bazaar-commits] ./bzr-gtk/unstable r505: make browser opening code work with python 2.4

Sabin Iacob (m0n5t3r) iacobs at m0n5t3r.info
Fri Apr 10 07:44:42 UTC 2009


------------------------------------------------------------
revno: 505
committer: Sabin Iacob (m0n5t3r) <iacobs at m0n5t3r.info>
branch nick: bzr-gtk
timestamp: Tue 2008-06-24 13:34:38 +0300
message:
  make browser opening code work with python 2.4
modified:
  revisionview.py
    ------------------------------------------------------------
    revno: 498.2.1
    committer: Sabin Iacob (m0n5t3r) <iacobs at m0n5t3r.info>
    branch nick: bzr-gtk.browser-select
    timestamp: Wed 2008-06-04 10:47:15 +0300
    message:
      fix the browser opening code to work with python 2.4
    modified:
      revisionview.py
    ------------------------------------------------------------
    revno: 498.2.2
    committer: Sabin Iacob (m0n5t3r) <iacobs at m0n5t3r.info>
    branch nick: bzr-gtk.browser-select
    timestamp: Wed 2008-06-04 11:08:45 +0300
    message:
      avoid using webbrowser.register
    modified:
      revisionview.py
    ------------------------------------------------------------
    revno: 498.2.3
    committer: Sabin Iacob (m0n5t3r) <iacobs at m0n5t3r.info>
    branch nick: bzr-gtk.browser-select
    timestamp: Wed 2008-06-04 13:19:50 +0300
    message:
      fix typo, it actually works now
    modified:
      revisionview.py
-------------- next part --------------
=== modified file 'revisionview.py'
--- a/revisionview.py	2008-06-04 20:36:54 +0000
+++ b/revisionview.py	2008-06-24 10:34:38 +0000
@@ -38,10 +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):
+    for cmd in ['sensible-browser', 'xdg-open']:
+        if webbrowser._iscommand(cmd):
+            webbrowser._tryorder.insert(0, '%s "%%s"' % cmd)
     webbrowser.open(uri)
 
 gtk.link_button_set_uri_hook(_open_link)



More information about the Pkg-bazaar-commits mailing list