Move get_notification(s) to AuthenticatedUser (pull #148)

This commit is contained in:
Vincent Jacques
2013-03-19 22:07:29 +01:00
parent f25c54e1d4
commit edcf40bc7f
6 changed files with 51 additions and 58 deletions
-38
View File
@@ -167,44 +167,6 @@ 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
)
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>`_