From 29cc8baab7e94a92cc701ebd5bfdfc6dd296a758 Mon Sep 17 00:00:00 2001 From: Dmytro Katyukha Date: Fri, 3 Feb 2017 16:19:11 +0000 Subject: [PATCH] Handle cases when fullCut or partCut not available --- .gitignore | 5 +++++ capabilities-data | 2 +- src/escpos/escpos.py | 6 ++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 932ff9b..346833d 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,8 @@ src/escpos/version.py # testing temporary directories test/test-cli-output/ + +# vim swap files +*.swp +*.swn +*.swo diff --git a/capabilities-data b/capabilities-data index 31d2269..b6220ee 160000 --- a/capabilities-data +++ b/capabilities-data @@ -1 +1 @@ -Subproject commit 31d2269651d4d10ca51f59799ee4d05b4c4a1625 +Subproject commit b6220ee5c55b166f06d45a97f230312805b743b1 diff --git a/src/escpos/escpos.py b/src/escpos/escpos.py index 3e07fc0..a868daa 100644 --- a/src/escpos/escpos.py +++ b/src/escpos/escpos.py @@ -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):