diff --git a/src/application.py b/src/application.py index bd10dac8..d9569b3b 100644 --- a/src/application.py +++ b/src/application.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- name = 'TW Blue' -snapshot = True +snapshot = False if snapshot == False: - version = "0.48" + version = "0.50" update_url = 'http://twblue.com.mx/updates/tw_blue.json' else: version = "6" diff --git a/src/extra/autocompletionUsers/settings.py b/src/extra/autocompletionUsers/settings.py index 4d57ed6e..799ae129 100644 --- a/src/extra/autocompletionUsers/settings.py +++ b/src/extra/autocompletionUsers/settings.py @@ -44,13 +44,13 @@ class autocompletionSettings(object): def execute_at_startup(window): database = storage.storage() - if config.main["mysc"]["save_followers_in_autocompletion_db"] == True: + if config.main["mysc"]["save_followers_in_autocompletion_db"] == True and config.main["other_buffers"]["show_followers"] == True: buffer = window.search_buffer("people", "followers") for i in buffer.db.settings[buffer.name_buffer]: database.set_user(i["screen_name"], i["name"], 1) else: database.remove_by_buffer(1) - if config.main["mysc"]["save_friends_in_autocompletion_db"] == True: + if config.main["mysc"]["save_friends_in_autocompletion_db"] == True and config.main["other_buffers"]["show_friends"] == True: buffer = window.search_buffer("people", "friends") for i in buffer.db.settings[buffer.name_buffer]: database.set_user(i["screen_name"], i["name"], 2) diff --git a/src/gui/dialogs/lists.py b/src/gui/dialogs/lists.py index 0b3e3e94..c09c04ff 100644 --- a/src/gui/dialogs/lists.py +++ b/src/gui/dialogs/lists.py @@ -127,7 +127,7 @@ class listViewer(wx.Dialog): output.speak(_(u"This list is arready opened.")) return listUI = gui.buffers.lists.listPanel(self.nb, self.parent, list_updated["slug"]+"-list", argumento=utils.find_list(list_updated["slug"], self.db.settings["lists"])) - self.nb.AddPage(listUI, _(u"List for %s") % (list_updated["slug"],)) + self.nb.InsertSubPage(self.db.settings["buffers"].index("lists"), listUI, _(u"List for %s") % (list_updated["slug"],)) self.db.settings["buffers"].append(list_updated["slug"]+"-list") num = listUI.start_streams() listUI.put_items(num) diff --git a/src/gui/main.py b/src/gui/main.py index c9747f3b..fab13da1 100644 --- a/src/gui/main.py +++ b/src/gui/main.py @@ -339,6 +339,7 @@ class mainFrame(wx.Frame): self.Bind(event.MyEVT_STARTED, self.onInit) self.Bind(event.EVT_RESULT, self.onMemberAdded) pub.subscribe(self.listen_streamerror, "streamError") + pub.subscribe(self.listen_for_friends, "friendsReceived") call_threaded(self.init, run_streams=True) def init(self, run_streams=False): @@ -1072,12 +1073,15 @@ class mainFrame(wx.Frame): def listen_streamerror(self): log.error("There is a connection error") - print "Connection error" - self.stream.disconnect() + if hasattr(self, "stream"): + self.stream.disconnect() + del self.stream if hasattr(self, "stream2"): self.stream2.disconnect() del self.stream2 - del self.stream + + def listen_for_friends(self): + self.stream2.set_friends(self.stream.friends) ### Close App def Destroy(self): diff --git a/src/twitter/buffers/indibidual.py b/src/twitter/buffers/indibidual.py index 80868b0e..435fec53 100644 --- a/src/twitter/buffers/indibidual.py +++ b/src/twitter/buffers/indibidual.py @@ -42,11 +42,12 @@ class streamer(TwythonStreamer): except ValueError: pass + def set_friends(self, friends): + self.friends = friends + def on_success(self, data): try: if data.has_key("text") and utils.is_allowed(data): self.check_tls(data) - elif "friends" in data: - self.friends = data["friends"] except: pass \ No newline at end of file diff --git a/src/twitter/buffers/stream.py b/src/twitter/buffers/stream.py index e6f3dd67..3dc8664c 100644 --- a/src/twitter/buffers/stream.py +++ b/src/twitter/buffers/stream.py @@ -8,6 +8,7 @@ import config import logging as original_logger log = original_logger.getLogger("MainStream") import output +from wx.lib.pubsub import pub class streamer(TwythonStreamer): def __init__(self, app_key, app_secret, oauth_token, oauth_token_secret, timeout=300, retry_count=None, retry_in=10, client_args=None, handlers=None, chunk_size=1, parent=None): @@ -105,6 +106,7 @@ class streamer(TwythonStreamer): self.process_dm(data) elif "friends" in data: self.friends = data["friends"] + pub.sendMessage("friendsReceived") elif "text" in data and utils.is_allowed(data) == True: if data["user"]["id"] in self.muted_users: return self.check_mentions(data)