File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ from github3 .models import GitHubCore
2
+ from github3 .repos import Repository
3
+
4
+
5
+ class CodeSearchResult (GitHubCore ):
6
+ def __init__ (self , data , session = None ):
7
+ super (CodeSearchResult , self ).__init__ (data , session )
8
+ self ._api = data .get ('url' )
9
+ #: Filename the match occurs in
10
+ self .name = data .get ('name' )
11
+ #: Path in the repository to the file
12
+ self .path = data .get ('path' )
13
+ #: SHA in which the code can be found
14
+ self .sha = data .get ('sha' )
15
+ #: URL to the Git blob endpoint
16
+ self .git_url = data .get ('git_url' )
17
+ #: URL to the HTML view of the blob
18
+ self .html_url = data .get ('html_url' )
19
+ #: Repository the code snippet belongs to
20
+ self .repository = Repository (data .get ('repository' , {}), self )
21
+ #: Score of the result
22
+ self .score = data .get ('score' )
23
+ #: Text matches
24
+ self .text_matches = data .get ('text_matches' , [])
You can’t perform that action at this time.
0 commit comments