MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / _useAttributes

Method _useAttributes

github/Label.py:146–164  ·  view source on GitHub ↗
(self, attributes: dict[str, Any])

Source from the content-addressed store, hash-verified

144 self._set_complete()
145
146 def _useAttributes(self, attributes: dict[str, Any]) -> None:
147 if "color" in attributes: # pragma no branch
148 self._color = self._makeStringAttribute(attributes["color"])
149 if "default" in attributes: # pragma no branch
150 self._default = self._makeBoolAttribute(attributes["default"])
151 if "description" in attributes: # pragma no branch
152 self._description = self._makeStringAttribute(attributes["description"])
153 if "id" in attributes: # pragma no branch
154 self._id = self._makeIntAttribute(attributes["id"])
155 if "name" in attributes: # pragma no branch
156 self._name = self._makeStringAttribute(attributes["name"])
157 elif "url" in attributes and attributes["url"]:
158 quoted_name = attributes["url"].split("/")[-1]
159 name = urllib.parse.unquote(quoted_name)
160 self._name = self._makeStringAttribute(name)
161 if "node_id" in attributes: # pragma no branch
162 self._node_id = self._makeStringAttribute(attributes["node_id"])
163 if "url" in attributes: # pragma no branch
164 self._url = self._makeStringAttribute(attributes["url"])

Callers 1

editMethod · 0.95

Calls 3

_makeStringAttributeMethod · 0.80
_makeBoolAttributeMethod · 0.80
_makeIntAttributeMethod · 0.80

Tested by

no test coverage detected