This commit is contained in:
jmdaweb 2014-12-06 00:09:11 +01:00
commit 4e18bb0721
4 changed files with 21 additions and 18 deletions

View File

@ -91,3 +91,4 @@ view_user_lists = string(default="control+win+l")
get_more_items = string(default="alt+win+pageup") get_more_items = string(default="alt+win+pageup")
reverse_geocode = string(default="control+win+g") reverse_geocode = string(default="control+win+g")
view_reverse_geocode = string(default="control+win+shift+g") view_reverse_geocode = string(default="control+win+shift+g")
get_trending_topics = string(default="control+win+t")

View File

@ -85,8 +85,11 @@ class trendsPanel(wx.Panel):
def start_streams(self): def start_streams(self):
data = self.twitter.twitter.get_place_trends(id=self.argumento) data = self.twitter.twitter.get_place_trends(id=self.argumento)
if not hasattr(self, "name"):
self.name = data[0]["locations"][0]["name"]
self.trends = data[0]["trends"] self.trends = data[0]["trends"]
sound.player.play(self.sound) # We need to get the trends sound, so the next line is commented.
# sound.player.play(self.sound)
return len(self.trends) return len(self.trends)
def get_more_items(self): def get_more_items(self):
@ -94,20 +97,11 @@ class trendsPanel(wx.Panel):
def put_items(self, num): def put_items(self, num):
selected_item = self.list.get_selected() selected_item = self.list.get_selected()
if self.list.get_count() == 0: self.list.clear()
for i in self.trends: for i in self.trends:
tweet = self.compose_function(i) tweet = self.compose_function(i)
self.list.insert_item(False, *tweet) self.list.insert_item(False, *tweet)
self.set_list_position() self.set_list_position()
elif self.list.get_count() > 0:
if config.main["general"]["reverse_timelines"] == False:
for i in self.trends:
tweet = self.compose_function(i)
self.list.insert_item(False, *tweet)
else:
for i in self.trends:
tweet = self.compose_function(i)
self.list.insert_item(True, *tweet)
self.list.select_item(selected_item) self.list.select_item(selected_item)
def post_status(self, ev=None): def post_status(self, ev=None):

View File

@ -319,6 +319,13 @@ class mainFrame(wx.Frame):
self.db.settings["buffers"].append(i+"favs") self.db.settings["buffers"].append(i+"favs")
self.fav_stream = RepeatingTimer(180, self.get_fav_buffers) self.fav_stream = RepeatingTimer(180, self.get_fav_buffers)
self.fav_stream.start() self.fav_stream.start()
for i in config.main["other_buffers"]["trending_topic_buffers"]:
buff = buffers.trendsPanel(self.nb, self, "%s_tt" % (i,), argumento=i, sound="trendd_updated.ogg")
timer = RepeatingTimer(300, buff.start_streams)
timer.start()
num = buff.start_streams()
buff.put_items(num)
self.nb.InsertSubPage(self.db.settings["buffers"].index(self.db.settings["user_name"]), buff, _(u"Trending topics for %s") % (buff.name,))
self.sizer.Add(self.nb, 0, wx.ALL, 5) self.sizer.Add(self.nb, 0, wx.ALL, 5)
panel.SetSizer(self.sizer) panel.SetSizer(self.sizer)
self.SetClientSize(self.sizer.CalcMin()) self.SetClientSize(self.sizer.CalcMin())
@ -1026,11 +1033,12 @@ class mainFrame(wx.Frame):
woeid = trendingDialog.countries[trendingDialog.location.GetStringSelection()] woeid = trendingDialog.countries[trendingDialog.location.GetStringSelection()]
elif trendingDialog.city.GetValue() == True: elif trendingDialog.city.GetValue() == True:
woeid = trendingDialog.cities[trendingDialog.location.GetStringSelection()] woeid = trendingDialog.cities[trendingDialog.location.GetStringSelection()]
buff = buffers.trendsPanel(self.nb, self, "%s_tt" % (woeid,), argumento=woeid, sound="tweet_timeline.ogg") buff = buffers.trendsPanel(self.nb, self, "%s_tt" % (woeid,), argumento=woeid, sound="trend_updated.ogg")
self.nb.InsertSubPage(self.db.settings["buffers"].index(self.db.settings["user_name"]), buff, _(u"Trending topics for %s") % (trendingDialog.location.GetStringSelection(),)) self.nb.InsertSubPage(self.db.settings["buffers"].index(self.db.settings["user_name"]), buff, _(u"Trending topics for %s") % (trendingDialog.location.GetStringSelection(),))
timer = RepeatingTimer(180, buff.start_streams) timer = RepeatingTimer(300, buff.start_streams)
timer.start() timer.start()
num = buff.start_streams() num = buff.start_streams()
config.main["other_buffers"]["trending_topic_buffers"].append(woeid)
buff.put_items(num) buff.put_items(num)
### Close App ### Close App

@ -1 +1 @@
Subproject commit ddcbbd21d35995a4877df5b7cd03db12b31bee84 Subproject commit 739034e207994b3a05e59e6d7836e68a0a1b6983