Add Function to Dummy Printer for Clearing Buffer
* If you are using the dummy printer, you may want to use the printer again after sending the output to a physical printer. * This method empties the list of the output buffer
This commit is contained in:
parent
d1e7052fa1
commit
e9e4385117
@ -312,5 +312,13 @@ class Dummy(Escpos):
|
|||||||
""" Get the data that was sent to this printer """
|
""" Get the data that was sent to this printer """
|
||||||
return b''.join(self._output_list)
|
return b''.join(self._output_list)
|
||||||
|
|
||||||
|
def clear(self):
|
||||||
|
""" Clear the buffer of the printer
|
||||||
|
|
||||||
|
This method can be called if you send the contents to a physical printer
|
||||||
|
and want to use the Dummy printer for new output.
|
||||||
|
"""
|
||||||
|
del self._output_list[:]
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user