diff --git a/config.py b/config.py index c509eae..3e59ea0 100644 --- a/config.py +++ b/config.py @@ -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 diff --git a/smallprint.py b/smallprint.py index 179067a..5dc72c9 100644 --- a/smallprint.py +++ b/smallprint.py @@ -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",