Commit 2f1a4768 authored by Jérome Perrin's avatar Jérome Perrin

fixup! base: python3 support for Base_generateBarcodeImage

parent ed0a7212
...@@ -4,9 +4,7 @@ from Products.ERP5Type.Utils import str2bytes ...@@ -4,9 +4,7 @@ from Products.ERP5Type.Utils import str2bytes
def generateBarcodeImage(self, barcode_type, data, REQUEST=None): def generateBarcodeImage(self, barcode_type, data, REQUEST=None):
# type: (str, str, HTTPRequest) -> bytes # type: (str, str, HTTPRequest) -> bytes
# huBarcode's DataMatrix support has limitation for data size. # pylint:disable=import-error
# huBarcode's QRCode support is broken.
# more 1-D barcode types can be added by pyBarcode library.
barcode_type = barcode_type.lower() barcode_type = barcode_type.lower()
if barcode_type == 'datamatrix': if barcode_type == 'datamatrix':
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
...@@ -62,3 +60,4 @@ def generateBarcodeImage(self, barcode_type, data, REQUEST=None): ...@@ -62,3 +60,4 @@ def generateBarcodeImage(self, barcode_type, data, REQUEST=None):
if REQUEST is not None: if REQUEST is not None:
REQUEST.RESPONSE.setHeader('Content-Type', 'image/png') REQUEST.RESPONSE.setHeader('Content-Type', 'image/png')
return output return output
# pylint:enable=import-error
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment