|
1 | | -"""Used to generate a custom barcode. |
| 1 | +"""Used to generate a custom code. |
2 | 2 |
|
3 | | -This Script is used to generate a custom code that can be passed to |
| 3 | +This script is used to generate a custom code that can be passed to |
4 | 4 | the printer script. |
5 | 5 |
|
6 | | -Each code can be summarized in 4 segments, 3 four character segments and 1 six |
| 6 | +Each ID can be summarized in 4 segments, 3 four character segments and 1 six |
7 | 7 | character segment. For example "1100 1101 0100 001101" |
8 | 8 | """ |
9 | 9 |
|
10 | 10 | import argparse |
11 | 11 | from functools import partial |
12 | 12 |
|
13 | 13 | """ |
14 | | -The four segments are repeated for times with different separators in |
| 14 | +The four segments are repeated four times with different separators in |
15 | 15 | between. Though the separators are the same across pods. |
16 | 16 |
|
17 | | -for example, Melozio has the following code |
| 17 | +For example, Melozio has the following code |
18 | 18 |
|
19 | 19 | 01 1100 10 1101 10 0100 10 010110 01 |
20 | 20 | 01 1100 10 1101 01 0100 01 010110 10 |
|
24 | 24 | """ |
25 | 25 |
|
26 | 26 |
|
27 | | -def _getCode() -> tuple[str, str, str, str]: |
| 27 | +def _getID() -> tuple[str, str, str, str]: |
28 | 28 | """Get the code from the user |
29 | 29 | """ |
30 | 30 |
|
31 | 31 | parser = argparse.ArgumentParser(description="Generate a code to pass to the printer.") # noqa |
32 | 32 | parser.add_argument( |
33 | | - "code", |
| 33 | + "ID", |
34 | 34 | nargs="+", |
35 | | - help="The code to generate with. Formated like this, '1100 1101 0100 001101'" |
| 35 | + help="The ID to generate a code with. Formated like this, '1100 1101 0100 001101'" # noqa |
36 | 36 | ) |
37 | 37 |
|
38 | 38 | segments = parser.parse_args().code |
@@ -69,7 +69,7 @@ def _getCode() -> tuple[str, str, str, str]: |
69 | 69 |
|
70 | 70 |
|
71 | 71 | def main(): |
72 | | - seg1, seg2, seg3, seg4 = _getCode() |
| 72 | + seg1, seg2, seg3, seg4 = _getID() |
73 | 73 |
|
74 | 74 | formatter = "01{seg1}{sep1}{seg2}{sep2}{seg3}{sep3}{seg4}{sep4}" |
75 | 75 | formatter = partial( |
|
0 commit comments