common.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:tintri-python-sdk 作者: Tintri 项目源码 文件源码
def _process_result(self, method, url, response, request_class, response_class, query_params, path_params):
        cls = response_class and response_class or request_class
        if cls in [types.StringType, types.UnicodeType]: # if we expect string type result, no need for further processing
            return response.text
        else:
            # prepare context to hold url and data along with method to navigate pages
            context = { 'method': method, 'url': url, 'query_params': query_params, 'response_class': response_class, 'func': self._get_all, 'request_class': request_class, 'path_params': path_params, 'response_data': response.text }
            return self._json_object_to_object(json.loads(response.text), cls, context=context) # first load JSON to a Python list or dict
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号