fix removed file on print hook
This commit is contained in:
parent
a4006721d3
commit
d816c9d302
@ -143,8 +143,8 @@ def cups_print(parsed_body: dict, body: str):
|
|||||||
if 'ALARMDEPESCHE' in parsed_body:
|
if 'ALARMDEPESCHE' in parsed_body:
|
||||||
for i in range(0, print_num):
|
for i in range(0, print_num):
|
||||||
conn.printFile (printer, fname, "Alarmfax", {})
|
conn.printFile (printer, fname, "Alarmfax", {})
|
||||||
os.remove(fname)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
logging.error("cups_print", e)
|
||||||
|
finally:
|
||||||
if os.path.exists(fname):
|
if os.path.exists(fname):
|
||||||
os.remove(fname)
|
os.remove(fname)
|
||||||
logging.error("cups_print", e)
|
|
Loading…
x
Reference in New Issue
Block a user