Skip to content

Commit

Permalink
Timelines should be updated properly; changes for the 0.48 version
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelcortez committed Nov 9, 2014
1 parent d2c89a1 commit 1a2f834
Show file tree
Hide file tree
Showing 11 changed files with 806 additions and 870 deletions.
2 changes: 0 additions & 2 deletions src/Conf.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ max_tweets_per_call = integer(default=100)
reverse_timelines = boolean(default=False)
time_to_check_streams = integer(default=30)
announce_stream_status = boolean(default=True)
auto_connect_streams = boolean(default=True)
ask_at_exit = boolean(default=True)

[sound]
Expand Down Expand Up @@ -87,4 +86,3 @@ search = string(default="control+win+-")
edit_keystrokes = string(default="control+win+k")
view_user_lists = string(default="control+win+l")
get_more_items = string(default="alt+win+pageup")
connect_streams = string(default="win+alt+s")
4 changes: 2 additions & 2 deletions src/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = 'TW Blue'
snapshot = False
if snapshot == False:
version = "0.47"
version = "0.48"
update_url = 'http://twblue.com.mx/updates/tw_blue.json'
else:
version = "4"
Expand All @@ -13,7 +13,7 @@
description = u"TW Blue is an app designed to use Twitter in a simple and fast way and avoiding, as far as possible, the consumtion of excessive resources of the machine where it’s running. With this app you’ll have access to most twitter features."
translators = [u"Bryner Villalobos (English)", u"Mohammed Al Shara (Arabic)", u"Salva Doménech, Juan Carlos Rivilla(Catalan)", u"Manuel cortéz(Spanish)", u"Sukil Etxenike Arizaleta(Basque)", u"Jani Kinnunen(finnish)", u"Javier Currás, José Manuel Delicado, Alba Quinteiro(Galician)", u"Robert Osztolykan(Hungarian)", u"Paweł Masarczyk(Polish)", u"Odenilton Júnior Santos(Portuguese)", u"Alexander Jaszyn(Russian)", u"Burak (Turkish)"]
url = u"http://twblue.com.mx"
report_bugs_url = "http://twblue.com.mx/errores/api/soap/mantisconnect.php?wsdl"
#report_bugs_url = "http://twblue.com.mx/errores/api/soap/mantisconnect.php?wsdl"

# Tokens
app_key = '8pDLbyOW3saYnvSZ4uLFg'
Expand Down
2 changes: 1 addition & 1 deletion src/gui/dialogs/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, parent):
langBox.Add(language, 0, wx.ALL, 5)
langBox.Add(self.language, 0, wx.ALL, 5)
sizer.Add(langBox, 0, wx.ALL, 5)
self.ask_at_exit = wx.CheckBox(self, -1, _(U"Ask to exit TWBlue"))
self.ask_at_exit = wx.CheckBox(self, -1, _(U"ask before exiting TwBlue?"))
self.ask_at_exit.SetValue(config.main["general"]["ask_at_exit"])
sizer.Add(self.ask_at_exit, 0, wx.ALL, 5)
self.relative_time = wx.CheckBox(self, -1, _(U"Relative times"))
Expand Down
60 changes: 26 additions & 34 deletions src/gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ def makeMenus(self):

# buffer menu
buffer = wx.Menu()
load_more_items = buffer.Append(wx.NewId(), _(u"Load more items"))
self.Bind(wx.EVT_MENU, self.get_more_items, load_more_items)
load_previous_items = buffer.Append(wx.NewId(), _(u"&Load previous items"))
self.Bind(wx.EVT_MENU, self.get_more_items, load_previous_items)
mute = buffer.Append(wx.NewId(), _(u"&Mute"))
self.Bind(wx.EVT_MENU, self.toggle_mute, mute)
autoread = buffer.Append(wx.NewId(), _(u"&Autoread tweets for this buffer"))
Expand Down Expand Up @@ -343,9 +343,8 @@ def init(self, run_streams=False):
if run_streams == True:
self.get_home()
self.get_tls()
if config.main["general"]["auto_connect_streams"] == True:
self.check_streams = RepeatingTimer(config.main["general"]["time_to_check_streams"], self.check_stream_up)
self.check_streams.start()
self.check_streams = RepeatingTimer(config.main["general"]["time_to_check_streams"], self.check_stream_up)
self.check_streams.start()
# If all it's done, then play a nice sound saying that all it's OK.
sound.player.play("ready.ogg")

Expand Down Expand Up @@ -394,24 +393,24 @@ def start_lists(self):

def get_tls(self):
""" Setting the stream for individual user timelines."""
try:
self.stream2 = twitter.buffers.indibidual.streamer(application.app_key, application.app_secret, config.main["twitter"]["user_key"], config.main["twitter"]["user_secret"], parent=self)
# try:
self.stream2 = twitter.buffers.indibidual.streamer(application.app_key, application.app_secret, config.main["twitter"]["user_key"], config.main["twitter"]["user_secret"], parent=self)
# The self.ids contains all IDS for the follow argument of the stream.
ids = ""
ids = ""
# If we have more than 0 items on a list, then.
for i in config.main["other_buffers"]["timelines"]:
ids = ids+self.db.settings[i][0]["user"]["id_str"]+", "
for i in range(0, self.nb.GetPageCount()):
if self.nb.GetPage(i).type == "list":
for z in self.nb.GetPage(i).users:
ids+= str(z)+", "
if ids != "":
for i in config.main["other_buffers"]["timelines"]:
ids = ids+self.db.settings[i][0]["user"]["id_str"]+", "
for i in range(0, self.nb.GetPageCount()):
if self.nb.GetPage(i).type == "list":
for z in self.nb.GetPage(i).users:
ids+= str(z)+", "
if ids != "":
# try:
call_threaded(self.stream2.statuses.filter, follow=ids)
call_threaded(self.stream2.statuses.filter, follow=ids)
# except:
# pass
except:
self.stream2.disconnect()
# except:
# self.stream2.disconnect()

def check_stream_up(self):
try:
Expand Down Expand Up @@ -950,22 +949,15 @@ def down(self, event=None):
def get_more_items(self, event=None):
self.nb.GetCurrentPage().get_more_items()

def connect_streams(self):
disconnect = False
if self.stream.connected == False:
output.speak(_(u"Trying to reconnect the main stream"))
disconnect = True
del self.stream
call_threaded(self.init)
self.get_home()
if hasattr(self, "stream2") and self.stream2.connected == False:
output.speak(_(u"Trying to reconnect the buffers stream"))
disconnect = True
log.debug("Trying reconnects the timelines stream...")
del self.stream2
self.get_tls()
if disconnect == False:
output.speak(_(u"All streams are working properly"))
def search_buffer(self, buffer_type=None, name_buffer=None):
page = None
for i in range(0, self.nb.GetPageCount()):
page = self.nb.GetPage(i)
if page.type != buffer_type:
continue
if page.name_buffer == name_buffer:
return page
return page

### Close App
def Destroy(self):
Expand Down
2 changes: 1 addition & 1 deletion src/keystrokeEditor/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@
"search": _(u"Search on twitter"),
"edit_keystrokes": _(u"Shows the keystroke editor"),
"view_user_lists": _(u"Show lists for a specified user"),
"get_more_items": _(u"Load previous item for a buffer"),
"get_more_items": _(u"loads previous items to any buffer"),
}
Binary file modified src/locales/es/LC_MESSAGES/twblue.mo
Binary file not shown.
Loading

0 comments on commit 1a2f834

Please sign in to comment.