def get_followers(self):
"""
:calls: `GET /users/:user/followers <http://developer.github.com/v3/users/followers>`_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
return github.PaginatedList.PaginatedList(
NamedUser,
self._requester,
self.url + "/followers",
None
)
python类NamedUser()的实例源码
def get_following(self):
"""
:calls: `GET /users/:user/following <http://developer.github.com/v3/users/followers>`_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
return github.PaginatedList.PaginatedList(
NamedUser,
self._requester,
self.url + "/following",
None
)
def has_in_following(self, following):
"""
:calls: `GET /users/:user/following/:target_user <http://developer.github.com/v3/users/followers/#check-if-one-user-follows-another>`_
:param following: :class:`github.NamedUser.NamedUser`
:rtype: bool
"""
assert isinstance(following, github.NamedUser.NamedUser), following
status, headers, data = self._requester.requestJson(
"GET",
self.url + "/following/" + following._identity
)
return status == 204
def user(self):
"""
:type: :class:`github.NamedUser`
"""
return self._user.value
def _useAttributes(self, attributes):
if 'starred_at' in attributes:
self._starred_at = self._makeDatetimeAttribute(attributes['starred_at'])
if 'user' in attributes:
self._user = self._makeClassAttribute(github.NamedUser.NamedUser, attributes['user'])
def get_followers(self):
"""
:calls: `GET /users/:user/followers <http://developer.github.com/v3/users/followers>`_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
return github.PaginatedList.PaginatedList(
NamedUser,
self._requester,
self.url + "/followers",
None
)
def get_following(self):
"""
:calls: `GET /users/:user/following <http://developer.github.com/v3/users/followers>`_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
return github.PaginatedList.PaginatedList(
NamedUser,
self._requester,
self.url + "/following",
None
)
def has_in_following(self, following):
"""
:calls: `GET /users/:user/following/:target_user <http://developer.github.com/v3/users/followers/#check-if-one-user-follows-another>`_
:param following: :class:`github.NamedUser.NamedUser`
:rtype: bool
"""
assert isinstance(following, github.NamedUser.NamedUser), following
status, headers, data = self._requester.requestJson(
"GET",
self.url + "/following/" + following._identity
)
return status == 204
def user(self):
"""
:type: :class:`github.NamedUser`
"""
return self._user.value
def _useAttributes(self, attributes):
if 'starred_at' in attributes:
self._starred_at = self._makeDatetimeAttribute(attributes['starred_at'])
if 'user' in attributes:
self._user = self._makeClassAttribute(github.NamedUser.NamedUser, attributes['user'])
def get_followers(self):
"""
:calls: `GET /users/:user/followers <http://developer.github.com/v3/users/followers>`_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
return github.PaginatedList.PaginatedList(
NamedUser,
self._requester,
self.url + "/followers",
None
)
def get_following(self):
"""
:calls: `GET /users/:user/following <http://developer.github.com/v3/users/followers>`_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
return github.PaginatedList.PaginatedList(
NamedUser,
self._requester,
self.url + "/following",
None
)
def has_in_following(self, following):
"""
:calls: `GET /users/:user/following/:target_user <http://developer.github.com/v3/users/followers/#check-if-one-user-follows-another>`_
:param following: :class:`github.NamedUser.NamedUser`
:rtype: bool
"""
assert isinstance(following, github.NamedUser.NamedUser), following
status, headers, data = self._requester.requestJson(
"GET",
self.url + "/following/" + following._identity
)
return status == 204
def user(self):
"""
:type: :class:`github.NamedUser`
"""
return self._user.value
def _useAttributes(self, attributes):
if 'starred_at' in attributes:
self._starred_at = self._makeDatetimeAttribute(attributes['starred_at'])
if 'user' in attributes:
self._user = self._makeClassAttribute(github.NamedUser.NamedUser, attributes['user'])
def get_followers(self):
"""
:calls: `GET /users/:user/followers <http://developer.github.com/v3/users/followers>`_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
return github.PaginatedList.PaginatedList(
NamedUser,
self._requester,
self.url + "/followers",
None
)
def get_following(self):
"""
:calls: `GET /users/:user/following <http://developer.github.com/v3/users/followers>`_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
return github.PaginatedList.PaginatedList(
NamedUser,
self._requester,
self.url + "/following",
None
)
def has_in_following(self, following):
"""
:calls: `GET /users/:user/following/:target_user <http://developer.github.com/v3/users/followers/#check-if-one-user-follows-another>`_
:param following: :class:`github.NamedUser.NamedUser`
:rtype: bool
"""
assert isinstance(following, github.NamedUser.NamedUser), following
status, headers, data = self._requester.requestJson(
"GET",
self.url + "/following/" + following._identity
)
return status == 204
def user(self):
"""
:type: :class:`github.NamedUser`
"""
return self._user.value
def _useAttributes(self, attributes):
if 'starred_at' in attributes:
self._starred_at = self._makeDatetimeAttribute(attributes['starred_at'])
if 'user' in attributes:
self._user = self._makeClassAttribute(github.NamedUser.NamedUser, attributes['user'])
def get_followers(self):
"""
:calls: `GET /users/:user/followers <http://developer.github.com/v3/users/followers>`_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
return github.PaginatedList.PaginatedList(
NamedUser,
self._requester,
self.url + "/followers",
None
)
def get_following(self):
"""
:calls: `GET /users/:user/following <http://developer.github.com/v3/users/followers>`_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
return github.PaginatedList.PaginatedList(
NamedUser,
self._requester,
self.url + "/following",
None
)
def has_in_following(self, following):
"""
:calls: `GET /users/:user/following/:target_user <http://developer.github.com/v3/users/followers/#check-if-one-user-follows-another>`_
:param following: :class:`github.NamedUser.NamedUser`
:rtype: bool
"""
assert isinstance(following, github.NamedUser.NamedUser), following
status, headers, data = self._requester.requestJson(
"GET",
self.url + "/following/" + following._identity
)
return status == 204
def user(self):
"""
:type: :class:`github.NamedUser`
"""
return self._user.value
def _useAttributes(self, attributes):
if 'starred_at' in attributes:
self._starred_at = self._makeDatetimeAttribute(attributes['starred_at'])
if 'user' in attributes:
self._user = self._makeClassAttribute(github.NamedUser.NamedUser, attributes['user'])