From 4069170f3a53161b581fd9ecfeac7b62e22b9ba3 Mon Sep 17 00:00:00 2001 From: manetta Date: Thu, 18 Mar 2021 22:39:24 +0100 Subject: [PATCH] catching sys.stderr.write error when image is sent and printer is not connected --- print/tools/televex/televex.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/print/tools/televex/televex.py b/print/tools/televex/televex.py index cba0a88..df34bac 100644 --- a/print/tools/televex/televex.py +++ b/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')