Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
2f1a4768
Commit
2f1a4768
authored
May 02, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! base: python3 support for Base_generateBarcodeImage
parent
ed0a7212
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
bt5/erp5_base/ExtensionTemplateItem/portal_components/extension.erp5.BarcodeUtils.py
...lateItem/portal_components/extension.erp5.BarcodeUtils.py
+2
-3
No files found.
bt5/erp5_base/ExtensionTemplateItem/portal_components/extension.erp5.BarcodeUtils.py
View file @
2f1a4768
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment