minor fix print command printer shared

This commit is contained in:
Wilson Gomez 2023-01-05 11:33:40 -05:00
parent cc45113812
commit 0df77c4ca6
1 changed files with 8 additions and 1 deletions

View File

@ -793,7 +793,14 @@ class Receipt(object):
self._printer = printer.Win32Raw(host)
self._printer.open()
elif order['interface'] == 'network':
self._printer = printer.Network(host, timeout=15)
try:
host, port = self._device.split(":")
except:
host, port = self.device, None
if port:
self._printer = printer.Network(host, port=int(port), timeout=15)
else:
self._printer = printer.Network(host, timeout=15)
elif order['interface'] == 'ssh':
self._printer = FileSSH(*host.split('@'))
if self._printer: