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 # testing temporary directories
test/test-cli-output/ test/test-cli-output/
# vim swap files
*.swp
*.swn
*.swo

@ -1 +1 @@
Subproject commit 31d2269651d4d10ca51f59799ee4d05b4c4a1625 Subproject commit b6220ee5c55b166f06d45a97f230312805b743b1

View File

@ -578,9 +578,11 @@ class Escpos(object):
# Fix the size between last line and cut # Fix the size between last line and cut
# TODO: handle this with a line feed # TODO: handle this with a line feed
self._raw(b"\n\n\n\n\n\n") 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) 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) self._raw(PAPER_FULL_CUT)
def cashdraw(self, pin): def cashdraw(self, pin):