Fixed the gtk version checks
This commit is contained in:
parent
7c06ad8c40
commit
8fc21161b3
|
@ -202,7 +202,7 @@ class TweetBox(gtk.VBox):
|
||||||
self.text.set_alignment(0.0, 0.0)
|
self.text.set_alignment(0.0, 0.0)
|
||||||
self.text.set_selectable(True)
|
self.text.set_selectable(True)
|
||||||
self.text.set_line_wrap(True)
|
self.text.set_line_wrap(True)
|
||||||
if gtk.pygtk_version[0] > 2 or (gtk.pygtk_version[0] == 2 and gtk.pygtk_version[1] >= 18):
|
if gtk.gtk_version[0] > 2 or (gtk.gtk_version[0] == 2 and gtk.gtk_version[1] >= 18):
|
||||||
self.text.connect('activate-link', self.on_url_clicked)
|
self.text.connect('activate-link', self.on_url_clicked)
|
||||||
|
|
||||||
button_box = gtk.HBox()
|
button_box = gtk.HBox()
|
||||||
|
@ -238,7 +238,7 @@ class TweetBox(gtk.VBox):
|
||||||
# and the text
|
# and the text
|
||||||
new_text = status.text
|
new_text = status.text
|
||||||
new_text = re.sub(r'&([^;]*?)( |$)', r'&\1\2', new_text)
|
new_text = re.sub(r'&([^;]*?)( |$)', r'&\1\2', new_text)
|
||||||
if gtk.pygtk_version[0] > 2 or (gtk.pygtk_version[0] == 2 and gtk.pygtk_version[1] >= 18):
|
if gtk.gtk_version[0] > 2 or (gtk.gtk_version[0] == 2 and gtk.gtk_version[1] >= 18):
|
||||||
new_text = re.sub(r"(http://.*?)( |$)", r'<a href="\1">\1</a>\2', new_text)
|
new_text = re.sub(r"(http://.*?)( |$)", r'<a href="\1">\1</a>\2', new_text)
|
||||||
self.text.set_markup(new_text)
|
self.text.set_markup(new_text)
|
||||||
|
|
||||||
|
@ -261,7 +261,8 @@ class TweetBox(gtk.VBox):
|
||||||
def on_url_clicked(self, widget):
|
def on_url_clicked(self, widget):
|
||||||
# fixme: for now, hard code firefox, since that's what I use
|
# fixme: for now, hard code firefox, since that's what I use
|
||||||
# Eventually make this configgable
|
# Eventually make this configgable
|
||||||
subprocess.call('firefox ' + self.text.get_current_uri())
|
print 'debug: on_url_clicked()'
|
||||||
|
subprocess.Popen('/usr/bin/firefox ' + self.text.get_current_uri(), shell=False).pid
|
||||||
|
|
||||||
# end class TweetBox
|
# end class TweetBox
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user