22# -*- coding: utf-8 -*-
33
44import os
5- import ujson
6- import requests
75
86from . import exceptions
9- from .core .handler_response import SDHandlerResponse
107from .core .requester import Requester
118
129
@@ -33,16 +30,6 @@ def __init__(
3330 master_key , custom_key , read_key , write_key )
3431 self ._api_key = self ._get_key ()[0 ]
3532 self ._requester = Requester (use_ssl , timeout )
36- self .__status_code = None
37- self .__headers = None
38-
39- @property
40- def status_code (self ):
41- return self .__status_code
42-
43- @property
44- def headers (self ):
45- return self .__headers
4633
4734 @staticmethod
4835 def _organize_keys (master_key , custom_key , read_key , write_key ):
@@ -122,24 +109,3 @@ async def _make_request(self, url, req_type, key_level, json_data=None,
122109
123110 status , result = await req
124111 return result
125-
126- @staticmethod
127- def _check_request (request ):
128- """Check if the request was successful
129-
130- Keyword arguments:
131- request -- A object request result
132- """
133- if request .status_code is not requests .codes .ok :
134- raise exceptions .SlicingDiceHTTPError (
135- "HTTP status code: {}" .format (request .status_code ))
136- return True
137-
138- def _set_properties_values (self , sd_response ):
139- """Set current status code and header request response in objects
140-
141- Keyword arguments:
142- sd_response -- A request object
143- """
144- self .__status_code = int (sd_response .status_code )
145- self .__headers = dict (sd_response .headers )
0 commit comments