|
|
|
@ -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",
|
|
|
|
|