Browse Source

catching sys.stderr.write error when image is sent and printer is not connected

master
manetta 3 years ago
parent
commit
4069170f3a
  1. 5
      print/tools/televex/televex.py

5
print/tools/televex/televex.py

@ -9,7 +9,7 @@ import io
def connect():
# Get the printer's USB initializing code with $ sudo lsbusb
try:
lp = printer.Usb(0x4b8,0xe15) # televex printer @ Varia
# lp = printer.Usb(0x4b8,0xe15) # televex printer @ Varia
lp = printer.Usb(0x4b8,0xe03) # printer @ poel
except:
lp = None
@ -113,5 +113,4 @@ def print_now(output, lp=None, type=None):
lp.image(output)
lp.cut()
else:
sys.stderr.write('Printing output to the terminal:\n\n'+output+'\n\n')
sys.stderr.write('Printing output to the terminal:\n\n'+str(output)+'\n\n')

Loading…
Cancel
Save