From c50c42b895abd020b9ba6035c66f9c01b2eb8d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Sat, 2 May 2015 17:22:28 -0500 Subject: [PATCH] Updating some translation strings --- src/controller/buffersController.py | 1 + src/controller/mainController.py | 5 +++-- src/mysc/thread_utils.py | 8 ++++---- src/sessionmanager/session.py | 10 ++++++++-- src/wxUI/commonMessageDialogs.py | 2 +- src/wxUI/view.py | 2 +- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/controller/buffersController.py b/src/controller/buffersController.py index ac9b1458..c57bd064 100644 --- a/src/controller/buffersController.py +++ b/src/controller/buffersController.py @@ -483,6 +483,7 @@ class listBufferController(baseBufferController): super(listBufferController, self).start_stream() def get_user_ids(self): + print "getting user id's" self.users = [] next_cursor = -1 while(next_cursor): diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 35fcd088..f5a6564c 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -460,6 +460,9 @@ class Controller(object): older_list = utils.find_item(buff.session.db["lists"][dlg.get_item()]["id"], buff.session.db["lists"]) buff.session.db["lists"].pop(older_list) buff.session.db["lists"].append(list) + listBuffer = self.search_buffer("%s-list" % (buff.session.db["lists"][dlg.get_item()]["name"]), buff.session.db["user_name"]) + listBuffer.get_user_ids() + pub.sendMessage("restart-streams", streams=["timelinesStream"], session=buff.session) except TwythonError as e: output.speak("error %s: %s" % (e.error_code, e.msg)) @@ -470,7 +473,6 @@ class Controller(object): s = self.get_best_buffer().session l = listsController.listsController(s) - def configuration(self, *args, **kwargs): """ Opens the global settings dialogue.""" d = settings.globalSettingsController() @@ -495,7 +497,6 @@ class Controller(object): def report_error(self, *args, **kwargs): r = issueReporter.reportBug(self.get_best_buffer().session.db["user_name"]) - def check_for_updates(self, *args, **kwargs): update = updater.do_update() if update == False: diff --git a/src/mysc/thread_utils.py b/src/mysc/thread_utils.py index f400516b..cf343abc 100644 --- a/src/mysc/thread_utils.py +++ b/src/mysc/thread_utils.py @@ -24,10 +24,10 @@ def call_threaded(func, *args, **kwargs): def stream_threaded(func, *args, **kwargs): def new_func(*a, **k): - try: - func(**k) - except: - pub.sendMessage("streamError", session=a[0]) +# try: + func(**k) +# except: +# pub.sendMessage("streamError", session=a[0]) thread = threading.Thread(target=new_func, args=args, kwargs=kwargs) thread.daemon = True thread.start() diff --git a/src/sessionmanager/session.py b/src/sessionmanager/session.py index bf7a773e..dbff4433 100644 --- a/src/sessionmanager/session.py +++ b/src/sessionmanager/session.py @@ -296,8 +296,8 @@ class Session(object): def start_streaming(self): """ Start the streaming for sending tweets in realtime.""" - self.get_main_stream() self.get_timelines() + self.get_main_stream() def get_main_stream(self): log.debug("Starting the main stream...") @@ -317,7 +317,11 @@ class Session(object): stream_threaded(self.timelinesStream.statuses.filter, self.session_id, follow=ids) def add_friends(self): - self.timelinesStream.set_friends(self.main_stream.friends) + try: + self.timelinesStream.set_friends(self.main_stream.friends) + print "done" + except AttributeError: + pass def listen_stream_error(self): if hasattr(self, "main_stream"): @@ -344,6 +348,8 @@ class Session(object): if not hasattr(self, "timelinesStream"): self.get_timelines() self.reconnection_function_active = False + if hasattr(self, "timelinesStream") and not hasattr(self.timelinesStream, "friends"): + self.add_friends() try: urllib2.urlopen("http://74.125.228.231", timeout=5) except urllib2.URLError: diff --git a/src/wxUI/commonMessageDialogs.py b/src/wxUI/commonMessageDialogs.py index c74bf88e..3a415b5c 100644 --- a/src/wxUI/commonMessageDialogs.py +++ b/src/wxUI/commonMessageDialogs.py @@ -8,7 +8,7 @@ def delete_tweet_dialog(parent): return wx.MessageDialog(parent, _(u"Do you really want to delete this message? It will be eliminated from Twitter as well."), _(u"Delete"), wx.ICON_QUESTION|wx.YES_NO).ShowModal() def exit_dialog(parent): - dlg = wx.MessageDialog(parent, _(u"Do you really want to close " + application.name + "?"), _(u"Exit"), wx.YES_NO|wx.ICON_QUESTION) + dlg = wx.MessageDialog(parent, _(u"Do you really want to close {0}?").format(application.name,), _(u"Exit"), wx.YES_NO|wx.ICON_QUESTION) return dlg.ShowModal() def needs_restart(): diff --git a/src/wxUI/view.py b/src/wxUI/view.py index d2e45811..b4d0f4dc 100644 --- a/src/wxUI/view.py +++ b/src/wxUI/view.py @@ -188,4 +188,4 @@ class mainFrame(wx.Frame): getattr(self, menuitem).Check(check) def no_update_available(): - wx.MessageDialog(None, _(u"Your "+application.name+" version is up to date"), _(u"Update"), style=wx.OK).ShowModal() + wx.MessageDialog(None, _(u"Your {0} version is up to date").format(application.name,), _(u"Update"), style=wx.OK).ShowModal()