ó
—ã=Pc           @   sb   d  Z  d d l Z d d l Td d l m Z d d l m Z e e ƒ Z	 d e f d „  ƒ  YZ
 d S(   sF   
Contains transport interface (classes) and reference implementation.
iÿÿÿÿN(   t   *(   t   HttpTransport(   t	   getLoggert   HttpAuthenticatedc           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s<  
    Provides basic http authentication that follows the RFC-2617 specification.
    As defined by specifications, credentials are provided to the server
    upon request (HTTP/1.0 401 Authorization Required) by the server only.
    @ivar pm: The password manager.
    @ivar handler: The authentication handler.
    c         K   sM   t  j |  |  t j ƒ  |  _ t j |  j ƒ |  _ t j |  j ƒ |  _ d S(   sB  
        @param kwargs: Keyword arguments.
            - B{proxy} - An http proxy to be specified on requests.
                 The proxy is defined as {protocol:proxy,}
                    - type: I{dict}
                    - default: {}
            - B{timeout} - Set the url open timeout (seconds).
                    - type: I{float}
                    - default: 90
            - B{cache} - The http I{transport} cache.  May be set (None) for no caching.
                    - type: L{Cache}
                    - default: L{NoCache}
            - B{username} - The username used for http authentication.
                    - type: I{str}
                    - default: None
            - B{password} - The password used for http authentication.
                    - type: I{str}
                    - default: None
        N(	   R   t   __init__t   u2t   HTTPPasswordMgrWithDefaultRealmt   pmt   HTTPBasicAuthHandlert   handlert   build_openert	   urlopener(   t   selft   kwargs(    (    s,   suds-0.3.7-py2.6.egg/suds/transport/https.pyR   &   s    c         C   s[   |  j  ƒ  } d  | k rK | d } | d } |  j j d  | j | | ƒ n  t j |  | ƒ S(   Ni    i   (   t   credentialst   NoneR   t   add_passwordt   urlR   t   open(   R   t   requestR   t   ut   p(    (    s,   suds-0.3.7-py2.6.egg/suds/transport/https.pyR   ?   s    

c         C   s   |  j  j |  j  j f S(   N(   t   optionst   usernamet   password(   R   (    (    s,   suds-0.3.7-py2.6.egg/suds/transport/https.pyR   G   s    (   t   __name__t
   __module__t   __doc__R   R   R   (    (    (    s,   suds-0.3.7-py2.6.egg/suds/transport/https.pyR      s   		(   R   t   urllib2R   t   suds.transportt   suds.transport.httpR   t   loggingR   R   t   logR   (    (    (    s,   suds-0.3.7-py2.6.egg/suds/transport/https.pyt   <module>   s   
