From 12faf53b631fdf3deecf51e25ac3f6a96ccd1985 Mon Sep 17 00:00:00 2001 From: Anna Date: Fri, 9 Apr 2010 22:03:21 -0400 Subject: [PATCH] First stab at implementing hyperlinks. Should work in gtk 2.18+, but can't test right now. --- mytwitter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mytwitter.py b/mytwitter.py index dc35644..c7aeed2 100755 --- a/mytwitter.py +++ b/mytwitter.py @@ -207,7 +207,10 @@ class TweetBox(gtk.VBox): self.header.set_markup(user.name + " (" + user.screen_name + ") " + timestring) # and the text - self.text.set_markup(status.text) + new_text = status.text + new_text = re.sub('& ', '& ', new_text) + link_text = re.sub(r"(http://.*?)( |$)", r'\1\2', new_text) + self.text.set_markup(new_text) def on_reply_clicked(self, widget):