Added "assignees" argument in Repository.create_issue()

This commit is contained in:
@tmshn
2016-10-10 11:08:52 +09:00
parent 14dd9f0850
commit ba007dc8a8
4 changed files with 12 additions and 7 deletions
+6 -1
View File
@@ -75,6 +75,7 @@ import github.Stargazer
atLeastPython26 = sys.hexversion >= 0x02060000
atLeastPython3 = sys.hexversion >= 0x03000000
class Repository(github.GithubObject.CompletableGithubObject):
"""
This class represents Repositories. The reference can be found here http://developer.github.com/v3/repos/
@@ -856,12 +857,13 @@ class Repository(github.GithubObject.CompletableGithubObject):
)
return github.Hook.Hook(self._requester, headers, data, completed=True)
def create_issue(self, title, body=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, milestone=github.GithubObject.NotSet, labels=github.GithubObject.NotSet):
def create_issue(self, title, body=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, milestone=github.GithubObject.NotSet, labels=github.GithubObject.NotSet, assignees=github.GithubObject.NotSet):
"""
:calls: `POST /repos/:owner/:repo/issues <http://developer.github.com/v3/issues>`_
:param title: string
:param body: string
:param assignee: string or :class:`github.NamedUser.NamedUser`
:param assignees: list (of string or :class:`github.NamedUser.NamedUser`)
:param milestone: :class:`github.Milestone.Milestone`
:param labels: list of :class:`github.Label.Label`
:rtype: :class:`github.Issue.Issue`
@@ -869,6 +871,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
assert isinstance(title, (str, unicode)), title
assert body is github.GithubObject.NotSet or isinstance(body, (str, unicode)), body
assert assignee is github.GithubObject.NotSet or isinstance(assignee, github.NamedUser.NamedUser) or isinstance(assignee, (str, unicode)), assignee
assert assignees is github.GithubObject.NotSet or all(isinstance(element, github.NamedUser.NamedUser) or isinstance(element, (str, unicode)) for element in assignees), assignees
assert milestone is github.GithubObject.NotSet or isinstance(milestone, github.Milestone.Milestone), milestone
assert labels is github.GithubObject.NotSet or all(isinstance(element, github.Label.Label) or isinstance(element, (str, unicode)) for element in labels), labels
@@ -882,6 +885,8 @@ class Repository(github.GithubObject.CompletableGithubObject):
post_parameters["assignee"] = assignee
else:
post_parameters["assignee"] = assignee._identity
if assignees is not github.GithubObject.NotSet:
post_parameters["assignees"] = [element._identity if isinstance(element, github.NamedUser.NamedUser) else element for element in assignees]
if milestone is not github.GithubObject.NotSet:
post_parameters["milestone"] = milestone._identity
if labels is not github.GithubObject.NotSet: