Skip to content

Commit 66ee679

Browse files
committed
Merge branch 'labels' of https://github.com/bartdag/python-github2 into bartdag-labels
* 'labels' of https://github.com/bartdag/python-github2: added operations to list labels and to search issues by label
2 parents 589b2f2 + 11972f4 commit 66ee679

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
@@ -59,6 +59,24 @@ def list(self, project, state="open"):
5959
return self.get_values("list", project, state, filter="issues",
6060
datatype=Issue)
6161

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

0 commit comments

Comments
 (0)