summaryrefslogtreecommitdiff
path: root/settings.py
blob: af93b336676fad316c0fb1368678ac8e2019868f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import json
from main import printer
from ipqr import getQrCode
from PIL import Image
from textwrap import fill

settingsJSON = open('settings.json')

settings = json.load(settingsJSON)

calendars = settings["calendars"]
weather = settings["weather"]
news = settings["news"]
modules = settings["modules"]
general = settings["general"]
lineWidth = settings["general"]["Line Width"]

settingsJSON.close()


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")