diff options
author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2015-09-28 22:50:56 +0200 |
---|---|---|
committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2015-09-28 22:50:56 +0200 |
commit | 9814c2977824543acb3ad39da2f94afc2feaf982 (patch) | |
tree | d6747869c7bcec714e18aae0c159fbf9f97ffbde /callers | |
parent | c1783980db7a20ea86bfb009a410469f3dc8d5d2 (diff) |
Some example "known" numbers.
Diffstat (limited to 'callers')
-rwxr-xr-x | callers/read_numbers_aloud.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/callers/read_numbers_aloud.py b/callers/read_numbers_aloud.py index d74f08d..64d803c 100755 --- a/callers/read_numbers_aloud.py +++ b/callers/read_numbers_aloud.py @@ -7,18 +7,30 @@ from espeak import espeak class Speaker(object): + """Speak aloud something instead of calling numbers.""" def __init__(self, voice='europe/it'): espeak.set_voice(voice) + def _output(self, text): + print(text) + espeak.synth(text) + def speak(self, number): - print("Calling %s" % number) - espeak.synth(number) + try: + getattr(self, 'call_'+number, None)() + except TypeError: + self._output("Sto chiamando il numero %s" % number) + + def call_12345(self): + self._output(u"Questa รจ la combinazione della mia valigia.") + + def call_1234567890(self): + self._output(u"Stiamo testando tutti i numeri, vero?") class Reader(object): - """ - """ + """Read digits from stdin and turn them into phone numbers.""" def __init__(self): self.number = "" |