diff options
author | 2011-07-24 11:40:47 -0400 | |
---|---|---|
committer | 2011-07-24 11:40:47 -0400 | |
commit | dc8d9e9447e070466c2219d691f993b423c3c8bd (patch) | |
tree | ba19227eed66bbbc84888b2b590a1255552bf221 | |
parent | is_authenticated (diff) | |
download | python-github3-dc8d9e9447e070466c2219d691f993b423c3c8bd.tar.xz python-github3-dc8d9e9447e070466c2219d691f993b423c3c8bd.zip |
CurrentUser
-rw-r--r-- | github3/api.py | 2 | ||||
-rw-r--r-- | github3/models.py | 24 |
2 files changed, 5 insertions, 21 deletions
diff --git a/github3/api.py b/github3/api.py index e97a699..f87a7b7 100644 --- a/github3/api.py +++ b/github3/api.py @@ -114,7 +114,7 @@ class Github(GithubCore): def get_me(self): """Get the authenticated user.""" - return self._get_resource(('user'), User) + return self._get_resource(('user'), CurrentUser) diff --git a/github3/models.py b/github3/models.py index b661bdd..fcaf184 100644 --- a/github3/models.py +++ b/github3/models.py @@ -85,14 +85,14 @@ class User(BaseResource): _dates = ['created_at',] _bools = ['hireable', ] _map = {} - _writeable = ['name', 'email', 'blog', 'company', 'location', 'hireable', 'bio'] + _writeable = [] def __repr__(self): return '<user {0}>'.format(self.login) -class User(BaseResource): - """Github User object model.""" +class CurrentUser(BaseResource): + """Github Current User object model.""" _strings = [ 'login','gravatar_url', 'url', 'name', 'company', 'blog', 'location', @@ -105,20 +105,4 @@ class User(BaseResource): _writeable = ['name', 'email', 'blog', 'company', 'location', 'hireable', 'bio'] def __repr__(self): - return '<user {0}>'.format(self.login) - - # def _update(self): - # """Update the User.""" - - # args = to_api( - # dict( - # favorite=self.favorite, - # archive=self.archive, - # read_percent=self.read_percent, - # ), - # int_keys=('favorite', 'archive') - # ) - - # r = self._rdd._post_resource(('bookmarks', self.id), **args) - - # return r
\ No newline at end of file + return '<current-user {0}>'.format(self.login) |