Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit94e7c97

Browse files
committed
Add a class to encapsulate these results
1 parentfe28ba8 commit94e7c97

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

‎github3/search/code.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
fromgithub3.modelsimportGitHubCore
2+
fromgithub3.reposimportRepository
3+
4+
5+
classCodeSearchResult(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', [])

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp