add usb and network
parent
619f5f51f8
commit
46e15df821
|
@ -14,9 +14,13 @@ class Item:
|
|||
conn.cut()
|
||||
|
||||
|
||||
def connect(connection_cfg):
|
||||
if "file" in connection_cfg:
|
||||
return printer.File(connection_cfg["file"])
|
||||
def connect(conn_cfg):
|
||||
if "file" in conn_cfg:
|
||||
return printer.File(conn_cfg["file"])
|
||||
elif "vendor" in conn_cfg and "product" in conn_cfg:
|
||||
return printer.Usb(conn_cfg["vendor"], conn_cfg["product"])
|
||||
elif "host" in conn_cfg and "port" in conn_cfg:
|
||||
return printer.Network(conn_cfg["host"], conn_cfg["port"])
|
||||
else:
|
||||
return printer.Dummy()
|
||||
|
||||
|
|
Loading…
Reference in New Issue