Skip to content

Commit 56a4ab6

Browse files
committed
Merge branch 'master' of https://github.com/JNRowe/python-github2 into JNRowe-master
2 parents 59e37a9 + f99a3db commit 56a4ab6

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

github2/issues.py

Lines changed: 21 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
@@ -56,6 +67,16 @@ def close(self, project, number):
5667
return self.get_value("close", project, str(number), filter="issue",
5768
datatype=Issue)
5869

70+
def reopen(self, project, number):
71+
return self.get_value("reopen", project, str(number), filter="issue",
72+
datatype=Issue)
73+
74+
def edit(self, project, number, title, body):
75+
issue_data = {"title": title, "body": body}
76+
return self.get_value("edit", project, str(number),
77+
post_data=issue_data, filter="issue",
78+
datatype=Issue)
79+
5980
def add_label(self, project, number, label):
6081
return self.make_request("label/add", project, label, str(number),
6182
filter="labels")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
url=github2.__homepage__,
2121
license='BSD',
2222
platforms=["any"],
23-
packages=find_packages(exclude=['ez_setup']),
23+
packages=find_packages(exclude=['ez_setup', 'tests']),
2424
scripts=['github2/bin/github_manage_collaborators'],
2525
install_requires=[
2626
],

0 commit comments

Comments
 (0)