-
-
Notifications
You must be signed in to change notification settings - Fork 134
Expand file tree
/
Copy pathupc.py
More file actions
51 lines (47 loc) · 1.01 KB
/
upc.py
File metadata and controls
51 lines (47 loc) · 1.01 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
from __future__ import annotations
from barcode.charsets.addons import ADDON2_PARITY
from barcode.charsets.addons import ADDON5_PARITY
from barcode.charsets.addons import ADDON_CODES
from barcode.charsets.addons import ADDON_QUIET_ZONE
from barcode.charsets.addons import ADDON_SEPARATOR
from barcode.charsets.addons import ADDON_START
EDGE = "101"
MIDDLE = "01010"
CODES = {
"L": (
"0001101",
"0011001",
"0010011",
"0111101",
"0100011",
"0110001",
"0101111",
"0111011",
"0110111",
"0001011",
),
"R": (
"1110010",
"1100110",
"1101100",
"1000010",
"1011100",
"1001110",
"1010000",
"1000100",
"1001000",
"1110100",
),
}
# Re-export addon constants for backwards compatibility
__all__ = [
"ADDON2_PARITY",
"ADDON5_PARITY",
"ADDON_CODES",
"ADDON_QUIET_ZONE",
"ADDON_SEPARATOR",
"ADDON_START",
"CODES",
"EDGE",
"MIDDLE",
]