Factorize the creation of attributes (preparation for #195)

This commit is contained in:
Vincent Jacques
2013-09-12 09:27:25 +02:00
parent 4a5009741a
commit 597e123029
55 changed files with 620 additions and 1132 deletions
+3 -6
View File
@@ -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"])