mirror of https://gitlab.com/bashrc2/epicyon
Opening links
parent
7e0d052006
commit
7744629257
|
@ -1153,11 +1153,11 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
|
||||||
else:
|
else:
|
||||||
print('No --screenreader option was specified')
|
print('No --screenreader option was specified')
|
||||||
elif keyPress.startswith('open'):
|
elif keyPress.startswith('open'):
|
||||||
currIndex = currInboxIndex
|
currIndex = 0
|
||||||
if currTimeline == 'dm':
|
if ' ' in keyPress:
|
||||||
currIndex = currDMIndex
|
postIndex = keyPress.split(' ')[1].strip()
|
||||||
elif currTimeline == 'sent':
|
if postIndex.isdigit():
|
||||||
currIndex = currSentIndex
|
currIndex = int(postIndex)
|
||||||
speakerJson = \
|
speakerJson = \
|
||||||
_getSpeakerJsonFromIndex(currTimeline, currIndex)
|
_getSpeakerJsonFromIndex(currTimeline, currIndex)
|
||||||
if not speakerJson:
|
if not speakerJson:
|
||||||
|
@ -1165,12 +1165,6 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
|
||||||
linkOpened = False
|
linkOpened = False
|
||||||
if speakerJson.get('detectedLinks'):
|
if speakerJson.get('detectedLinks'):
|
||||||
if len(speakerJson['detectedLinks']) > 0:
|
if len(speakerJson['detectedLinks']) > 0:
|
||||||
if ' ' in keyPress:
|
|
||||||
postIndex = keyPress.split(' ')[1].strip()
|
|
||||||
if postIndex.isdigit():
|
|
||||||
speakerJson = \
|
|
||||||
_getSpeakerJsonFromIndex(currTimeline,
|
|
||||||
int(postIndex))
|
|
||||||
for url in speakerJson['detectedLinks']:
|
for url in speakerJson['detectedLinks']:
|
||||||
if '://' in url:
|
if '://' in url:
|
||||||
webbrowser.open(url)
|
webbrowser.open(url)
|
||||||
|
@ -1179,7 +1173,7 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
|
||||||
sayStr = 'Opened web links'
|
sayStr = 'Opened web links'
|
||||||
_sayCommand(sayStr, sayStr, originalScreenReader,
|
_sayCommand(sayStr, sayStr, originalScreenReader,
|
||||||
systemLanguage, espeak)
|
systemLanguage, espeak)
|
||||||
else:
|
if not linkOpened:
|
||||||
sayStr = 'There are no web links to open.'
|
sayStr = 'There are no web links to open.'
|
||||||
_sayCommand(sayStr, sayStr, originalScreenReader,
|
_sayCommand(sayStr, sayStr, originalScreenReader,
|
||||||
systemLanguage, espeak)
|
systemLanguage, espeak)
|
||||||
|
|
Loading…
Reference in New Issue