Skip to content

Commit 11972f4

Browse files
committed
added operations to list labels and to search issues by label
1 parent 675ba1c commit 11972f4

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

github2/issues.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@ def list(self, project, state="open"):
5656
return self.get_values("list", project, state, filter="issues",
5757
datatype=Issue)
5858

59+
def list_by_label(self, project, label):
60+
"""Get all issues for project' with label'.
61+
62+
``project`` is a string with the project owner username and repository
63+
name separated by ``/`` (e.g. ``ask/pygithub2``).
64+
``label`` is a string representing a label (e.g., ``bug``).
65+
"""
66+
return self.get_values("list", project, "label", label, filter="issues",
67+
datatype=Issue)
68+
69+
def list_labels(self, project):
70+
"""Get all labels for project'.
71+
72+
``project`` is a string with the project owner username and repository
73+
name separated by ``/`` (e.g. ``ask/pygithub2``).
74+
"""
75+
return self.get_values("labels", project, filter="labels")
76+
5977
def show(self, project, number):
6078
"""Get all the data for issue by issue-number."""
6179
return self.get_value("show", project, str(number),

0 commit comments

Comments
 (0)