thermoprint-homework/jobs/flush.py

12 lines
363 B
Python

class FlushJob:
def get_name(self):
return "Flush Printer Queue"
def configure(self):
pass
def run(self, printer):
# Send NUL bytes to push any buffered data without printing visible characters
printer._raw(b'\x00\x00')
# Send a newline to ensure any line-buffered data is processed
printer.text("\n")