MCPcopy Index your code
hub / github.com/lincolnloop/python-qrcode / __init__

Method __init__

qrcode/main.py:78–99  ·  view source on GitHub ↗
(
        self,
        version=None,
        error_correction=constants.ERROR_CORRECT_M,
        box_size=10,
        border=4,
        image_factory: Optional[type[GenericImage]] = None,
        mask_pattern=None,
    )

Source from the content-addressed store, hash-verified

76 _version: Optional[int] = None
77
78 def __init__(
79 self,
80 version=None,
81 error_correction=constants.ERROR_CORRECT_M,
82 box_size=10,
83 border=4,
84 image_factory: Optional[type[GenericImage]] = None,
85 mask_pattern=None,
86 ):
87 _check_box_size(box_size)
88 _check_border(border)
89 self.version = version
90 self.error_correction = int(error_correction)
91 self.box_size = int(box_size)
92 # Spec says border should be at least four boxes wide, but allow for
93 # any (e.g. for producing printable QR codes).
94 self.border = int(border)
95 self.mask_pattern = mask_pattern
96 self.image_factory = image_factory
97 if image_factory is not None:
98 assert issubclass(image_factory, BaseImage)
99 self.clear()
100
101 @property
102 def version(self) -> int:

Callers

nothing calls this directly

Calls 3

clearMethod · 0.95
_check_box_sizeFunction · 0.85
_check_borderFunction · 0.85

Tested by

no test coverage detected