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

Commitb6263fb

Browse files
committed
Add support for text-match header
1 parent9873f03 commitb6263fb

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

‎github3/github.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,15 +1018,26 @@ def search_repositories(self, query, sort=None, order=None,
10181018
"""
10191019
# TODO Describe the dictionary being returned
10201020
params= {'q':query}
1021+
headers= {}
10211022

10221023
ifsortin ('stars','forks','updated'):
10231024
params['sort']=sort
10241025

10251026
iforderin ('asc','desc'):
10261027
params['order']=order
10271028

1029+
iftext_match:
1030+
headers= {
1031+
'Accept':'application/vnd.github.v3.full.text-match+json'
1032+
}
1033+
10281034
url=self._build_url('search','repositories')
1029-
returnself._json(self._get(url,params=params),200)
1035+
results=self._json(self._get(url,params=params,headers=headers),
1036+
200)
1037+
repos_dicts=results['items']
1038+
repos= [Repository(r)forrinrepos_dicts]
1039+
results['repositories']=repos
1040+
returnresults
10301041

10311042
defset_client_id(self,id,secret):
10321043
"""Allows the developer to set their client_id and client_secret for

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp