diff --git a/twitterwidgets.py b/twitterwidgets.py index 8e6bd11..0549aae 100644 --- a/twitterwidgets.py +++ b/twitterwidgets.py @@ -402,14 +402,14 @@ class TweetBox(gtk.HBox): timestring = timestamp.astimezone(timezone).strftime(time_format) # Set the header - self.app_url = re.sub(r'.*(.*).*', r'\1', status.source) self.app_button.set_label(app_name) - if self.app_url: - self.app_button.set_sensitive(True) - else: - self.app_button.set_sensitive(False) + if re.match('/', self.app_url): + self.app_url = 'http://twitter.com' + self.app_url + elif re.match('web', self.app_url): + self.app_url = None self.time_label.set_label(timestring) @@ -418,7 +418,6 @@ class TweetBox(gtk.HBox): else: self.user_button.set_label(user.name + " (" + user.screen_name + ") ") - # and the text new_text = status.text new_text = re.sub(r'&([^;]*?)( |$)', r'&\1\2', new_text) @@ -491,9 +490,8 @@ class TweetBox(gtk.HBox): def on_app_button_clicked(self, widget): self.set_read() - print 'debug: on_app_button_clicked(): ' + self.app_url - # if self.app_url: - # webbrowser.open(self.app_url) + if self.app_url: + webbrowser.open(self.app_url) def on_mouse_clicked(self, widget, event):