From ca9af4f421e2f0d6271a9d93d00b8465f539801b Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 9 Nov 2015 14:00:33 +0100 Subject: [PATCH] added creator parameter --- github/Repository.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/github/Repository.py b/github/Repository.py index 03995e23..40076e17 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -11,6 +11,7 @@ # Copyright 2013 Mark Roddy # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # +# Copyright 2015 Jannis Gebauer # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -1429,7 +1430,7 @@ class Repository(github.GithubObject.CompletableGithubObject): ) return github.Issue.Issue(self._requester, headers, data, completed=True) - def get_issues(self, milestone=github.GithubObject.NotSet, state=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, mentioned=github.GithubObject.NotSet, labels=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet, since=github.GithubObject.NotSet): + def get_issues(self, milestone=github.GithubObject.NotSet, state=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, mentioned=github.GithubObject.NotSet, labels=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet, since=github.GithubObject.NotSet, creator=github.GithubObject.NotSet): """ :calls: `GET /repos/:owner/:repo/issues `_ :param milestone: :class:`github.Milestone.Milestone` or "none" or "*" @@ -1440,6 +1441,7 @@ class Repository(github.GithubObject.CompletableGithubObject): :param sort: string :param direction: string :param since: datetime.datetime + :param creator: string or :class:`github.NamedUser.NamedUser` :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Issue.Issue` """ assert milestone is github.GithubObject.NotSet or milestone == "*" or milestone == "none" or isinstance(milestone, github.Milestone.Milestone), milestone @@ -1450,6 +1452,7 @@ class Repository(github.GithubObject.CompletableGithubObject): assert sort is github.GithubObject.NotSet or isinstance(sort, (str, unicode)), sort assert direction is github.GithubObject.NotSet or isinstance(direction, (str, unicode)), direction assert since is github.GithubObject.NotSet or isinstance(since, datetime.datetime), since + assert creator is github.GithubObject.NotSet or isinstance(creator, github.NamedUser.NamedUser) or isinstance(creator, (str, unicode)), creator url_parameters = dict() if milestone is not github.GithubObject.NotSet: if isinstance(milestone, str): @@ -1473,6 +1476,11 @@ class Repository(github.GithubObject.CompletableGithubObject): url_parameters["direction"] = direction if since is not github.GithubObject.NotSet: url_parameters["since"] = since.strftime("%Y-%m-%dT%H:%M:%SZ") + if creator is not github.GithubObject.NotSet: + if isinstance(creator, str): + url_parameters["creator"] = creator + else: + url_parameters["creator"] = creator._identity return github.PaginatedList.PaginatedList( github.Issue.Issue, self._requester,