mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 12:53:12 -06:00
Closed #39.
This commit is contained in:
parent
ebe3ab2c14
commit
1d7b2c5712
@ -418,6 +418,8 @@ class baseBufferController(bufferController):
|
||||
self.session.db[str(self.name+"_pos")]=self.buffer.list.get_selected()
|
||||
@_tweets_exist
|
||||
def audio(self,url=''):
|
||||
if hasattr(sound.URLPlayer,'stream'):
|
||||
return sound.URLPlayer.stop_audio(delete=True)
|
||||
tweet = self.get_tweet()
|
||||
if tweet == None: return
|
||||
urls = utils.find_urls(tweet)
|
||||
@ -437,11 +439,13 @@ class baseBufferController(bufferController):
|
||||
@_tweets_exist
|
||||
def interact(self):
|
||||
"Select the best action for the currently focused tweet (audio, geocode, URL, etc)."
|
||||
if hasattr(sound.URLPlayer,'stream'):
|
||||
if hasattr(sound.URLPlayer,'stream') and config.app['app-settings']['use_Codeofdusk_audio_handlers']:
|
||||
return sound.URLPlayer.stop_audio(delete=True)
|
||||
tweet = self.get_tweet()
|
||||
url=None
|
||||
urls = utils.find_urls(tweet)
|
||||
if len(urls) > 0 and config.app['app-settings']['use_Codeofdusk_audio_handlers']==False:
|
||||
return self.url()
|
||||
if len(urls) == 1:
|
||||
url=urls[0]
|
||||
elif len(urls) > 1:
|
||||
@ -460,6 +464,11 @@ class baseBufferController(bufferController):
|
||||
output.speak("Not actionable.",True)
|
||||
self.session.sound.play("error.ogg")
|
||||
|
||||
def secondary_interact(self):
|
||||
if config.app['app-settings']['use_Codeofdusk_audio_handlers']:
|
||||
return self.url()
|
||||
else:
|
||||
return self.audio()
|
||||
def url(self,url='',announce=True):
|
||||
if url == '':
|
||||
tweet = self.get_tweet()
|
||||
|
@ -1018,6 +1018,10 @@ class Controller(object):
|
||||
buffer = self.get_current_buffer()
|
||||
buffer.url()
|
||||
|
||||
def secondary_interact(self, *args, **kwargs):
|
||||
buffer = self.get_current_buffer()
|
||||
buffer.secondary_interact()
|
||||
|
||||
def audio(self, *args, **kwargs):
|
||||
self.get_current_buffer().audio()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user