Change InputGitAuthor to reflect that time is an optional parameter.

This commit is contained in:
Nic Dahlquist
2014-12-26 19:22:32 -08:00
parent 5a05a5e58f
commit 3bd3f0c807
2 changed files with 10 additions and 4 deletions
+1
View File
@@ -30,6 +30,7 @@
/MANIFEST
/PyGithub.egg-info/
/.coverage
/.idea
/developer.github.com/
/gh-pages/
/doc/doctrees/
+9 -4
View File
@@ -23,12 +23,14 @@
# #
# ##############################################################################
import github.GithubObject
class InputGitAuthor(object):
"""
"""
def __init__(self, name, email, date):
def __init__(self, name, email, date=github.GithubObject.NotSet):
"""
:param name: string
:param email: string
@@ -37,15 +39,18 @@ class InputGitAuthor(object):
assert isinstance(name, (str, unicode)), name
assert isinstance(email, (str, unicode)), email
assert isinstance(date, (str, unicode)), date # @todo Datetime?
assert date is github.GithubObject.NotSet or isinstance(date, (str, unicode)), date # @todo Datetime?
self.__name = name
self.__email = email
self.__date = date
@property
def _identity(self):
return {
identity = {
"name": self.__name,
"email": self.__email,
"date": self.__date,
}
if self.__date is not github.GithubObject.NotSet:
identity["date"] = self.__date
return identity