o
    G1b  ã                   @   s"   d dl Z G dd„ deƒZeƒ ZdS )é    Nc                       s8   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Zdd	„ Z‡  ZS )
Ú
HttpConfigao  
    Configuration settings for httplib
    
    See 
    - python2 : https://docs.python.org/2/library/httplib.html#httplib.HTTPSConnection
    - python3 : https://docs.python.org/3.4/library/http.client.html#http.client.HTTPSConnection
    
    available settings 
    
    - http_key_file
    - http_cert_file
    - http_source_address
    - http_timeout
    
    c                    s   t ƒ j|i |¤Ž d| d< d S )Né   Útimeout)ÚsuperÚ__init__)ÚselfÚargsÚkwargs©Ú	__class__© ú/xhtml2pdf/config/httpconfig.pyr   %   s   zHttpConfig.__init__c                 C   s$   |dkrt  ¡ | d< d S || |< d S )NZ
nosslcheckÚcontext)ÚsslZ_create_unverified_context©r   ÚnameÚvaluer   r   r   Ú	save_keys(   s   zHttpConfig.save_keysc                 C   sV   |  d¡r|dd … }n|  d¡r|dd … }d|v r)| dd¡}|  ||¡ dS dS )	Nz--é   ú-é   Zhttp_Ú TF)Ú
startswithÚreplacer   r   r   r   r   Úis_http_config.   s   

zHttpConfig.is_http_configc                 C   s*   d}|   ¡ D ]\}}|d||f 7 }q|S )Nr   z	%r = %r, )Úitems)r   ÚdevÚkeyr   r   r   r   Ú__repr__:   s   zHttpConfig.__repr__)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   Ú__classcell__r   r   r
   r   r      s    r   )r   Údictr   Z
httpConfigr   r   r   r   Ú<module>   s   
-