following the norm, a gs1-128 barcode is a subset of code 128 barcode, it can be generated by prepending the code with the FNC1 character https://en.wikipedia.org/wiki/GS1-128 https://www.gs1-128.info/
| 283 | |
| 284 | |
| 285 | class Gs1_128(Code128): # noqa: N801 |
| 286 | """ |
| 287 | following the norm, a gs1-128 barcode is a subset of code 128 barcode, |
| 288 | it can be generated by prepending the code with the FNC1 character |
| 289 | https://en.wikipedia.org/wiki/GS1-128 |
| 290 | https://www.gs1-128.info/ |
| 291 | """ |
| 292 | |
| 293 | name = "GS1-128" |
| 294 | |
| 295 | FNC1_CHAR = "\xf1" |
| 296 | |
| 297 | def __init__(self, code, writer=None) -> None: |
| 298 | code = self.FNC1_CHAR + code |
| 299 | super().__init__(code, writer) |
| 300 | |
| 301 | def get_fullcode(self): |
| 302 | return super().get_fullcode()[1:] |
| 303 | |
| 304 | def _is_char_fnc1_char(self, char): |
| 305 | return char == self.FNC1_CHAR |
| 306 | |
| 307 | |
| 308 | # For pre 0.8 compatibility |
no outgoing calls