MCPcopy Create free account
hub / github.com/lincolnloop/python-qrcode / check_kind

Method check_kind

qrcode/image/base.py:84–97  ·  view source on GitHub ↗

Get the image type.

(self, kind, transform=None)

Source from the content-addressed store, hash-verified

82 return self._img
83
84 def check_kind(self, kind, transform=None):
85 """
86 Get the image type.
87 """
88 if kind is None:
89 kind = self.kind
90 allowed = not self.allowed_kinds or kind in self.allowed_kinds
91 if transform:
92 kind = transform(kind)
93 if not allowed:
94 allowed = kind in self.allowed_kinds
95 if not allowed:
96 raise ValueError(f"Cannot set {type(self).__name__} type to {kind}")
97 return kind
98
99 def is_eye(self, row: int, col: int):
100 """

Callers 1

saveMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected