forked from sigmavirus24/github3.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepository.py
More file actions
26 lines (19 loc) · 745 Bytes
/
Copy pathrepository.py
File metadata and controls
26 lines (19 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from ..models import GitHubCore
from ..repos import Repository
class RepositorySearchResult(GitHubCore):
def _update_attributes(self, data):
result = data.copy()
#: Score of the result
self.score = self._get_attribute(result, 'score')
if 'score' in result:
del result['score']
#: Text matches
self.text_matches = self._get_attribute(result, 'text_matches', [])
if 'text_matches' in result:
del result['text_matches']
#: Repository object
self.repository = Repository(result, self)
def _repr(self):
return '<RepositorySearchResult [{0}]>'.format(self.repository)