r""" :param code: Code 39 string without \* and without checksum. :param writer: A ``barcode.writer`` instance used to render the barcode (default: SVGWriter). :param add_checksum: Add the checksum to code or not
(self, code: str, writer=None, add_checksum: bool = True)
| 45 | name = "Code 39" |
| 46 | |
| 47 | def __init__(self, code: str, writer=None, add_checksum: bool = True) -> None: |
| 48 | r""" |
| 49 | :param code: Code 39 string without \* and without checksum. |
| 50 | :param writer: A ``barcode.writer`` instance used to render the barcode |
| 51 | (default: SVGWriter). |
| 52 | :param add_checksum: Add the checksum to code or not |
| 53 | """ |
| 54 | |
| 55 | self.code = code.upper() |
| 56 | if add_checksum: |
| 57 | self.code += self.calculate_checksum() |
| 58 | self.writer = writer or self.default_writer() |
| 59 | check_code(self.code, self.name, code39.REF) |
| 60 | |
| 61 | def __str__(self) -> str: |
| 62 | return self.code |
nothing calls this directly
no test coverage detected