forked from sigmavirus24/github3.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.py
More file actions
34 lines (22 loc) · 874 Bytes
/
user.py
File metadata and controls
34 lines (22 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .. import users
from ..models import GitHubCore
class UserSearchResult(GitHubCore):
"""Representation of a search result for a user.
This object has the following attributes:
.. attribute:: score
The confidence score of this result.
.. attribute:: text_matches
If present, a list of text strings that match the search string.
.. attribute:: user
A :class:`~github3.users.ShortUser` representing the user found
in this search result.
"""
def _update_attributes(self, data):
result = data.copy()
self.score = result.pop("score")
self.text_matches = result.pop("text_matches", [])
self.user = users.ShortUser(result, self)
def _repr(self):
return "<UserSearchResult [{0}]>".format(self.user)