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

Method _create_module

barcode/writer.py:354–366  ·  view source on GitHub ↗
(self, xpos, ypos, width, color)

Source from the content-addressed store, hash-verified

352 self._group.appendChild(background)
353
354 def _create_module(self, xpos, ypos, width, color):
355 # Background rect has been provided already, so skipping "spaces"
356 if color != self.background:
357 element = self._document.createElement("rect")
358 attributes = {
359 "x": SIZE.format(xpos),
360 "y": SIZE.format(ypos),
361 "width": SIZE.format(width),
362 "height": SIZE.format(self.module_height),
363 "style": f"fill:{color};",
364 }
365 _set_attributes(element, **attributes)
366 self._group.appendChild(element)
367
368 def _create_text(self, xpos, ypos):
369 # check option to override self.text with self.human (barcode as

Callers

nothing calls this directly

Calls 1

_set_attributesFunction · 0.85

Tested by

no test coverage detected