Adjust qr size and config loading

This commit is contained in:
José Carlos Cuevas 2021-08-11 16:33:04 +02:00
parent 30c3d61974
commit e3b3ea563d
2 changed files with 9 additions and 4 deletions

View file

@ -31,5 +31,6 @@ def load_config():
else:
with path.open("r") as cfg_file:
config = yaml.load(cfg_file.read(), Loader=yaml.FullLoader)
print(config)
return True
return config

View file

@ -17,7 +17,7 @@ from PIL import Image
import re
import requests
from config import config, load_config, CONFIG_PATH
from config import load_config, CONFIG_PATH
# Enable logging
@ -26,13 +26,17 @@ logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s
logger = logging.getLogger(__name__)
config = {}
def initialize():
"""
Initializes the printer and returns a printer object to
generate the print
"""
if not load_config():
global config
config = load_config()
if not config:
print(f"Config file created, check {CONFIG_PATH}")
if os.path.exists(config.get("PRINTER_FILE")):
@ -173,7 +177,7 @@ def print_gemini(printer, link):
reset_defaults(printer)
lnk = _process_link(link, line[3:])
printer.text("\n")
printer.qr(lnk, size=4)
printer.qr(lnk, size=6)
else:
printer.set(align="left",