summaryrefslogtreecommitdiff
path: root/callers
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2015-09-28 22:50:56 +0200
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2015-09-28 22:50:56 +0200
commit9814c2977824543acb3ad39da2f94afc2feaf982 (patch)
treed6747869c7bcec714e18aae0c159fbf9f97ffbde /callers
parentc1783980db7a20ea86bfb009a410469f3dc8d5d2 (diff)
Some example "known" numbers.
Diffstat (limited to 'callers')
-rwxr-xr-xcallers/read_numbers_aloud.py20
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 = ""