diff options
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 46 |
1 files changed, 23 insertions, 23 deletions
@@ -17,32 +17,32 @@ printer = Adafruit_Thermal("/dev/serial0", 19200, timeout=5) output = ["The Morning Paper:", f"Good Morning {name}, Today is {today}"] mods = { - "quote": getQuote(), - "national day": getNationalDay(), - "Detailed": getDetailedForecast(), - "Hourly": getHourlyForecast(), - "calendar": getEventsFromCal(), - "news": getHeadlines() + "quote": getQuote(), + "national day": getNationalDay(), + "Detailed": getDetailedForecast(), + "Hourly": getHourlyForecast(), + "calendar": getEventsFromCal(), + "news": getHeadlines() } def main(): - for module in modules: - if modules[module]: - for line in mods[module]: - line = line.replace("\n", "") - printer.println(fill(line, lineWidth)) - printer.feed(1) + for module in modules: + if modules[module]: + for line in mods[module]: + line = line.replace("\n", "") + printer.println(fill(line, lineWidth)) + printer.feed(1) def printSettingsPage(): - printer.println("Settings") - try: - getQrCode() - printer.println(fill("Scan the QR Code below to access settings", lineWidth)) - printer.printImage("ipqr.png") - except: - printer.println("No Network Connection") + printer.println("Settings") + try: + getQrCode() + printer.println(fill("Scan the QR Code below to access settings", lineWidth)) + printer.printImage("ipqr.png") + except: + printer.println("No Network Connection") printer.wake() @@ -50,12 +50,12 @@ printer.setSize('M') sleep(10) for line in output: - printer.println(fill(line, lineWidth)) + printer.println(fill(line, lineWidth)) try: - main() + main() except: - sleep(30) - main() + sleep(30) + main() printSettingsPage() |
