MCPcopy Create free account
hub / github.com/WhyNotHugo/python-barcode / _new_charset

Method _new_charset

barcode/codex.py:167–177  ·  view source on GitHub ↗
(self, which: Literal["A", "B", "C"])

Source from the content-addressed store, hash-verified

165 return self.code
166
167 def _new_charset(self, which: Literal["A", "B", "C"]) -> list[int]:
168 if which == self._charset:
169 raise ValueError(f"Already in charset {which}")
170 if which == "A":
171 code = self._convert("TO_A")
172 elif which == "B":
173 code = self._convert("TO_B")
174 elif which == "C":
175 code = self._convert("TO_C")
176 self._charset = which
177 return [code]
178
179 # to be redefined in subclass if required
180 def _is_char_fnc1_char(self, char):

Callers 2

_maybe_switch_charsetMethod · 0.95
_buildMethod · 0.95

Calls 1

_convertMethod · 0.95

Tested by

no test coverage detected