This commit is contained in:
Peter Golm
2013-03-16 17:28:56 +01:00
parent 03a256a405
commit 6a3a384fd0
5 changed files with 238 additions and 0 deletions
+40
View File
@@ -26,6 +26,7 @@ import Legacy
import github.GithubObject
import HookDescription
import GitignoreTemplate
import Notification
DEFAULT_BASE_URL = "https://api.github.com"
@@ -153,6 +154,45 @@ class Github(object):
None
)
def get_notification(self, id):
"""
:calls: `GET /notifications/threads/:id <http://developer.github.com/v3/todo>`_
:rtype: :class:`github.Notification.Notification`
"""
assert isinstance(id, (str, unicode)), id
headers, data = self.__requester.requestJsonAndCheck(
"GET",
"/notifications/threads/" + id,
None,
None
)
print data
return github.Notification.Notification(self.__requester, data, completed=True)
def get_notifications(self, all=False, participating=True):
"""
:calls: `GET /notifications <http://developer.github.com/v3/todo>`_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Notification.Notification`
"""
assert isinstance(all, (bool, )), all
assert isinstance(participating, (bool,)), participating
params = dict()
if all:
params["all"] = "true"
if participating:
params["participating"] = "true"
# TODO: implement parameter "since"
return github.PaginatedList.PaginatedList(
github.Notification.Notification,
self.__requester,
"/notifications",
params
)
def legacy_search_repos(self, keyword, language=github.GithubObject.NotSet):
"""
:calls: `GET /legacy/repos/search/:keyword <http://developer.github.com/v3/todo>`_