import sys
from datetime import datetime
from PyQt5.QtWidgets import QApplication

from components import Os_Label_Printer
from lib.helpers import ConfigReader

config = ConfigReader(system_id="stten5")

dmtx="5802850925"
context = {
    "PART": dmtx,
    "SN5": str(12345),
    "DATE": datetime.now().strftime("%d/%m/%Y"),
    "TIME": datetime.now().strftime("%H:%M:%S"),
}
app = QApplication(sys.argv)

if "--extra" in sys.argv:
    # TEST EXTRA PRINTER
    printer = Os_Label_Printer(config=config, name="extra_label_printer")
    printer.config_changed()
    printer.print_label("MI1.prn")
else:
    # TEST STANDARD PRINTER
    printer = Os_Label_Printer(config=config, name="label_printer")
    printer.config_changed()
    printer.print_label("ETA30x16.prn", context=context)
