Added some logic to TweetPane to track whether the pane is displaying a user's feed, and if so whether we are currently following that user.
This commit is contained in:
10
mytwitter.py
10
mytwitter.py
@ -179,10 +179,14 @@ class MyTwitter():
|
||||
return
|
||||
|
||||
|
||||
# This code modified from create_custom_tab in:
|
||||
# http://www.daa.com.au/pipermail/pygtk/2006-April/012216.html
|
||||
def add_to_notebook(self, name, single_tweet=None):
|
||||
new_pane = TweetPane(name, self.num_entries, single_tweet)
|
||||
is_user = False
|
||||
following = False
|
||||
if re.match('user:', name):
|
||||
is_user = True
|
||||
relationship = self.api.ShowFriendships(source_screen_name=self.username, target_screen_name=re.sub('user: ', '', name))
|
||||
following = relationship.target.following
|
||||
new_pane = TweetPane(name, num_entries=self.num_entries, single_tweet=single_tweet, is_user=is_user, following=following)
|
||||
self.tweet_notebook.append_page(new_pane, new_pane.get_tab_label())
|
||||
new_pane.get_tab_label().connect('close-clicked', self.remove_view, name)
|
||||
new_pane.connect('tweet-reply', self.on_reply)
|
||||
|
Reference in New Issue
Block a user