MCPcopy Index your code
hub / github.com/WhyNotHugo/python-barcode / to_ascii

Method to_ascii

barcode/base.py:40–45  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

38 raise NotImplementedError
39
40 def to_ascii(self) -> str:
41 code_list = self.build()
42 if not len(code_list) == 1:
43 raise RuntimeError("Code list must contain a single element.")
44 code = code_list[0]
45 return code.replace("1", "X").replace("0", " ")
46
47 def __repr__(self) -> str:
48 return f"<{self.__class__.__name__}({self.get_fullcode()!r})>"

Callers

nothing calls this directly

Calls 1

buildMethod · 0.95

Tested by

no test coverage detected