Timelines fix and some minor bugfixes too

This commit is contained in:
Manuel Cortez 2015-01-22 08:54:41 -06:00
parent 399de75d64
commit af087508b0
7 changed files with 23 additions and 9 deletions

View File

@ -2,6 +2,6 @@
name = 'TWBlue' name = 'TWBlue'
snapshot = False snapshot = False
if snapshot == False: if snapshot == False:
version = "0.51" version = "0.80"
else: else:
version = "7" version = "7"

View File

@ -2,7 +2,7 @@
name = 'TW Blue' name = 'TW Blue'
snapshot = False snapshot = False
if snapshot == False: if snapshot == False:
version = "0.90" version = "0.80"
update_url = 'http://twblue.es/updates/tw_blue.json' update_url = 'http://twblue.es/updates/tw_blue.json'
else: else:
version = "7" version = "7"

View File

@ -178,6 +178,7 @@ class baseBufferController(bufferController):
for i in self.session.db[self.name]: for i in self.session.db[self.name]:
tweet = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"]) tweet = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"])
self.buffer.list.insert_item(False, *tweet) self.buffer.list.insert_item(False, *tweet)
self.buffer.set_position(self.session.settings["general"]["reverse_timelines"])
# self.buffer.set_list_position() # self.buffer.set_list_position()
elif self.buffer.list.get_count() > 0: elif self.buffer.list.get_count() > 0:
if self.session.settings["general"]["reverse_timelines"] == False: if self.session.settings["general"]["reverse_timelines"] == False:
@ -374,6 +375,7 @@ class peopleBufferController(baseBufferController):
for i in self.session.db[self.name]["items"]: for i in self.session.db[self.name]["items"]:
tweet = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"]) tweet = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"])
self.buffer.list.insert_item(False, *tweet) self.buffer.list.insert_item(False, *tweet)
self.buffer.set_position(self.session.settings["general"]["reverse_timelines"])
# self.buffer.set_list_position() # self.buffer.set_list_position()
elif self.buffer.list.get_count() > 0: elif self.buffer.list.get_count() > 0:
if self.session.settings["general"]["reverse_timelines"] == False: if self.session.settings["general"]["reverse_timelines"] == False:

View File

@ -157,12 +157,12 @@ class Session(object):
if report_failure and hasattr(e, 'message'): if report_failure and hasattr(e, 'message'):
output.speak(_("%s failed. Reason: %s") % (action, e.message)) output.speak(_("%s failed. Reason: %s") % (action, e.message))
finished = True finished = True
except: # except:
tries = tries + 1 # tries = tries + 1
time.sleep(5) # time.sleep(5)
if report_success: if report_success:
output.speak(_("%s succeeded.") % action) output.speak(_("%s succeeded.") % action)
if _sound != None: sound.player.play(_sound) if _sound != None: self.sound.play(_sound)
@_require_login @_require_login
def get_favourites_timeline(self, name, *args, **kwargs): def get_favourites_timeline(self, name, *args, **kwargs):

View File

@ -20,8 +20,8 @@ class timelinesStreamer(TwythonStreamer):
def check_tls(self, data): def check_tls(self, data):
for i in self.session.settings["other_buffers"]["timelines"]: for i in self.session.settings["other_buffers"]["timelines"]:
if data["user"]["screen_name"] == i: if data["user"]["screen_name"] == i:
if self.session.settings["general"]["reverse_timelines"] == False: self.session.db[i].append(data) if self.session.settings["general"]["reverse_timelines"] == False: self.session.db["%s-timeline" % (i,)].append(data)
else: self.session.db[i].insert(0, data) else: self.session.db["%s-timeline" % (i,)].insert(0, data)
pub.sendMessage("item-in-timeline", data= data, user= self.session.db["user_name"], who= i) pub.sendMessage("item-in-timeline", data= data, user= self.session.db["user_name"], who= i)
def on_success(self, data): def on_success(self, data):

View File

@ -30,3 +30,9 @@ class basePanel(wx.Panel):
self.sizer.Add(btnSizer, 0, wx.ALL, 5) self.sizer.Add(btnSizer, 0, wx.ALL, 5)
self.sizer.Add(self.list.list, 0, wx.ALL, 5) self.sizer.Add(self.list.list, 0, wx.ALL, 5)
self.SetSizer(self.sizer) self.SetSizer(self.sizer)
def set_position(self, reversed=False):
if reversed == False:
self.list.select_item(self.list.get_count()-1)
else:
self.list.select_item(0)

View File

@ -13,3 +13,9 @@ class eventsPanel(wx.Panel):
self.list = widgets.list(self, _(u"Date"), _(u"Event"), size=(600,600), style=wx.LC_REPORT|wx.LC_SINGLE_SEL|wx.LC_VRULES) self.list = widgets.list(self, _(u"Date"), _(u"Event"), size=(600,600), style=wx.LC_REPORT|wx.LC_SINGLE_SEL|wx.LC_VRULES)
self.tweet = wx.Button(self, -1, _(u"Tweet")) self.tweet = wx.Button(self, -1, _(u"Tweet"))
self.delete_event = wx.Button(self, -1, _(u"Remove event")) self.delete_event = wx.Button(self, -1, _(u"Remove event"))
def set_position(self, reversed=False):
if reversed == False:
self.list.select_item(self.list.get_count()-1)
else:
self.list.select_item(0)