From 5a89ca7ccde75f960d97be41abfbb960fce80289 Mon Sep 17 00:00:00 2001 From: Christoffer Viken Date: Tue, 21 Mar 2017 20:47:37 +0000 Subject: [PATCH] Python2 compatible maybe? --- barcode_helpers.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/barcode_helpers.py b/barcode_helpers.py index 98f9265..94a10b5 100644 --- a/barcode_helpers.py +++ b/barcode_helpers.py @@ -9,7 +9,7 @@ def px2mm(px, dpi=300): class BrotherLabelWriter(ImageWriter): def __init__(self, typ='62', max_height=350, rot=0, text=None): - super().__init__() + super(self).__init__() assert typ in label_type_specs if (rot//90) % 2 == 1: self._h, self._w = label_type_specs[typ]['dots_printable'] @@ -25,10 +25,10 @@ class BrotherLabelWriter(ImageWriter): def _init(self, code): self.text = None - super()._init(code) + super(self)._init(code) def calculate_size(self, modules_per_line, number_of_lines, dpi=300): - x, y = super().calculate_size(modules_per_line, number_of_lines, dpi) + x, y = super(self).calculate_size(modules_per_line, number_of_lines, dpi) self._xo = (px2mm(self._w)-px2mm(x))/2 self._yo = (px2mm(self._h)-px2mm(y)) @@ -38,10 +38,10 @@ class BrotherLabelWriter(ImageWriter): return int(self._w), int(self._h) def _paint_module(self, xpos, ypos, width, color): - super()._paint_module(xpos+self._xo, ypos+self._yo, width, color) + super(self)._paint_module(xpos+self._xo, ypos+self._yo, width, color) def _paint_text(self, xpos, ypos): - super()._paint_text(xpos+self._xo, ypos+self._yo) + super(self)._paint_text(xpos+self._xo, ypos+self._yo) def _finish(self): if self._title: