ÿØÿà JFIF      ÿÛ C      

!"$"$ÿÛ C  ÿÂ p " ÿÄ              ÿÄ             ÿÚ    ÕÔË®
(%	aA*‚XYD¡(J„¡E¢RE,P€XYae )(E¤²€B¤R¥	BQ¤¢ X«)X…€¤   @  

  ..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ C      

!"$"$ÿÛ C  ÿÂ p " ÿÄ              ÿÄ             ÿÚ    ÕÔË®
(%	aA*‚XYD¡(J„¡E¢RE,P€XYae )(E¤²€B¤R¥	BQ¤¢ X«)X…€¤   @  

  ..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     
;;Wgc           @   sy  d  d d g Z  d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l	 m
 Z
 m Z d d l m Z m Z m Z m Z d d l m Z m Z d Z d	 Z e j   Z d
 Z d
 g Z e e d  r	d Z e d g 7Z n  e j d k r.d Z e d g 7Z n  e d  Z d   Z d   Z d   Z d e  f d     YZ! d d d  Z# e j d k re$ d  Z% n d d l m& Z& e$ d  Z% d e  f d     YZ' d   Z( e j d k rd e  f d     YZ) d   Z* n  d Z+ d Z, d Z- d  Z. d!   Z/ d"   Z0 d# e  f d$     YZ1 d%   Z2 d&   Z3 d' e! f d(     YZ4 d)   Z5 d S(*   t   Clientt   Listenert   PipeiN(   t   current_processt   AuthenticationError(   t   get_temp_dirt   Finalizet	   sub_debugt   debug(   t	   duplicatet   closei    g      4@t   AF_INETt   AF_UNIXt   win32t   AF_PIPEc         C   s   t  j    |  S(   N(   t   time(   t   timeout(    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyt   _init_timeoutI   s    c         C   s   t  j    |  k S(   N(   R   (   t   t(    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyt   _check_timeoutL   s    c         C   s}   |  d k r d S|  d k r5 t  j d d d t    S|  d k rm t  j d d	 t j   t j   f d d
  St d   d S(   s?   
    Return an arbitrary free address for the given family
    R   t	   localhosti    R   t   prefixs	   listener-t   dirR   s   \\.\pipe\pyc-%d-%d-t    s   unrecognized familyN(   R   i    (   t   tempfilet   mktempR   t   ost   getpidt   _mmap_countert   nextt
   ValueError(   t   family(    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyt   arbitrary_addressS   s     c         C   se   t  |   t k r d St  |   t k r; |  j d  r; d St  |   t k rQ d St d |    d S(   s]   
    Return the types of the address

    This can be 'AF_INET', 'AF_UNIX', or 'AF_PIPE'
    R   s   \\R   R   s   address type of %r unrecognizedN(   t   typet   tuplet   strt
   startswithR   (   t   address(    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyt   address_typeb   s    !c           B   sS   e  Z d  Z d d d d d  Z d   Z d   Z e d    Z e d    Z	 RS(   s   
    Returns a listener object.

    This is a wrapper for a bound socket which is 'listening' for
    connections, or for a Windows named pipe.
    i   c         C   s   | p | r t  |  p t } | p- t |  } | d k rQ t | |  |  _ n t | | |  |  _ | d  k	 r t | t  r t	 d  n  | |  _
 d  S(   NR   s   authkey should be a byte string(   R&   t   default_familyR    t   PipeListenert	   _listenert   SocketListenert   Nonet
   isinstancet   bytest	   TypeErrort   _authkey(   t   selfR%   R   t   backlogt   authkey(    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyt   __init__|   s    c         C   s?   |  j  j   } |  j r; t | |  j  t | |  j  n  | S(   sz   
        Accept a connection on the bound socket or named pipe of `self`.

        Returns a `Connection` object.
        (   R)   t   acceptR/   t   deliver_challenget   answer_challenge(   R0   t   c(    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR4      s
    	c         C   s   |  j  j   S(   sA   
        Close the bound socket or named pipe of `self`.
        (   R)   R
   (   R0   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR
      s    c         C   s
   |  j  j S(   N(   R)   t   _address(   R0   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyt   <lambda>   R   c         C   s
   |  j  j S(   N(   R)   t   _last_accepted(   R0   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR9      R   N(
   t   __name__t
   __module__t   __doc__R+   R3   R4   R
   t   propertyR%   t   last_accepted(    (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR   u   s   		c         C   s   | p t  |   } | d k r- t |   } n t |   } | d k	 ra t | t  ra t d  n  | d k	 r t | |  t | |  n  | S(   s=   
    Returns a connection to the address of a `Listener`
    R   s   authkey should be a byte stringN(	   R&   t
   PipeClientt   SocketClientR+   R,   R-   R.   R6   R5   (   R%   R   R2   R7   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR       s    c         C   s   |  r t  j   \ } } | j t  | j t  t j t j | j     } t j t j | j     } | j	   | j	   n< t j
   \ } } t j | d t } t j | d t } | | f S(   sL   
        Returns pair of connection objects at either end of a pipe
        t   writablet   readable(   t   sockett
   socketpairt   setblockingt   Truet   _multiprocessingt
   ConnectionR   t   dupt   filenoR
   t   pipet   False(   t   duplext   s1t   s2t   c1t   c2t   fd1t   fd2(    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR      s    
(   R   c      	   C   sU  t  d  } |  r; t j } t j t j B} t t } } n t j } t j } d t } } t j | | t j t j	 Bt j
 Bd | | t j t j  } t j | | d t j t j d t j  } t j | t j	 d d  y t j | t j  Wn/ t k
 r } | j d t j k r!  q!n Xt j | d |  }	 t j | d |  }
 |	 |
 f S(   sL   
        Returns pair of connection objects at either end of a pipe
        R   i    i   RB   RC   N(   R    R   t   PIPE_ACCESS_DUPLEXt   GENERIC_READt   GENERIC_WRITEt   BUFSIZEt   PIPE_ACCESS_INBOUNDt   CreateNamedPipet   PIPE_TYPE_MESSAGEt   PIPE_READMODE_MESSAGEt	   PIPE_WAITt   NMPWAIT_WAIT_FOREVERt   NULLt
   CreateFilet   OPEN_EXISTINGt   SetNamedPipeHandleStateR+   t   ConnectNamedPipet   WindowsErrort   argst   ERROR_PIPE_CONNECTEDRH   t   PipeConnection(   RN   R%   t   openmodet   accesst   obsizet   ibsizet   h1t   h2t   eRQ   RR   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR      s2    			$
R*   c           B   s,   e  Z d  Z d d  Z d   Z d   Z RS(   sO   
    Representation of a socket which is bound to an address and listening
    i   c         C   s   t  j  t t  |   |  _ yb |  j j t  j t  j d  |  j j t  |  j j |  |  j j	 |  |  j j
   |  _ Wn$ t  j k
 r |  j j     n X| |  _ d  |  _ | d k r t |  t j d | f d d |  _ n	 d  |  _ d  S(   Ni   R   Re   t   exitpriorityi    (   RD   t   getattrt   _sockett
   setsockoptt
   SOL_SOCKETt   SO_REUSEADDRRF   RG   t   bindt   listent   getsocknameR8   t   errorR
   t   _familyR+   R:   R   R   t   unlinkt   _unlink(   R0   R%   R   R1   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR3      s     		$c         C   s   x\ t  r^ y |  j j   \ } |  _ Wn2 t j k
 rY } | j d t j k r[   q[ q XPq W| j	 t   t
 | j    } t j |  } | j   | S(   Ni    (   RG   Rq   R4   R:   RD   Rx   Re   t   errnot   EINTRRF   R	   RK   RH   RI   R
   (   R0   t   sRn   t   fdt   conn(    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR4     s    	

c         C   sA   z |  j  j   Wd  |  j } | d  k	 r< d  |  _ |   n  Xd  S(   N(   Rq   R
   R{   R+   (   R0   Rz   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR
     s    		(   R;   R<   R=   R3   R4   R
   (    (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR*      s   	c         C   s   t  t t |    } t   } x t j |  } | j t  y | j |   Wnb t j k
 r } | j   | j	 d t
 j k s t |  r t d |     n  t j d  q! XPq! W  t | j    } t j |  } | j   | S(   sO   
    Return a connection object connected to the socket given by `address`
    i    s   failed to connect to address %sg{Gz?(   Rp   RD   R&   R   RF   RG   t   connectRx   R
   Re   R|   t   ECONNREFUSEDR   R   R   t   sleepR	   RK   RH   RI   (   R%   R   R   R~   Rn   R   R   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyRA   )  s&    	
"
R(   c           B   s2   e  Z d  Z d d  Z d   Z e d    Z RS(   s0   
        Representation of a named pipe
        c      	   C   s   | |  _  t j | t j t j t j Bt j Bt j t t t j	 t j
  } | g |  _ d  |  _ t d |  j   t |  t j d |  j |  j  f d d |  _ d  S(   Ns    listener created with address=%rRe   Ro   i    (   R8   R   RZ   RU   R[   R\   R]   t   PIPE_UNLIMITED_INSTANCESRX   R^   R_   t   _handle_queueR+   R:   R   R   R(   t   _finalize_pipe_listenerR
   (   R0   R%   R1   t   handle(    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR3   O  s    			c      	   C   s   t  j |  j t  j t  j t  j Bt  j Bt  j t t t  j	 t  j
  } |  j j |  |  j j d  } y t  j | t  j
  Wn8 t k
 r } | j d t  j t  j f k r   q n Xt j |  S(   Ni    (   R   RZ   R8   RU   R[   R\   R]   R   RX   R^   R_   R   t   appendt   popRc   Rd   Re   Rf   t   ERROR_NO_DATARH   Rg   (   R0   t	   newhandleR   Rn   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR4   b  s    
c         C   s,   t  d |  x |  D] } t |  q Wd  S(   Ns    closing listener with address=%r(   R   R
   (   t   queueR%   R   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR   v  s    N(   R;   R<   R=   R+   R3   R4   t   staticmethodR   (    (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR(   K  s   	c         C   s   t    } x yH t j |  d  t j |  t j t j Bd t j t j d t j  } WnD t k
 r } | j	 d t j
 t j f k s t |  r   q q XPq W  t j | t j d d  t j |  S(   sU   
        Return a connection object connected to the pipe given by `address`
        i  i    N(   R   R   t   WaitNamedPipeR`   RV   RW   R_   Ra   Rd   Re   t   ERROR_SEM_TIMEOUTt   ERROR_PIPE_BUSYR   Rb   R\   R+   RH   Rg   (   R%   R   t   hRn   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR@   |  s     	"
i   s   #CHALLENGE#s	   #WELCOME#s	   #FAILURE#c         C   s   d d  l  } t | t  s! t  t j t  } |  j t |  | j	 | |  j
   } |  j d  } | | k r |  j t  n |  j t  t d   d  S(   Nii   s   digest received was wrong(   t   hmacR,   R-   t   AssertionErrorR   t   urandomt   MESSAGE_LENGTHt
   send_bytest	   CHALLENGEt   newt   digestt
   recv_bytest   WELCOMEt   FAILURER   (   t
   connectionR2   R   t   messageR   t   response(    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR5     s    c         C   s   d d  l  } t | t  s! t  |  j d  } | t t   t k sV t d |   | t t  } | j | |  j   } |  j	 |  |  j d  } | t
 k r t d   n  d  S(   Nii   s   message = %rs   digest sent was rejected(   R   R,   R-   R   R   t   lenR   R   R   R   R   R   (   R   R2   R   R   R   R   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR6     s    &t   ConnectionWrapperc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   sO   | |  _  | |  _ | |  _ x- d D]% } t | |  } t |  | |  q" Wd  S(   NRK   R
   t   pollR   R   (   RK   R
   R   R   R   (   t   _connt   _dumpst   _loadsRp   t   setattr(   R0   R   t   dumpst   loadst   attrt   obj(    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR3     s    			c         C   s#   |  j  |  } |  j j |  d  S(   N(   R   R   R   (   R0   R   R~   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyt   send  s    c         C   s   |  j  j   } |  j |  S(   N(   R   R   R   (   R0   R~   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyt   recv  s    (   R;   R<   R3   R   R   (    (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR     s   		c         C   s   t  j |  f d  d  d  d  S(   Ni   (   t	   xmlrpclibR   R+   (   R   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyt
   _xml_dumps  s    c         C   s   t  j |   \ \ } } | S(   N(   R   R   (   R~   R   t   method(    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyt
   _xml_loads  s    t   XmlListenerc           B   s   e  Z d    Z RS(   c         C   s+   d d  l  a  t j |   } t | t t  S(   Ni(   R   R   R4   R   R   R   (   R0   R   (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR4     s    (   R;   R<   R4   (    (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyR     s   c          O   s%   d d  l  a  t t |  |   t t  S(   Ni(   R   R   R    R   R   (   Re   t   kwds(    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyt	   XmlClient  s    (6   t   __all__R   t   sysRD   R|   R   R   t	   itertoolsRH   t   multiprocessingR   R   t   multiprocessing.utilR   R   R   R   t   multiprocessing.forkingR	   R
   RX   t   CONNECTION_TIMEOUTt   countR   R'   t   familiest   hasattrt   platformR   R   R    R&   t   objectR   R+   R    RG   R   R   R*   RA   R(   R@   R   R   R   R   R5   R6   R   R   R   R   R   (    (    (    s0   /usr/lib/python2.7/multiprocessing/connection.pyt   <module>#   s`   "				,*2	 1				