mirror of https://gitlab.com/bashrc2/epicyon
Rename speaker_client to notifications_client
parent
d31608d3db
commit
6a388a7103
|
@ -404,7 +404,7 @@ python3 epicyon.py --speaker yournickname@yourdomain --password [yourpassword]
|
|||
Or if you have [picospeaker](https://gitlab.com/ky1e/picospeaker) installed:
|
||||
|
||||
``` bash
|
||||
python3 epicyon.py --screenreader picospeaker --speaker yournickname@yourdomain --password [yourpassword]
|
||||
python3 epicyon.py --screenreader picospeaker --notify yournickname@yourdomain --password [yourpassword]
|
||||
```
|
||||
|
||||
This will then stay running and incoming posts will be announced as they arrive.
|
||||
|
|
24
epicyon.py
24
epicyon.py
|
@ -76,7 +76,7 @@ from theme import setTheme
|
|||
from announce import sendAnnounceViaServer
|
||||
from socnet import instancesGraph
|
||||
from migrate import migrateAccounts
|
||||
from speaker_client import runSpeakerClient
|
||||
from notifications_client import runNotificationsClient
|
||||
|
||||
|
||||
def str2bool(v) -> bool:
|
||||
|
@ -433,10 +433,10 @@ parser.add_argument('--level', dest='skillLevelPercent', type=int,
|
|||
parser.add_argument('--status', '--availability', dest='availability',
|
||||
type=str, default=None,
|
||||
help='Set an availability status')
|
||||
parser.add_argument('--speaker', '--tts', dest='speaker',
|
||||
parser.add_argument('--notifications', '--notify', dest='notifications',
|
||||
type=str, default=None,
|
||||
help='Announce posts as they arrive at your ' +
|
||||
'inbox using TTS. --speaker [handle]')
|
||||
help='Notify posts as they arrive at your ' +
|
||||
'inbox. --notifications [handle]')
|
||||
parser.add_argument('--block', dest='block', type=str, default=None,
|
||||
help='Block a particular address')
|
||||
parser.add_argument('--unblock', dest='unblock', type=str, default=None,
|
||||
|
@ -1899,15 +1899,15 @@ if args.availability:
|
|||
time.sleep(1)
|
||||
sys.exit()
|
||||
|
||||
if args.speaker:
|
||||
if args.notifications:
|
||||
# Announce posts as they arrive in your inbox using text-to-speech
|
||||
if args.speaker.startswith('@'):
|
||||
args.speaker = args.speaker[1:]
|
||||
if '@' not in args.speaker:
|
||||
print('Specify the handle of the speaker nickname@domain')
|
||||
if args.notifications.startswith('@'):
|
||||
args.notifications = args.notifications[1:]
|
||||
if '@' not in args.notifications:
|
||||
print('Specify the handle to notify: nickname@domain')
|
||||
sys.exit()
|
||||
nickname = args.speaker.split('@')[0]
|
||||
domain = args.speaker.split('@')[1]
|
||||
nickname = args.notifications.split('@')[0]
|
||||
domain = args.notifications.split('@')[1]
|
||||
|
||||
if not nickname:
|
||||
print('Specify a nickname with the --nickname option')
|
||||
|
@ -1929,7 +1929,7 @@ if args.speaker:
|
|||
elif args.gnunet:
|
||||
proxyType = 'gnunet'
|
||||
|
||||
runSpeakerClient(baseDir, proxyType, httpPrefix,
|
||||
runNotificationsClient(baseDir, proxyType, httpPrefix,
|
||||
nickname, domain, port, args.password,
|
||||
args.screenreader, args.language,
|
||||
args.debug)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
__filename__ = "speaker_client.py"
|
||||
__filename__ = "notifications_client.py"
|
||||
__author__ = "Bob Mottram"
|
||||
__license__ = "AGPL3+"
|
||||
__version__ = "1.2.0"
|
||||
|
@ -66,11 +66,12 @@ def _speakerPicospeaker(pitch: int, rate: int, systemLanguage: str,
|
|||
os.system(speakerCmd)
|
||||
|
||||
|
||||
def runSpeakerClient(baseDir: str, proxyType: str, httpPrefix: str,
|
||||
nickname: str, domain: str, port: int, password: str,
|
||||
screenreader: str, systemLanguage: str,
|
||||
debug: bool) -> None:
|
||||
"""Runs the screen reader client, which announces new inbox items via TTS
|
||||
def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
|
||||
nickname: str, domain: str, port: int,
|
||||
password: str, screenreader: str,
|
||||
systemLanguage: str, debug: bool) -> None:
|
||||
"""Runs the notifications and screen reader client,
|
||||
which announces new inbox items
|
||||
"""
|
||||
if screenreader == 'espeak':
|
||||
print('Setting up espeak')
|
Loading…
Reference in New Issue