summaryrefslogtreecommitdiff
path: root/callers
diff options
context:
space:
mode:
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 = ""