Skip to content

Commit da635ce

Browse files
committed
Add support for searching issues.
1 parent 274a53c commit da635ce

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

github2/issues.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ def __repr__(self):
3131
class Issues(GithubCommand):
3232
domain = "issues"
3333

34+
def search(self, project, term, state="open"):
35+
"""Get all issues for project that match term with given state.
36+
37+
``project`` is a string with the project owner username and repository
38+
name separated by ``/`` (e.g. ``ask/pygithub2``).
39+
``term`` is a string to search issues for.
40+
``state`` can be either ``open`` or ``closed``.
41+
"""
42+
return self.get_values("search", project, state, term, filter="issues",
43+
datatype=Issue)
44+
3445
def list(self, project, state="open"):
3546
"""Get all issues for project' with state'.
3647

0 commit comments

Comments
 (0)