1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-08-24 09:03:34 +00:00

Handle cases when fullCut or partCut not available

This commit is contained in:
Dmytro Katyukha
2017-02-03 16:19:11 +00:00
committed by Patrick Kanzler
parent 0f33d68f3a
commit 29cc8baab7
3 changed files with 10 additions and 3 deletions

5
.gitignore vendored
View File

@@ -23,3 +23,8 @@ src/escpos/version.py
# testing temporary directories
test/test-cli-output/
# vim swap files
*.swp
*.swn
*.swo

View File

@@ -578,9 +578,11 @@ class Escpos(object):
# Fix the size between last line and cut
# TODO: handle this with a line feed
self._raw(b"\n\n\n\n\n\n")
if mode.upper() == "PART":
if mode.upper() == "PART" and self.profile.supports('paperPartCut'):
self._raw(PAPER_PART_CUT)
else: # DEFAULT MODE: FULL CUT
elif mode.upper() != "PART" and self.profile.supports('paperFullCut'):
# DEFAULT MODE: FULL CUT
self._raw(PAPER_FULL_CUT)
def cashdraw(self, pin):