Skip to content
This repository was archived by the owner on Oct 24, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
beebe5c
Testing post gist
copitux Oct 29, 2011
c23698e
Wip on handlers
copitux Oct 29, 2011
b17dbea
Decouple Handlers and Models
copitux Nov 1, 2011
2506d0e
Merge branch 'handlers' into develop
copitux Nov 1, 2011
51d258b
Fix bug. Import own exceptions
copitux Nov 1, 2011
c0a5c2c
Fix bug. PEP8
copitux Nov 1, 2011
15b7cc0
Fix names. Added raw request
copitux Nov 1, 2011
d57caeb
Fix bug generate_url
copitux Nov 1, 2011
aeed4c5
Add get_bool request
copitux Nov 1, 2011
81f483a
Complete AuthUser handler
copitux Nov 1, 2011
bb54072
Refactor base to handler design
copitux Nov 4, 2011
bdc593a
Fix litle bugs and args to request
copitux Nov 5, 2011
7616bc8
Handlers and paginate resources
copitux Nov 5, 2011
dfc3826
Added gitignore, it doesn't matter
copitux Nov 6, 2011
df73c78
Doc and refactorize
copitux Nov 6, 2011
79b46e9
Cleaning files from origin repo
copitux Nov 6, 2011
6f2d211
Modelizer class. json<->model parser
copitux Nov 6, 2011
b9dc036
Fix typo
copitux Nov 7, 2011
a423c22
_post_resource
akaihola Nov 7, 2011
6d7b654
Added the create_gist() method
akaihola Nov 7, 2011
86da17c
Added akaihola to authors
akaihola Nov 7, 2011
878a2fa
Added create_gist() example to readme
akaihola Nov 7, 2011
e738e47
Fix clean
copitux Nov 8, 2011
d783e25
Abstract and decouple converters
copitux Nov 8, 2011
88f3b88
Added post_resource to handler
copitux Nov 8, 2011
a7cb909
Prefix handlers
copitux Nov 8, 2011
6dc5997
Added User/AuthUser handler
copitux Nov 8, 2011
c614dde
Added support for extra args to get_resources
copitux Nov 8, 2011
ba1fcac
Support for proxys in _bool handler
copitux Nov 8, 2011
40cbe59
Fixing bugs. Crazy night :S
copitux Nov 9, 2011
f1a03e9
Merged create_gist() into current HEAD of copitux/develop
akaihola Nov 9, 2011
15fd929
Updated example in README.rst to work with current version
akaihola Nov 9, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Complete AuthUser handler
  • Loading branch information
copitux committed Nov 1, 2011
commit 81f483aabf6d40f7d3379fb2a85ecb6a5fd218fb
12 changes: 12 additions & 0 deletions github3/handlers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,15 @@ def get(self):
def get_emails(self):
return self._get_raw('emails')

def get_is_following(self, user):
username = getattr(user, 'login', False)
if not username:
username = user
return self._get_bool('following', username)

def get_keys(self):
return self._get_resources('keys', model=models.Key)

def get_key(self, key_id):
return self._get_resource('keys', key_id, model=models.Key)

2 changes: 1 addition & 1 deletion github3/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .user import AuthUser, User
from .user import AuthUser, User, Key
from .repos import Repo
from .orgs import Org
from .gists import Gist
9 changes: 9 additions & 0 deletions github3/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ class Plan(BaseResource):
def __repr__(self):
return '<Plan {0}>'.format(str(self.name))

class Key(BaseResource):
"""Github Key object model."""

_strs = ['url', 'title', 'key']
_ints = ['id']

def __repr__(self):
return '<Key {0}>'.format(str(self.title))

class User(BaseResource):
"""Github User object model."""

Expand Down