#31: Refactored solution.

This commit is contained in:
Bill Dengler 2015-05-11 20:25:35 -04:00
parent f241a1fc31
commit 3f63046cbb
2 changed files with 3 additions and 6 deletions

View File

@ -411,7 +411,7 @@ class baseBufferController(bufferController):
self.session.sound.play("audio.ogg") self.session.sound.play("audio.ogg")
if utils.is_geocoded(tweet): if utils.is_geocoded(tweet):
self.session.sound.play("geo.ogg") self.session.sound.play("geo.ogg")
self.session.db[str(self.name+"_pos")]=self.buffer.list.get_selected()
@_tweets_exist @_tweets_exist
def audio(self): def audio(self):
tweet = self.get_tweet() tweet = self.get_tweet()

View File

@ -226,6 +226,7 @@ class Controller(object):
self.create_ignored_session_buffer(session_.sessions[i]) self.create_ignored_session_buffer(session_.sessions[i])
continue continue
self.create_buffers(session_.sessions[i]) self.create_buffers(session_.sessions[i])
self.set_buffer_positions(session_.sessions[i])
# Connection checker executed each minute. # Connection checker executed each minute.
self.checker_function = RepeatingTimer(60, self.check_connection) self.checker_function = RepeatingTimer(60, self.check_connection)
@ -236,7 +237,6 @@ class Controller(object):
for i in session_.sessions: for i in session_.sessions:
if session_.sessions[i].is_logged == False: continue if session_.sessions[i].is_logged == False: continue
self.start_buffers(session_.sessions[i]) self.start_buffers(session_.sessions[i])
self.set_buffer_positions(session_.sessions[i])
if config.app["app-settings"]["play_ready_sound"] == True: if config.app["app-settings"]["play_ready_sound"] == True:
session_.sessions[session_.sessions.keys()[0]].sound.play("ready.ogg") session_.sessions[session_.sessions.keys()[0]].sound.play("ready.ogg")
if config.app["app-settings"]["speak_ready_msg"] == True: if config.app["app-settings"]["speak_ready_msg"] == True:
@ -870,8 +870,7 @@ class Controller(object):
pass pass
if position == page.buffer.list.get_selected(): if position == page.buffer.list.get_selected():
page.session.sound.play("limit.ogg") page.session.sound.play("limit.ogg")
else:
page.session.db[page.name+"_pos"]=index
try: try:
output.speak(page.get_message(), True) output.speak(page.get_message(), True)
except: except:
@ -890,8 +889,6 @@ class Controller(object):
pass pass
if position == page.buffer.list.get_selected(): if position == page.buffer.list.get_selected():
page.session.sound.play("limit.ogg") page.session.sound.play("limit.ogg")
else:
page.session.db[page.name+"_pos"]=index
try: try:
output.speak(page.get_message(), True) output.speak(page.get_message(), True)
except: except: