Made some bug fixes related to unassigned variables
This commit is contained in:
@ -285,9 +285,9 @@ class TweetBox(gtk.HBox):
|
||||
app_button_eb = gtk.EventBox()
|
||||
app_button_eb.add(self.app_button)
|
||||
|
||||
via_label = gtk.Label(' via ')
|
||||
self.via_label = gtk.Label(' via ')
|
||||
via_label_eb = gtk.EventBox()
|
||||
via_label_eb.add(via_label)
|
||||
via_label_eb.add(self.via_label)
|
||||
|
||||
self.header = gtk.Button()
|
||||
label_box = gtk.HBox()
|
||||
@ -307,7 +307,7 @@ class TweetBox(gtk.HBox):
|
||||
time_label_eb.modify_text(gtk.STATE_NORMAL,gtk.gdk.color_parse("#ffffff"))
|
||||
time_label_eb.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse("#8888ff"))
|
||||
|
||||
via_label.set_alignment(0.0, 0.5)
|
||||
self.via_label.set_alignment(0.0, 0.5)
|
||||
via_label_eb.modify_text(gtk.STATE_NORMAL,gtk.gdk.color_parse("#ffffff"))
|
||||
via_label_eb.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse("#8888ff"))
|
||||
|
||||
@ -402,9 +402,17 @@ class TweetBox(gtk.HBox):
|
||||
timestring = timestamp.astimezone(timezone).strftime(time_format)
|
||||
|
||||
# Set the header
|
||||
self.app_url = re.sub(r'.*<a href=\"(.*?)\".*', r'\1', status.source)
|
||||
app_name = re.sub(r'.*<a.*?>(.*)</a>.*', r'\1', status.source)
|
||||
self.app_button.set_label(app_name)
|
||||
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)
|
||||
self.app_button.set_label(app_name)
|
||||
self.app_button.show()
|
||||
self.via_label.show()
|
||||
else:
|
||||
self.app_button.hide()
|
||||
self.via_label.hide()
|
||||
self.app_url = ''
|
||||
|
||||
|
||||
if re.match('/', self.app_url):
|
||||
self.app_url = 'http://twitter.com' + self.app_url
|
||||
|
Reference in New Issue
Block a user