Initial commit of 'conversation' button... needs a lot of work still
This commit is contained in:
parent
0ead5932a5
commit
3357249d28
3 changed files with 82 additions and 4 deletions
18
mytwitter.py
18
mytwitter.py
|
@ -238,6 +238,10 @@ class MyTwitter():
|
|||
self.add_to_notebook(data['name'], data['id'])
|
||||
|
||||
|
||||
def on_conversation(self, widget, data):
|
||||
self.add_to_notebook(data['name'], data['id'], True)
|
||||
|
||||
|
||||
def on_view_selected(self, event, username, name):
|
||||
if name == 'Home' or name == 'Direct Messages':
|
||||
full_name = username + '/' + name
|
||||
|
@ -269,7 +273,7 @@ class MyTwitter():
|
|||
self.remove_view(name, single_tweet)
|
||||
|
||||
|
||||
def add_to_notebook(self, name, single_tweet=None):
|
||||
def add_to_notebook(self, name, single_tweet=None, conversation=False):
|
||||
# If it already exists, don't add it, just switch to it
|
||||
for i in range(self.tweet_notebook.get_n_pages()):
|
||||
pane = self.tweet_notebook.get_nth_page(i)
|
||||
|
@ -305,15 +309,21 @@ class MyTwitter():
|
|||
new_pane.connect('tweet-reply', self.on_reply)
|
||||
new_pane.connect('tweet-retweet', self.on_retweet)
|
||||
new_pane.connect('tweet-in-reply-to', self.on_reply_to)
|
||||
new_pane.connect('tweet-conversation', self.on_conversation)
|
||||
new_pane.connect('show-user', self.show_user_callback)
|
||||
new_pane.connect('following-set', self.update_follow_button)
|
||||
new_pane.connect('verified-set', self.update_verified_label)
|
||||
|
||||
# Special logic for single tweet pane
|
||||
if single_tweet is not None:
|
||||
apithreads.GetSingleTweet(api=self.api,
|
||||
pane=new_pane,
|
||||
single_tweet=single_tweet).start()
|
||||
if conversation:
|
||||
apithreads.GetConversation(api=self.api,
|
||||
pane=new_pane,
|
||||
root_tweet_id=single_tweet).start()
|
||||
else:
|
||||
apithreads.GetSingleTweet(api=self.api,
|
||||
pane=new_pane,
|
||||
single_tweet=single_tweet).start()
|
||||
else:
|
||||
self.update_single_window(new_pane)
|
||||
|
||||
|
|
Reference in a new issue