Add highlight search to search_code function (#925)

*  add highlight search to search_code function

*  add highlighting search code tests
This commit is contained in:
h.shi
2018-10-10 16:38:47 +08:00
committed by Wan Liuyang
parent c13b43ea9c
commit 1fa25670f7
6 changed files with 39 additions and 3 deletions
+11
View File
@@ -165,8 +165,17 @@ class ContentFile(github.GithubObject.CompletableGithubObject):
self._completeIfNotSet(self._url)
return self._url.value
@property
def text_matches(self):
"""
:type: string
"""
self._completeIfNotSet(self._text_matches)
return self._text_matches.value
def _initAttributes(self):
self._content = github.GithubObject.NotSet
self._text_matches = github.GithubObject.NotSet
self._encoding = github.GithubObject.NotSet
self._download_url = github.GithubObject.NotSet
self._git_url = github.GithubObject.NotSet
@@ -206,3 +215,5 @@ class ContentFile(github.GithubObject.CompletableGithubObject):
self._type = self._makeStringAttribute(attributes["type"])
if "url" in attributes: # pragma no branch
self._url = self._makeStringAttribute(attributes["url"])
if "text_matches" in attributes: # pragma no branch
self._text_matches = self._makeListOfDictsAttribute(attributes["text_matches"])