MCPcopy
hub / github.com/donnemartin/gitsome / _json

Method _json

gitsome/lib/github3/models.py:152–168  ·  view source on GitHub ↗
(self, response, status_code, include_cache_info=True)

Source from the content-addressed store, hash-verified

150 return instance_class(json)
151
152 def _json(self, response, status_code, include_cache_info=True):
153 ret = None
154 if self._boolean(response, status_code, 404) and response.content:
155 __logs__.info('Attempting to get JSON information from a Response '
156 'with status code %d expecting %d',
157 response.status_code, status_code)
158 ret = response.json()
159 headers = response.headers
160 if (include_cache_info and
161 (headers.get('Last-Modified') or headers.get('ETag')) and
162 isinstance(ret, dict)):
163 ret['Last-Modified'] = response.headers.get(
164 'Last-Modified', ''
165 )
166 ret['ETag'] = response.headers.get('ETag', '')
167 __logs__.info('JSON was %sreturned', 'not ' if ret is None else '')
168 return ret
169
170 def _boolean(self, response, true_code, false_code):
171 if response is not None:

Callers 15

ratelimit_remainingMethod · 0.95
refreshMethod · 0.95
set_subscriptionMethod · 0.80
subscriptionMethod · 0.80
setMethod · 0.80
editMethod · 0.80
inviteMethod · 0.80
membership_forMethod · 0.80
create_repositoryMethod · 0.80
create_teamMethod · 0.80
editMethod · 0.80
teamMethod · 0.80

Calls 3

_booleanMethod · 0.95
infoMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected