9
9
10
10
from .decorators import requires_auth
11
11
from .events import Event
12
- from .models import BaseAccount , GitHubCore
12
+ from .models import GitHubCore
13
13
14
14
15
15
class Key (GitHubCore ):
@@ -129,7 +129,7 @@ def __str__(self):
129
129
return self .email
130
130
131
131
132
- class User (BaseAccount ):
132
+ class User (GitHubCore ):
133
133
"""The :class:`User <User>` object.
134
134
135
135
This handles and structures information in the `User section`_.
@@ -149,10 +149,60 @@ class User(BaseAccount):
149
149
"""
150
150
151
151
def _update_attributes (self , user ):
152
- super (User , self )._update_attributes (user )
152
+ #: Tells you what type of account this is
153
+ self .type = self ._get_attribute (user , 'type' )
153
154
if not self .type :
154
155
self .type = 'User'
155
156
157
+ self ._api = self ._get_attribute (user , 'url' )
158
+
159
+ #: URL of the avatar at gravatar
160
+ self .avatar_url = self ._get_attribute (user , 'avatar_url' )
161
+
162
+ #: URL of the blog
163
+ self .blog = self ._get_attribute (user , 'blog' )
164
+
165
+
10000
#: Name of the company
166
+ self .company = self ._get_attribute (user , 'company' )
167
+
168
+ #: datetime object representing the date the account was created
169
+ self .created_at = self ._strptime_attribute (user , 'created_at' )
170
+
171
+ #: E-mail address of the user/org
172
+ self .email = self ._get_attribute (user , 'email' )
173
+
174
+ # The number of people following this user
175
+ #: Number of followers
176
+ self .followers_count = self ._get_attribute (user , 'followers' )
177
+
178
+ # The number of people this user follows
179
+ #: Number of people the user is following
180
+ self .following_count = self ._get_attribute (user , 'following' )
181
+
182
+ #: Unique ID of the account
183
+ self .id = self ._get_attribute (user , 'id' )
184
+
185
+ #: Location of the user/org
186
+ self .location = self ._get_attribute (user , 'location' )
187
+
188
+ #: User name of the user/organization
189
+ self .login = self ._get_attribute (user , 'login' )
190
+
191
+ # e.g. first_name last_name
192
+ #: Real name of the user/org
193
+ self .name = self ._get_attribute (user , 'name' )
194
+
195
+ # The number of public_repos
196
+ #: Number of public repos owned by the user/org
197
+ self .public_repos_count = self ._get_attribute (user , 'public_repos' )
198
+
199
+ # e.g. https://github.com/self._login
200
+ #: URL of the user/org's profile
201
+ self .html_url = self ._get_attribute (user , 'html_url' )
202
+
203
+ #: Markdown formatted biography
204
+ self .bio = self ._get_attribute (user , 'bio' )
205
+
156
206
#: ID of the user's image on Gravatar
157
207
self .gravatar_id = self ._get_attribute (user , 'gravatar_id' )
158
208
#: True -- for hire, False -- not for hire
@@ -230,6 +280,9 @@ def _update_attributes(self, user):
230
280
def __str__ (self ):
231
281
return self .login
232
282
283
+ def _repr (self ):
284
+ return '<User [{s.login}:{s.name}]>' .format (s = self )
285
+
233
286
def is_assignee_on (self , username , repository ):
234
287
"""Check if this user can be assigned to issues on username/repository.
235
288
0 commit comments