openurl is no longer global; add some self.'s to make it work.
This commit is contained in:
parent
b200044391
commit
cc73d436ca
|
@ -72,12 +72,12 @@ class TerminatorTerm (gtk.VBox):
|
||||||
# gnome.url_show() is really useful
|
# gnome.url_show() is really useful
|
||||||
dbg ('url_show: importing gnome module')
|
dbg ('url_show: importing gnome module')
|
||||||
import gnome
|
import gnome
|
||||||
url_show = gnome.url_show
|
self.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')
|
dbg ('url_show: gnome module failed, using webbrowser')
|
||||||
import webbrowser
|
import webbrowser
|
||||||
url_show = webbrowser.open
|
self.url_show = webbrowser.open
|
||||||
|
|
||||||
self.cwd = cwd or os.getcwd();
|
self.cwd = cwd or os.getcwd();
|
||||||
if not os.path.exists(self.cwd) or not os.path.isdir(self.cwd):
|
if not os.path.exists(self.cwd) or not os.path.isdir(self.cwd):
|
||||||
|
@ -168,7 +168,7 @@ class TerminatorTerm (gtk.VBox):
|
||||||
os.putenv ('COLORTERM', 'gnome-terminal')
|
os.putenv ('COLORTERM', 'gnome-terminal')
|
||||||
dbg ('SEGBUG: TerminatorTerm __init__ complete')
|
dbg ('SEGBUG: TerminatorTerm __init__ complete')
|
||||||
|
|
||||||
def openurl (url):
|
def openurl (self, url):
|
||||||
dbg ('openurl: viewing %s'%url)
|
dbg ('openurl: viewing %s'%url)
|
||||||
try:
|
try:
|
||||||
if subprocess.call(["xdg-open", url]) != 0:
|
if subprocess.call(["xdg-open", url]) != 0:
|
||||||
|
@ -177,7 +177,7 @@ class TerminatorTerm (gtk.VBox):
|
||||||
except:
|
except:
|
||||||
try:
|
try:
|
||||||
dbg ('openurl: calling url_show')
|
dbg ('openurl: calling url_show')
|
||||||
url_show (url)
|
self.url_show (url)
|
||||||
except:
|
except:
|
||||||
dbg ('openurl: url_show failed. No URL for you')
|
dbg ('openurl: url_show failed. No URL for you')
|
||||||
pass
|
pass
|
||||||
|
@ -553,7 +553,7 @@ text/plain
|
||||||
address = "mailto:" + url[0]
|
address = "mailto:" + url[0]
|
||||||
else:
|
else:
|
||||||
address = url[0]
|
address = url[0]
|
||||||
openurl ( address )
|
self.openurl ( address )
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Left mouse button should transfer focus to this vte widget
|
# Left mouse button should transfer focus to this vte widget
|
||||||
|
@ -735,7 +735,7 @@ text/plain
|
||||||
|
|
||||||
item = gtk.MenuItem (nameopen)
|
item = gtk.MenuItem (nameopen)
|
||||||
|
|
||||||
item.connect ("activate", lambda menu_item: openurl (address))
|
item.connect ("activate", lambda menu_item: self.openurl (address))
|
||||||
menu.append (item)
|
menu.append (item)
|
||||||
|
|
||||||
item = gtk.MenuItem (namecopy)
|
item = gtk.MenuItem (namecopy)
|
||||||
|
|
Loading…
Reference in New Issue