Skip to content

Commit

Permalink
temp rebasing PR 77 (5c21556)
Browse files Browse the repository at this point in the history
  • Loading branch information
roboadhoc authored Feb 6, 2025
2 parents a84ca49 + 5c21556 commit e41a711
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 55 deletions.
24 changes: 13 additions & 11 deletions report_aeroo/barcode/EANBarCode.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@
from odoo.tools import config, ustr
fontsize = 12

"""
This class generate EAN bar code, it required PIL (python imaging library)
installed.

If the code has not checksum (12 digits), it added automatically.

Create bar code sample :
from EANBarCode import EanBarCode
bar = EanBarCode()
bar.getImage("9782212110708",50,"gif")
class EanBarCode:
"""
This class generate EAN bar code, it required PIL (python imaging library)
installed.
"""
If the code has not checksum (12 digits), it added automatically.
Create bar code sample :
from EANBarCode import EanBarCode
bar = EanBarCode()
bar.getImage("9782212110708",50,"gif")
"""

class EanBarCode:
""" Compute the EAN bar code """
def __init__(self):
""" Compute the EAN bar code """
A = {0 : "0001101", 1 : "0011001", 2 : "0010011", 3 : "0111101", 4 : "0100011",
5 : "0110001", 6 : "0101111", 7 : "0111011", 8 : "0110111", 9 : "0001011"}
B = {0 : "0100111", 1 : "0110011", 2 : "0011011", 3 : "0100001", 4 : "0011101",
Expand Down
88 changes: 44 additions & 44 deletions report_aeroo/barcode/code39.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,50 @@
fontsize = 15

charmap = {
'*':[0,3,0,1,2,1,2,1,0],
'-':[0,3,0,1,0,1,2,1,2],
'$':[0,3,0,3,0,3,0,1,0],
'%':[0,1,0,3,0,3,0,3,0],
' ':[0,3,2,1,0,1,2,1,0],
'.':[2,3,0,1,0,1,2,1,0],
'/':[0,3,0,3,0,1,0,3,0],
'+':[0,3,0,1,0,3,0,3,0],
'0':[0,1,0,3,2,1,2,1,0],
'1':[2,1,0,3,0,1,0,1,2],
'2':[0,1,2,3,0,1,0,1,2],
'3':[2,1,2,3,0,1,0,1,0],
'4':[0,1,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,1,2],
'5':[2,1,0,3,2,1,0,1,0],
'6':[0,1,2,3,2,1,0,1,0],
'7':[0,1,0,3,0,1,2,1,2],
'8':[2,1,0,3,0,1,2,1,0],
'9':[0,1,2,3,0,1,2,1,0],
'A':[2,1,0,1,0,3,0,1,2],
'B':[0,1,2,1,0,3,0,1,2],
'C':[2,1,2,1,0,3,0,1,0],
'D':[0,1,0,1,2,3,0,1,2],
'E':[2,1,0,1,2,3,0,1,0],
'F':[0,1,2,1,2,3,0,1,0],
'G':[0,1,0,1,0,3,2,1,2],
'H':[2,1,0,1,0,3,2,1,0],
'I':[0,1,2,1,0,3,2,1,0],
'J':[0,1,0,1,2,3,2,1,0],
'K':[2,1,0,1,0,1,0,3,2],
'L':[0,1,2,1,0,1,0,3,2],
'M':[2,1,2,1,0,1,0,3,0],
'N':[0,1,0,1,2,1,0,3,2],
'O':[2,1,0,1,2,1,0,3,0],
'P':[0,1,2,1,2,1,0,3,0],
'Q':[0,1,0,1,0,1,2,3,2],
'R':[2,1,0,1,0,1,2,3,0],
'S':[0,1,2,1,0,1,2,3,0],
'T':[0,1,0,1,2,1,2,3,0],
'U':[2,3,0,1,0,1,0,1,2],
'V':[0,3,2,1,0,1,0,1,2],
'W':[2,3,2,1,0,1,0,1,0],
'X':[0,3,0,1,2,1,0,1,2],
'Y':[2,3,0,1,2,1,0,1,0],
'Z':[0,3,2,1,2,1,0,1,0]
}

def create_c39(height, smallest, text):
Expand Down

0 comments on commit e41a711

Please sign in to comment.