
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
3
;j              
   @   s"  d dl Z ddlmZ ejrd dlZd dlmZ d dlmZ d dl	m	Z	 d dl
mZ d dl
mZ d d	l
mZ d d
l
mZ d dlmZ G dd deZdd Zdd Znbd dlm	Z	 d dlmZ d dlmZmZ d dlmZ d dlmZmZ d dlmZ d d
lmZ e jZddddddddddg
ZdS )    N   )	constants)quote)	urlencode)ConfigParser)	HTTPError)Request)URLError)urlopen)urlparsec               @   s   e Zd Zdd ZdS )r   c                s8   |j dd  tj| f||  dkr4 fdd| _d S )NmethodHEADc                  s   t  S )N)str )r   r   */usr/libexec/kcare/python/kcarectl/py23.py<lambda>   s    z"Request.__init__.<locals>.<lambda>)pop
StdRequest__init__Z
get_method)selfargskwargsr   )r   r   r      s    zRequest.__init__N)__name__
__module____qualname__r   r   r   r   r   r      s   r   c             C   sV   t | }|t dkr| jdS |tkr4dd | D S |tkrRtdd | j D S | S )N zutf-8c             S   s   g | ]}t |qS r   )_convert).0itr   r   r   
<listcomp>%   s    z_convert.<locals>.<listcomp>c             s   s"   | ]\}}t |t |fV  qd S )N)r   )r   kvr   r   r   	<genexpr>'   s    z_convert.<locals>.<genexpr>)typeencodelistdictitems)dataZdtyper   r   r   r       s    
r   c             C   s   t tj| S )N)r   jsonloads)Zjson_strr   r   r   json_loads_nstr*   s    r+   )client)r   r	   )r   r   r   r   r	   httplibstd_urlopenr   r   urlquote)r)   r   r   PY2r-   Zurllibr   r/   r   r   Zurllib2r   r   r   r	   r
   r.   r   r   r+   configparserZhttpr,   Zurllib.errorZurllib.parseZurllib.requestr*   __all__r   r   r   r   <module>   s@   

