Fixed source field sometimes showing up as broken HTML...

This commit is contained in:
Anna 2010-05-23 17:58:25 -04:00
parent d7893fce37
commit 9f239e8c37
4 changed files with 9 additions and 5 deletions

2
TODO
View File

@ -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

View File

@ -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)

View File

@ -410,8 +410,13 @@ class TweetBox(gtk.HBox):
# Set the header
if status.source is not None:
self.app_url = re.sub(r'.*<a href=\"(.*?)\".*', r'\1', status.source)
app_name = re.sub(r'.*<a.*?>(.*)</a>.*', r'\1', status.source)
source = status.source
if re.match(r'&lt;', source):
metalabel = gtk.Label()
metalabel.set_markup(status.source)
source = metalabel.get_text()
self.app_url = re.sub(r'.*<a href=\"(.*?)\".*', r'\1', source)
app_name = re.sub(r'.*<a.*?>(.*)</a>.*', r'\1', source)
self.app_button.set_label(app_name)
self.app_button.show()
self.via_label.show()

View File

@ -1,5 +1,5 @@
from threading import RLock
from urllib2 import URLError,urlopen
from urllib2 import HTTPError,URLError,urlopen
import gtk