summaryrefslogtreecommitdiff
path: root/source/features.py
diff options
context:
space:
mode:
Diffstat (limited to 'source/features.py')
-rw-r--r--source/features.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/features.py b/source/features.py
index 7690feb..2d2d80e 100644
--- a/source/features.py
+++ b/source/features.py
@@ -3,6 +3,7 @@ import os
3import speech_recognition as sr 3import speech_recognition as sr
4from gpiozero import CPUTemperature 4from gpiozero import CPUTemperature
5import hardware_driver as lcd # importing the ./hardware_driver.py file 5import hardware_driver as lcd # importing the ./hardware_driver.py file
6from main_cli import input_handling
6 7
7# some functions need to be put on a different thread but we are keeping that project for another time 8# some functions need to be put on a different thread but we are keeping that project for another time
8# import threading 9# import threading
@@ -63,7 +64,7 @@ class feat:
63 def custom_greeting(self): 64 def custom_greeting(self):
64 self.clear_terminal_lcd() 65 self.clear_terminal_lcd()
65 try: 66 try:
66 with open("quotes.txt", "r") as file: 67 with open("../assets/text/quotes.txt", "r") as file:
67 quotes = [quote.strip() for quote in file.readlines()] 68 quotes = [quote.strip() for quote in file.readlines()]
68 except FileNotFoundError: 69 except FileNotFoundError:
69 L.text("Quotes file missing", 1) 70 L.text("Quotes file missing", 1)
@@ -152,11 +153,11 @@ class feat:
152 print("Error:", e) 153 print("Error:", e)
153 return None 154 return None
154 155
155 def save_notes(self): 156 def save_notes(self, input_handling):
156 self.clear_terminal_lcd() 157 self.clear_terminal_lcd()
157 print("Type your notes (type 'stop' to exit):") 158 print("Type your notes (type 'stop' to exit):")
158 while True: 159 while True:
159 note = input(": ") 160 note = input_handling(": ")
160 if note.lower() in ["stop", "exit", "quit"]: 161 if note.lower() in ["stop", "exit", "quit"]:
161 break 162 break
162 first_line = note[:16] 163 first_line = note[:16]