From f155d21ae0654171207b33b8a0cd87d19ebe8b2c Mon Sep 17 00:00:00 2001 From: robertem <3456661+RandomGamer342@users.noreply.github.com> Date: Sun, 19 Aug 2018 13:16:49 +0000 Subject: [PATCH] Fix label format for endless label types Add some more documentation to config files Create bar_codes directory to avoid IOExceptions when trying to write to non-existent directories --- barcode_helpers.py | 4 ++-- conf.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/barcode_helpers.py b/barcode_helpers.py index 9d8286b..2e23063 100644 --- a/barcode_helpers.py +++ b/barcode_helpers.py @@ -17,11 +17,11 @@ class BrotherLabelWriter(ImageWriter): if self.rot: self._h, self._w = label_type_specs[typ]['dots_printable'] if self._w == 0 or self._w > max_height: - self._w = max_height + self._w = min(max_height, self._h / 2) else: self._w, self._h = label_type_specs[typ]['dots_printable'] if self._h == 0 or self._h > max_height: - self._h = max_height + self._h = min(max_height, self._w / 2) self._xo = 0.0 self._yo = 0.0 self._title = text diff --git a/conf.py b/conf.py index 7f3476d..52a1467 100644 --- a/conf.py +++ b/conf.py @@ -7,5 +7,7 @@ input_encoding = 'utf8' low_credit_warning_limit = -100 user_recent_transaction_limit = 100 +# See https://pypi.org/project/brother_ql/ for label types +# Set rotate to False for endless labels label_type = "29x90" label_rotate = True