Post tweets and translate is possible in the next-gen

This commit is contained in:
2014-11-12 22:37:52 -06:00
parent f54d9394b7
commit 606ab6d6fc
11 changed files with 47 additions and 507 deletions

View File

@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from wxUI import (view, dialogs)
import buffersController
import messages
from sessionmanager import session
from pubsub import pub
import sound
@@ -217,8 +218,12 @@ class Controller(object):
def action(self, do_action):
pass
def post_tweet(self):
pass
def post_tweet(self, event=None):
buffer = self.get_best_buffer()
tweet = messages.tweet(buffer.session)
if tweet.message.get_response() == widgetUtils.OK:
text = tweet.message.get_text()
call_threaded(buffer.session.api_call, call_name="update_status", _sound="tweet_send.ogg", status=text)
def post_reply(self):
pass
@@ -337,7 +342,7 @@ class Controller(object):
buffer.remove_item(item)
def manage_item_in_timeline(self, data, user, who):
buffer = self.search_buffer("%i-timeline" % (who,), user)
buffer = self.search_buffer("%s-timeline" % (who,), user)
play_sound = "tweet_timeline.ogg"
buffer.add_new_item(data)
self.notify(play_sound=play_sound)