Add some debugging to the URL opening code
This commit is contained in:
parent
8a8a183a75
commit
c20ae50ce0
|
@ -61,21 +61,27 @@ else:
|
||||||
# import a library for viewing URLs
|
# import a library for viewing URLs
|
||||||
try:
|
try:
|
||||||
# gnome.url_show() is really useful
|
# gnome.url_show() is really useful
|
||||||
|
dbg ('url_show: importing gnome module')
|
||||||
import gnome
|
import gnome
|
||||||
url_show = gnome.url_show
|
url_show = gnome.url_show
|
||||||
except:
|
except:
|
||||||
# webbrowser.open() is not really useful, but will do as a fallback
|
# webbrowser.open() is not really useful, but will do as a fallback
|
||||||
|
dbg ('url_show: gnome module failed, using webbrowser')
|
||||||
import webbrowser
|
import webbrowser
|
||||||
url_show = webbrowser.open
|
url_show = webbrowser.open
|
||||||
|
|
||||||
def openurl (url):
|
def openurl (url):
|
||||||
|
dbg ('openurl: viewing %s'%url)
|
||||||
try:
|
try:
|
||||||
if subprocess.call(["xdg-open", url]) != 0:
|
if subprocess.call(["xdg-open", url]) != 0:
|
||||||
|
dbg ('openurl: xdg-open failed')
|
||||||
raise
|
raise
|
||||||
except:
|
except:
|
||||||
try:
|
try:
|
||||||
|
dbg ('openurl: calling url_show')
|
||||||
url_show (url)
|
url_show (url)
|
||||||
except:
|
except:
|
||||||
|
dbg ('openurl: url_show failed. No URL for you')
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class TerminatorTerm (gtk.VBox):
|
class TerminatorTerm (gtk.VBox):
|
||||||
|
|
Loading…
Reference in New Issue