Added support for Direct Messages view
This commit is contained in:
@ -68,12 +68,7 @@ class TweetPane(gtk.ScrolledWindow):
|
||||
self.show_all()
|
||||
|
||||
|
||||
def update_window(self, raw_statuses, using_results=False):
|
||||
if using_results:
|
||||
statuses = self.statuses_from_results(raw_statuses)
|
||||
else:
|
||||
statuses = raw_statuses
|
||||
|
||||
def update_window(self, statuses):
|
||||
if self.updated_once is False:
|
||||
self.updated_once = True
|
||||
|
||||
@ -160,30 +155,6 @@ class TweetPane(gtk.ScrolledWindow):
|
||||
def get_is_user(self):
|
||||
return self.is_user
|
||||
|
||||
# To keep things simple elsewhere and improve code reuse
|
||||
# we'll build a list of home-cooked Status objects out of results.
|
||||
# Why is this even necessary?
|
||||
# Why can't we have more consistency out of the Twitter API?
|
||||
def statuses_from_results(self, results):
|
||||
statuses = []
|
||||
for result in results.results:
|
||||
status = Status()
|
||||
status.id = result.id
|
||||
status.user = User()
|
||||
status.user.screen_name = result.from_user
|
||||
status.user.name = ""
|
||||
status.in_reply_to_screen_name = result.to_user
|
||||
# The Twitter Search API has different timestamps than the
|
||||
# REST API... balls
|
||||
# fixme:
|
||||
# Gotta be a cleaner way to do this, but I can't think of it
|
||||
# right now
|
||||
created_at = re.sub(',', '', result.created_at)
|
||||
created_split = re.split(' ', created_at)
|
||||
status.created_at = created_split[0] + ' ' + created_split[2] + ' ' + created_split[1] + ' ' + created_split[4] + ' ' + created_split[5] + ' ' + created_split[3]
|
||||
status.text = result.text
|
||||
statuses.append(status)
|
||||
return statuses
|
||||
|
||||
### end class TweetPane
|
||||
|
||||
@ -445,18 +416,3 @@ gobject.signal_new("close-clicked", CloseTabLabel,
|
||||
gobject.signal_new("label-clicked", CloseTabLabel,
|
||||
gobject.SIGNAL_RUN_LAST,
|
||||
gobject.TYPE_NONE, ())
|
||||
|
||||
|
||||
|
||||
class Status():
|
||||
def __init__(self):
|
||||
self.user = User()
|
||||
self.id = None
|
||||
self.created_at = None
|
||||
self.in_reply_to_screen_name = None
|
||||
self.in_reply_to_status_id = None
|
||||
|
||||
class User():
|
||||
def __init__(self):
|
||||
self.screen_name = None
|
||||
self.name = None
|
||||
|
Reference in New Issue
Block a user