aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/services/users.py
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2012-02-04 19:07:23 +0100
committerDavid Medina <davidmedina9@gmail.com>2012-02-04 19:07:23 +0100
commit8a723b0815841ea9e34c148b06c0fa6529b90e33 (patch)
tree6161c4aef077d2ac9e2430d935f53e37117a0b9b /pygithub3/services/users.py
parentFull support to Result dynamic and lazy iterator (diff)
downloadpython-github3-8a723b0815841ea9e34c148b06c0fa6529b90e33.tar.xz
python-github3-8a723b0815841ea9e34c148b06c0fa6529b90e33.zip
Renaming (What I was thinking?)
resources => ghrequests models => resources + Also it's near to complete user service
Diffstat (limited to 'pygithub3/services/users.py')
-rw-r--r--pygithub3/services/users.py31
1 files changed, 20 insertions, 11 deletions
diff --git a/pygithub3/services/users.py b/pygithub3/services/users.py
index 70826f2..c4878dd 100644
--- a/pygithub3/services/users.py
+++ b/pygithub3/services/users.py
@@ -2,7 +2,6 @@
# -*- encoding: utf-8 -*-
from .base import Base
-from pygithub3.core.resources import Factory
class Keys(Base):
@@ -13,20 +12,30 @@ class Keys(Base):
class Followers(Base):
- def list(self, user):
- pass
+ def list(self, user=None):
+ self.config_request(user=user or self.client.user)
+ return self._get_result('users.followers.list')
+
+ def list_following(self, user=None):
+ self.config_request(user=user or self.client.user)
+ return self._get_result('users.followers.listfollowing')
+ def unfollow(self, user):
+ self.config_request(user=user)
+ self._delete('users.followers.unfollow')
class Emails(Base):
def list(self):
- pass
+ return self._get_result('users.emails.list')
- def add(self):
- pass
+ def add(self, *args):
+ self.config_request(emails=args)
+ return self._post('users.emails.add')
- def delete(self):
- pass
+ def delete(self, *args):
+ self.config_request(emails=args)
+ self._delete('users.emails.delete')
class User(Base):
@@ -37,9 +46,9 @@ class User(Base):
self.followers = Followers(**kwargs)
super(User, self).__init__(**kwargs)
- def get(self, user):
- resource = Factory(user=user or self.client.user)
- return self._get_result(resource('users.get'))
+ def get(self, user=None):
+ self.config_request(user=user or self.client.user)
+ return self._get('users.get')
def update(self):
pass