summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py46
1 files changed, 23 insertions, 23 deletions
diff --git a/main.py b/main.py
index b3abe87..6df9aef 100644
--- a/main.py
+++ b/main.py
@@ -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()