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

Method _useAttributes

github/Commit.py:365–394  ·  view source on GitHub ↗
(self, attributes: dict[str, Any])

Source from the content-addressed store, hash-verified

363 )
364
365 def _useAttributes(self, attributes: dict[str, Any]) -> None:
366 super()._useAttributes(attributes)
367 if "author" in attributes: # pragma no branch
368 self._author = self._makeClassAttribute(github.NamedUser.NamedUser, attributes["author"])
369 if "comments_url" in attributes: # pragma no branch
370 self._comments_url = self._makeStringAttribute(attributes["comments_url"])
371 if "commit" in attributes: # pragma no branch
372 self._commit = self._makeClassAttribute(github.GitCommit.GitCommit, attributes["commit"])
373 if "committer" in attributes: # pragma no branch
374 self._committer = self._makeClassAttribute(github.NamedUser.NamedUser, attributes["committer"])
375 if "files" in attributes: # pragma no branch
376 self._files = self._makeListOfClassesAttribute(github.File.File, attributes["files"])
377 if "html_url" in attributes: # pragma no branch
378 self._html_url = self._makeStringAttribute(attributes["html_url"])
379 if "node_id" in attributes: # pragma no branch
380 self._node_id = self._makeStringAttribute(attributes["node_id"])
381 if "parents" in attributes: # pragma no branch
382 self._parents = self._makeListOfClassesAttribute(Commit, attributes["parents"])
383 if "repository" in attributes: # pragma no branch
384 self._repository = self._makeClassAttribute(github.Repository.Repository, attributes["repository"])
385 if "sha" in attributes: # pragma no branch
386 self._sha = self._makeStringAttribute(attributes["sha"])
387 elif "url" in attributes and attributes["url"]:
388 quoted_sha = attributes["url"].split("/")[-1]
389 sha = urllib.parse.unquote(quoted_sha)
390 self._sha = self._makeStringAttribute(sha)
391 if "stats" in attributes: # pragma no branch
392 self._stats = self._makeClassAttribute(github.CommitStats.CommitStats, attributes["stats"])
393 if "text_matches" in attributes: # pragma no branch
394 self._text_matches = self._makeDictAttribute(attributes["text_matches"])
395
396
397class CommitSearchResult(Commit):

Callers 1

_useAttributesMethod · 0.45

Calls 4

_makeClassAttributeMethod · 0.80
_makeStringAttributeMethod · 0.80
_makeDictAttributeMethod · 0.80

Tested by

no test coverage detected