add usb and network
parent
619f5f51f8
commit
46e15df821
|
@ -14,9 +14,13 @@ class Item:
|
||||||
conn.cut()
|
conn.cut()
|
||||||
|
|
||||||
|
|
||||||
def connect(connection_cfg):
|
def connect(conn_cfg):
|
||||||
if "file" in connection_cfg:
|
if "file" in conn_cfg:
|
||||||
return printer.File(connection_cfg["file"])
|
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:
|
else:
|
||||||
return printer.Dummy()
|
return printer.Dummy()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue