mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 11:21:16 +00:00
this fixes #108
This commit is contained in:
@@ -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>`_
|
||||
|
||||
Reference in New Issue
Block a user