
    9i	                     .    S r SSKrSSKJr  S rS rS rg)zh
This module provides general http handler functions for processing http responses from media services.
    N)utilsc                    0 n[         R                  " U 5       HQ  u  p#[        U[         R                  R                  5      (       d  [         R                  R                  U5      nX1U'   MS     [         R                  " U5      $ )z]
dict to python object without converting camel key to a "pythonic" name

:param d:
:return:
)r   	iteritems
isinstancecompatstring_typesconvert_to_stringExpando)dattrkvs       e/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/baidubce/services/media/media_handler.pydict_to_python_objectr      sa     D"!U\\6677..q1AQ # ==    c                    U R                  5       nU(       a[  [        R                  R                  U5      nUR                  R                  [        R                  " U[        S9R                  5        U R                  5         g)a  If the body is not empty, convert it to a python object and set as the value of
response.body. http_response is always closed if no error occurs.

:param http_response: the http_response object returned by HTTPConnection.getresponse()
:type http_response: httplib.HTTPResponse

:param response: general response object which will be returned to the caller
:type response: baidubce.BceResponse

:return: always true
:rtype bool
)object_hookT)
readr   r   r	   __dict__updatejsonloadsr   closehttp_responseresponsebodys      r   
parse_jsonr   $   s^     D||--d3  D>S!T!]!]^r   c                     U R                  5       nU(       a%  [        R                  R                  U5      nX!l        U R                  5         g)ag  If the body is not empty, set body content as secretKey attribute of response

:param http_response: the http_response object returned by HTTPConnection.getresponse()
:type http_response: httplib.HTTPResponse

:param response: general response object which will be returned to the caller
:type response: baidubce.BceResponse

:return: always true
:rtype bool
T)r   r   r   r	   encryption_keyr   r   s      r   parse_secret_key_responser!   9   s>     D||--d3"&r   )__doc__r   baidubcer   r   r   r!    r   r   <module>r%      s!     *r   