Add flush function

* Flushing the file will cause the driver to flush the cache and print
* the whole buffer.
This commit is contained in:
Christoph Heuel 2015-11-29 16:03:56 +01:00
parent 1a1ed5e7fc
commit 8fd05eb02b
1 changed files with 4 additions and 0 deletions

View File

@ -176,6 +176,10 @@ class File(Escpos):
if self.device is None: if self.device is None:
print("Could not open the specified file %s" % self.devfile) print("Could not open the specified file %s" % self.devfile)
def flush(self):
"""Flush printing content"""
self.device.flush()
def _raw(self, msg): def _raw(self, msg):
""" Print any command sent in raw format """ """ Print any command sent in raw format """