MCPcopy
hub / github.com/PyGithub/PyGithub / _useAttributes

Method _useAttributes

github/CheckRun.py:267–314  ·  view source on GitHub ↗
(self, attributes: dict[str, Any])

Source from the content-addressed store, hash-verified

265 self._set_complete()
266
267 def _useAttributes(self, attributes: dict[str, Any]) -> None:
268 if "app" in attributes: # pragma no branch
269 self._app = self._makeClassAttribute(github.GithubApp.GithubApp, attributes["app"])
270 # This only gives us a dictionary with `id` attribute of `check_suite`
271 if "check_suite" in attributes and "id" in attributes["check_suite"]: # pragma no branch
272 id = attributes["check_suite"]["id"]
273 if "url" not in attributes["check_suite"] and "url" in attributes:
274 url = attributes["url"].split("/")[:-2] + ["check-suites", str(id)]
275 attributes["check_suite"]["url"] = "/".join(url)
276 self._check_suite = self._makeClassAttribute(github.CheckSuite.CheckSuite, attributes["check_suite"])
277 # deprecated check suite id property
278 self._check_suite_id = self._makeIntAttribute(id)
279 if "completed_at" in attributes: # pragma no branch
280 self._completed_at = self._makeDatetimeAttribute(attributes["completed_at"])
281 if "conclusion" in attributes: # pragma no branch
282 self._conclusion = self._makeStringAttribute(attributes["conclusion"])
283 if "deployment" in attributes: # pragma no branch
284 self._deployment = self._makeClassAttribute(github.Deployment.Deployment, attributes["deployment"])
285 if "details_url" in attributes: # pragma no branch
286 self._details_url = self._makeStringAttribute(attributes["details_url"])
287 if "external_id" in attributes: # pragma no branch
288 self._external_id = self._makeStringAttribute(attributes["external_id"])
289 if "head_sha" in attributes: # pragma no branch
290 self._head_sha = self._makeStringAttribute(attributes["head_sha"])
291 if "html_url" in attributes: # pragma no branch
292 self._html_url = self._makeStringAttribute(attributes["html_url"])
293 if "id" in attributes: # pragma no branch
294 self._id = self._makeIntAttribute(attributes["id"])
295 elif "url" in attributes and attributes["url"]:
296 id = attributes["url"].split("/")[-1]
297 if id.isnumeric():
298 self._id = self._makeIntAttribute(int(id))
299 if "name" in attributes: # pragma no branch
300 self._name = self._makeStringAttribute(attributes["name"])
301 if "node_id" in attributes: # pragma no branch
302 self._node_id = self._makeStringAttribute(attributes["node_id"])
303 if "output" in attributes: # pragma no branch
304 self._output = self._makeClassAttribute(github.CheckRunOutput.CheckRunOutput, attributes["output"])
305 if "pull_requests" in attributes: # pragma no branch
306 self._pull_requests = self._makeListOfClassesAttribute(
307 github.PullRequest.PullRequest, attributes["pull_requests"]
308 )
309 if "started_at" in attributes: # pragma no branch
310 self._started_at = self._makeDatetimeAttribute(attributes["started_at"])
311 if "status" in attributes: # pragma no branch
312 self._status = self._makeStringAttribute(attributes["status"])
313 if "url" in attributes: # pragma no branch
314 self._url = self._makeStringAttribute(attributes["url"])

Callers 1

editMethod · 0.95

Calls 5

_makeClassAttributeMethod · 0.80
_makeIntAttributeMethod · 0.80
_makeStringAttributeMethod · 0.80

Tested by

no test coverage detected