File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
1
from .code import CodeSearchResult
2
2
from .repository import RepositorySearchResult
3
+ from .user import UserSearchResult
3
4
4
5
5
- __all__ = [CodeSearchResult , RepositorySearchResult ]
6
+ __all__ = [CodeSearchResult , RepositorySearchResult , UserSearchResult ]
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+ from github3 .models import GitHubCore
3
+ from github3 .users import User
4
+
5
+
6
+ class UserSearchResult (GitHubCore ):
7
+ def __init__ (self , data , session = None ):
8
+ super (UserSearchResult , self ).__init__ (data , session )
9
+ result = data .copy ()
10
+ #: Score of this search result
11
+ self .score = result .pop ('score' )
12
+ #: Text matches
13
+ self .text_matches = result .pop ('text_matches' , [])
14
+ #: User object matching the search
15
+ self .user = User (result , self )
16
+
17
+ def __repr__ (self ):
18
+ return '<UserSearchResult [{0}]>' .format (self .user )
You can’t perform that action at this time.
0 commit comments