mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Factorize the creation of attributes (preparation for #195)
This commit is contained in:
@@ -56,11 +56,8 @@ class StatusMessage(github.GithubObject.NonCompletableGithubObject):
|
||||
|
||||
def _useAttributes(self, attributes):
|
||||
if "body" in attributes: # pragma no branch
|
||||
assert attributes["body"] is None or isinstance(attributes["body"], (str, unicode)), attributes["body"]
|
||||
self._body = github.GithubObject.ValuedAttribute(attributes["body"])
|
||||
self._body = self._makeStringAttribute(attributes["body"])
|
||||
if "status" in attributes: # pragma no branch
|
||||
assert attributes["status"] is None or isinstance(attributes["status"], (str, unicode)), attributes["status"]
|
||||
self._status = github.GithubObject.ValuedAttribute(attributes["status"])
|
||||
self._status = self._makeStringAttribute(attributes["status"])
|
||||
if "created_on" in attributes: # pragma no branch
|
||||
assert attributes["created_on"] is None or isinstance(attributes["created_on"], (str, unicode)), attributes["created_on"]
|
||||
self._created_on = github.GithubObject.ValuedAttribute(self._parseDatetime(attributes["created_on"]))
|
||||
self._created_on = self._makeDatetimeAttribute(attributes["created_on"])
|
||||
|
||||
Reference in New Issue
Block a user