8000 perf(barcode): use elaphe library to generate barcodes by fedexin40 · Pull Request #90 · aeroo/aeroo_reports · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

perf(barcode): use elaphe library to generate barcodes #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: 8.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions report_aeroo/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,9 @@
'active': False,
'application': True,
'auto_install': False,
'external_dependencies': {
'python': [
'elaphe'
]
}
}
159 changes: 0 additions & 159 deletions report_aeroo/barcode/EANBarCode.py

This file was deleted.

Binary file removed report_aeroo/barcode/FreeMonoBold.ttf
Binary file not shown.
18 changes: 5 additions & 13 deletions report_aeroo/barcode/barcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,26 @@
#
##############################################################################

from code128 import get_code
from code39 import create_c39
from EANBarCode import EanBarCode
from elaphe import barcode
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO


def make_barcode(code, code_type='ean13', rotate=None, height=50, xw=1):
if code:
if code_type.lower()=='ean13':
bar=EanBarCode()
im = bar.getImage(code,height)
elif code_type.lower()=='code128':
im = get_code(code, xw, height)
elif code_type.lower()=='code39':
im = create_c39(height, xw, code)
im = barcode(code_type, code, scale=height)
else:
return StringIO(), 'image/png'

tf = StringIO()
try:
if rotate!=None:
im=im.rotate(int(rotate))
if rotate is not None:
im = im.rotate(int(rotate))
except Exception, e:
pass
im.save(tf, 'png')
size_x = str(im.size[0]/96.0)+'in'
size_y = str(im.size[1]/96.0)+'in'
return tf, 'image/png', size_x, size_y

185 changes: 0 additions & 185 deletions report_aeroo/barcode/code128.py

This file was deleted.

Loading
0