mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 10:51:14 +00:00
Factorize the creation of attributes (preparation for #195)
This commit is contained in:
@@ -60,11 +60,8 @@ class CommitStats(github.GithubObject.NonCompletableGithubObject):
|
||||
|
||||
def _useAttributes(self, attributes):
|
||||
if "additions" in attributes: # pragma no branch
|
||||
assert attributes["additions"] is None or isinstance(attributes["additions"], (int, long)), attributes["additions"]
|
||||
self._additions = github.GithubObject.ValuedAttribute(attributes["additions"])
|
||||
self._additions = self._makeIntAttribute(attributes["additions"])
|
||||
if "deletions" in attributes: # pragma no branch
|
||||
assert attributes["deletions"] is None or isinstance(attributes["deletions"], (int, long)), attributes["deletions"]
|
||||
self._deletions = github.GithubObject.ValuedAttribute(attributes["deletions"])
|
||||
self._deletions = self._makeIntAttribute(attributes["deletions"])
|
||||
if "total" in attributes: # pragma no branch
|
||||
assert attributes["total"] is None or isinstance(attributes["total"], (int, long)), attributes["total"]
|
||||
self._total = github.GithubObject.ValuedAttribute(attributes["total"])
|
||||
self._total = self._makeIntAttribute(attributes["total"])
|
||||
|
||||
Reference in New Issue
Block a user