mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 12:53:12 -06:00
#33: generalize url.
This commit is contained in:
parent
0ddc20ea7c
commit
d19baf411a
@ -434,24 +434,26 @@ class baseBufferController(bufferController):
|
|||||||
tweet = self.get_tweet()
|
tweet = self.get_tweet()
|
||||||
urls = utils.find_urls(tweet)
|
urls = utils.find_urls(tweet)
|
||||||
#handle audio-only (no weblinks) tweets.
|
#handle audio-only (no weblinks) tweets.
|
||||||
if len(urls) == 1 and utils.is_audio(tweet) and self.session.settings["general"]["autohandle_audio"]:
|
if len(urls) == 1 and utils.is_audio(tweet):
|
||||||
return self.audio()
|
return self.audio()
|
||||||
else:
|
else:
|
||||||
return self.url()
|
return self.url()
|
||||||
|
|
||||||
def url(self):
|
def url(self,url=''):
|
||||||
tweet = self.get_tweet()
|
if url == '':
|
||||||
urls = utils.find_urls(tweet)
|
tweet = self.get_tweet()
|
||||||
if len(urls) == 1:
|
urls = utils.find_urls(tweet)
|
||||||
output.speak(_(u"Opening URL..."), True)
|
if len(urls) == 1:
|
||||||
webbrowser.open_new_tab(urls[0])
|
url=urls[0]
|
||||||
elif len(urls) > 1:
|
elif len(urls) > 1:
|
||||||
urls_list = dialogs.urlList.urlList()
|
urls_list = dialogs.urlList.urlList()
|
||||||
urls_list.populate_list(urls)
|
urls_list.populate_list(urls)
|
||||||
if urls_list.get_response() == widgetUtils.OK:
|
if urls_list.get_response() == widgetUtils.OK:
|
||||||
|
url=urls_list.get_string()
|
||||||
|
if hasattr(urls_list, "destroy"): urls_list.destroy()
|
||||||
|
if url != '':
|
||||||
output.speak(_(u"Opening URL..."), True)
|
output.speak(_(u"Opening URL..."), True)
|
||||||
webbrowser.open_new_tab(urls_list.get_string())
|
webbrowser.open_new_tab(url)
|
||||||
if hasattr(urls_list, "destroy"): urls_list.destroy()
|
|
||||||
|
|
||||||
def clear_list(self):
|
def clear_list(self):
|
||||||
dlg = commonMessageDialogs.clear_list()
|
dlg = commonMessageDialogs.clear_list()
|
||||||
|
Loading…
Reference in New Issue
Block a user