Merge branch 'main' of ssh://code.freedombone.net:2222/bashrc/epicyon into main

main
Bob Mottram 2021-03-15 17:00:41 +00:00
commit 0af269e794
1 changed files with 8 additions and 14 deletions

View File

@ -329,6 +329,8 @@ def _getSpeakerJsonFromIndex(boxName: str, index: int) -> {}:
publishedYear + '/' + publishedYear + '/' +
publishedMonth + '/' + publishedMonth + '/' +
indexList[index]) indexList[index])
if not os.path.isfile(speakerJsonFilename):
return None
return loadJson(speakerJsonFilename) return loadJson(speakerJsonFilename)
@ -441,8 +443,6 @@ def _showLocalBox(boxName: str,
content += ' ' content += ' '
if speakerJson.get('detectedLinks'): if speakerJson.get('detectedLinks'):
if len(speakerJson['detectedLinks']) > 0: if len(speakerJson['detectedLinks']) > 0:
print("speakerJson['detectedLinks']: " +
str(speakerJson['detectedLinks']))
content = '🔗' + content content = '🔗' + content
content = (content[:40]) if len(content) > 40 else content content = (content[:40]) if len(content) > 40 else content
print(indent + str(posStr) + ' | ' + str(name) + ' | ' + print(indent + str(posStr) + ' | ' + str(name) + ' | ' +
@ -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)