diff options
| author | Jacob McDonnell <jacob@simplelittledream.com> | 2022-09-29 20:05:07 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@simplelittledream.com> | 2022-09-29 20:05:07 -0400 |
| commit | ed317860178fe187a97fddda3d7b98fa5412a0b2 (patch) | |
| tree | d527a59d1bf8b40278fd9fe08c31b358dd795e5e /main.py | |
| parent | ae68206ea5aad328c906353dced9a1513d93e105 (diff) | |
Fixed Circular Import
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -7,7 +7,9 @@ import datetime from settings import modules, general, lineWidth from time import sleep from Adafruit_Thermal import * -import textwrap +from textwrap import fill +from ipqr import getQrCode +from PIL import Image name = general["name"] today = datetime.date.today().strftime("%A %m-%d-%Y") @@ -30,21 +32,34 @@ def main(): if modules[module]: for line in mods[module]: line = line.replace("\n", "") - printer.println(textwrap.fill(line, lineWidth)) + printer.println(fill(line, lineWidth)) printer.feed(1) +def printSettingsPage(): + printer.println("Settings") + try: + getQrCode() + qr = Image.open(r"ipqr.png") + printer.println(fill("Scan the QR Code below to access settings", lineWidth)) + printer.printImage(qr) + except: + printer.println("No Network Connection") + + printer.wake() printer.setSize('M') sleep(10) for line in output: - printer.println(textwrap.fill(line, lineWidth)) + printer.println(fill(line, lineWidth)) try: main() except: sleep(30) main() +printSettingsPage() + printer.feed(6) printer.sleep() |
