From 1edb32ec29ca3c1bf4d1a53215ecb2544aa04a6e Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Mon, 12 Jul 2021 02:00:54 +0100 Subject: Refactor code to support phone hangup button --- phone.py | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 phone.py (limited to 'phone.py') diff --git a/phone.py b/phone.py deleted file mode 100644 index 59b9cfb..0000000 --- a/phone.py +++ /dev/null @@ -1,16 +0,0 @@ -import subprocess - -class PhoneManager: - def handle_event(self, event): - print("handling event", event) - if event == "fortune": - res = subprocess.run(["fortune"], stdout=subprocess.PIPE) - output = res.stdout.decode("utf-8") - self.speak(output) - else: - self.speak(event) - - - def speak(self, text): - print("speaking:", text) - subprocess.run(["espeak", text]) -- cgit v1.2.3