From 9f239e8c378e58362dec7cf3552122812a9a7609 Mon Sep 17 00:00:00 2001 From: Anna Date: Sun, 23 May 2010 17:58:25 -0400 Subject: [PATCH] Fixed source field sometimes showing up as broken HTML... --- TODO | 2 -- apithreads.py | 1 + twitterwidgets.py | 9 +++++++-- usercache.py | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/TODO b/TODO index f95ec3c..cce9e71 100644 --- a/TODO +++ b/TODO @@ -15,8 +15,6 @@ features: bugs: -* Searches and Direct Messages have no names, only screen names (may not be fixable without considerable tweaks to python-twitter?) -* Search results have html-escaped character strings * "ValueError: list.remove(x): x not in list" when trying to close a tab (error recurred after adding conversation support). Tabs can be reordered, then closed, as a workaround. * Links must be right-clicked on to activate - can't left-click on the link directly. This seems to be a pygtk issue * If an @ appears anywhere in a status update, links after it try to resolve to user: links... need to work on my regexes diff --git a/apithreads.py b/apithreads.py index 0ea9c78..9e640c4 100644 --- a/apithreads.py +++ b/apithreads.py @@ -270,6 +270,7 @@ class GetUserLists(ApiThread): lists = self.api.GetUserLists() except (HTTPError, URLError) as exception: print 'debug: GetUserLists had error: ' + str(exception.code) + sleep(5) done = False self.sig_proxy.emit('lists-ready', lists, None) diff --git a/twitterwidgets.py b/twitterwidgets.py index d1d1c1b..f571303 100644 --- a/twitterwidgets.py +++ b/twitterwidgets.py @@ -410,8 +410,13 @@ class TweetBox(gtk.HBox): # Set the header if status.source is not None: - self.app_url = re.sub(r'.*(.*).*', r'\1', status.source) + source = status.source + if re.match(r'<', source): + metalabel = gtk.Label() + metalabel.set_markup(status.source) + source = metalabel.get_text() + self.app_url = re.sub(r'.*(.*).*', r'\1', source) self.app_button.set_label(app_name) self.app_button.show() self.via_label.show() diff --git a/usercache.py b/usercache.py index 2b436de..8761242 100644 --- a/usercache.py +++ b/usercache.py @@ -1,5 +1,5 @@ from threading import RLock -from urllib2 import URLError,urlopen +from urllib2 import HTTPError,URLError,urlopen import gtk