-
-
Notifications
You must be signed in to change notification settings - Fork 134
Expand file tree
/
Copy pathean.py
More file actions
76 lines (71 loc) · 1.39 KB
/
ean.py
File metadata and controls
76 lines (71 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from __future__ import annotations
from barcode.charsets.addons import ADDON2_PARITY
from barcode.charsets.addons import ADDON5_PARITY
from barcode.charsets.addons import ADDON_QUIET_ZONE
from barcode.charsets.addons import ADDON_SEPARATOR
from barcode.charsets.addons import ADDON_START
# Note: Addon codes use CODES["A"] and CODES["B"] defined below
EDGE = "101"
MIDDLE = "01010"
CODES = {
"A": (
"0001101",
"0011001",
"0010011",
"0111101",
"0100011",
"0110001",
"0101111",
"0111011",
"0110111",
"0001011",
),
"B": (
"0100111",
"0110011",
"0011011",
"0100001",
"0011101",
"0111001",
"0000101",
"0010001",
"0001001",
"0010111",
),
"C": (
"1110010",
"1100110",
"1101100",
"1000010",
"1011100",
"1001110",
"1010000",
"1000100",
"1001000",
"1110100",
),
}
LEFT_PATTERN = (
"AAAAAA",
"AABABB",
"AABBAB",
"AABBBA",
"ABAABB",
"ABBAAB",
"ABBBAA",
"ABABAB",
"ABABBA",
"ABBABA",
)
# Re-export addon constants for backwards compatibility
__all__ = [
"ADDON2_PARITY",
"ADDON5_PARITY",
"ADDON_QUIET_ZONE",
"ADDON_SEPARATOR",
"ADDON_START",
"CODES",
"EDGE",
"LEFT_PATTERN",
"MIDDLE",
]