From 9f7e5861cd00e85556bae077eebaf8445e239b07 Mon Sep 17 00:00:00 2001 From: freeyoung Date: Fri, 14 Mar 2014 01:58:55 +0800 Subject: [PATCH] adjust import order and fix `qr` method --- escpos/escpos.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/escpos/escpos.py b/escpos/escpos.py index 3389c93..ed9b3d3 100644 --- a/escpos/escpos.py +++ b/escpos/escpos.py @@ -6,9 +6,9 @@ @license: GPL ''' -import qrcode -import time import os +import time +import qrcode import operator from PIL import Image @@ -141,15 +141,15 @@ class Escpos: self._print_image(pix_line, img_size) - def qr(self,text): + def qr(self, text): """ Print QR Code for the provided string """ qr_code = qrcode.QRCode(version=4, box_size=4, border=1) qr_code.add_data(text) qr_code.make(fit=True) qr_img = qr_code.make_image() - im = qr_img._img.convert("RGB") # Convert the RGB image in printable image - self._convert_image(im) + im = qr_img._img.convert("RGB") + self.image(im) def barcode(self, code, bc, width, height, pos, font): """ Print Barcode """