ó
’wÛjc           @   sÖ  d  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
 Z
 d d l Z d d l Z d d l Z d d l Z d „  Z d „  Z e j e j e e ƒ d d Z d Z d e j f d	 „  ƒ  YZ i  Z e
 j
 d
 ƒ Z e
 j
 d
 ƒ Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d „  Z d e f d „  ƒ  YZ d e j e f d „  ƒ  YZ d e f d „  ƒ  YZ  d e f d „  ƒ  YZ! d „  Z" d „  Z# d e f d „  ƒ  YZ$ d S(   s  RPC Implementation, originally written for the Python Idle IDE

For security reasons, GvR requested that Idle's Python execution server process
connect to the Idle process, which listens for the connection.  Since Idle has
only one client per server, this was not a limitation.

   +---------------------------------+ +-------------+
   | SocketServer.BaseRequestHandler | | SocketIO    |
   +---------------------------------+ +-------------+
                   ^                   | register()  |
                   |                   | unregister()|
                   |                   +-------------+
                   |                      ^  ^
                   |                      |  |
                   | + -------------------+  |
                   | |                       |
   +-------------------------+        +-----------------+
   | RPCHandler              |        | RPCClient       |
   | [attribute of RPCServer]|        |                 |
   +-------------------------+        +-----------------+

The RPCServer handler class is expected to provide register/unregister methods.
RPCHandler inherits the mix-in class SocketIO, which provides these methods.

See the Idle run.main() docstring for further information on how this was
accomplished in Idle.

iÿÿÿÿNc         C   s   t  j |  ƒ } | S(   N(   t   marshalt   loads(   t   mst   co(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   unpickle_code-   s    c         C   s   t  j |  ƒ } t | f f S(   N(   R    t   dumpsR   (   R   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   pickle_code2   s    i   i   s	   127.0.0.1t	   RPCServerc           B   s8   e  Z d d  „ Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s/   | d  k r t } n  t j j |  | | ƒ d  S(   N(   t   Nonet
   RPCHandlert   SocketServert	   TCPServert   __init__(   t   selft   addrt   handlerclass(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR   G   s    	c         C   s   d S(   s@   Override TCPServer method, no bind() phase for connecting entityN(    (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   server_bindL   s    c         C   s   |  j  j |  j ƒ d S(   sÎ   Override TCPServer method, connect() instead of listen()

        Due to the reversed connection, self.server_address is actually the
        address of the Idle Client to which we are connecting.

        N(   t   sockett   connectt   server_address(   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   server_activateP   s    c         C   s   |  j  |  j f S(   s:   Override TCPServer method, return already connected socket(   R   R   (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   get_requestY   s    c         C   sÂ   y ‚  Wn´ t  k
 r ‚  n¡ t j } | d d d IJ| d IJ| d t j ƒ  j ƒ  IJ| d I| IJ| d It | ƒ IJt j d | ƒ | d	 IJ| d d IJt	 j
 d
 ƒ n Xd S(   sÜ   Override TCPServer method

        Error message goes to __stderr__.  No error message if exiting
        normally or socket raised EOF.  Other exceptions not handled in
        server code will cause os._exit.

        s   
t   -i(   s   Unhandled server exception!s
   Thread: %ss   Client Address: s	   Request: t   files#   
*** Unrecoverable, server exiting!i    N(   t
   SystemExitt   syst
   __stderr__t	   threadingt   currentThreadt   getNamet   reprt	   tracebackt	   print_exct   ost   _exit(   R   t   requestt   client_addresst   erf(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   handle_error]   s    	

N(   t   __name__t
   __module__R   R   R   R   R   R&   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR   E   s
   				i    t   SocketIOc           B   s  e  Z d  Z d d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d Z d Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! RS(   i    c         C   sd   t  j ƒ  |  _ | d  k	 r' | |  _ n  | |  _ | d  k rE t } n  | |  _ i  |  _ i  |  _	 d  S(   N(
   R   R   t
   sockthreadR   t	   debuggingt   sockt   objecttablet   objtablet	   responsest   cvars(   R   R,   R.   R+   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR   €   s    				c         C   s/   |  j  } d  |  _  | d  k	 r+ | j ƒ  n  d  S(   N(   R,   R   t   close(   R   R,   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR1   ‹   s    		c         C   s   t  j d ƒ d S(   s!   override for specific exit actioni    N(   R!   R"   (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   exithook‘   s    c         G   sf   |  j  s d  S|  j d t t j ƒ  j ƒ  ƒ } x" | D] } | d t | ƒ } q7 Wt j | IJd  S(   Nt    (   R+   t   locationt   strR   R   R   R   R   (   R   t   argst   st   a(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   debug•   s    	#c         C   s   | |  j  | <d  S(   N(   R.   (   R   t   oidt   object(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   register�   s    c         C   s&   y |  j  | =Wn t k
 r! n Xd  S(   N(   R.   t   KeyError(   R   R:   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt
   unregister    s    c         C   sÛ  |  j  d | ƒ y | \ } \ } } } } Wn t k
 r@ d SX| |  j k ra d d | f f S|  j | } | d k r— i  }	 t | |	 ƒ d |	 f S| d k rÀ i  }
 t | |
 ƒ d |
 f St | | ƒ sà d d | f f St | | ƒ } y� | d	 k r5| | | Ž  } t | t ƒ r+t	 | ƒ } n  d | f S| d
 k rat
 j | | | | f f ƒ d Sd d | f SWnd t k
 r†‚  nQ t j k
 rœ‚  n; d } t j | | | | f IJt j d t j ƒ d SXd  S(   Ns
   localcall:t   ERRORs   Bad request formats   Unknown object id: %rt   __methods__t   OKt   __attributes__s   Unsupported method name: %rt   CALLt   QUEUEt   QUEUEDs   Unsupported message type: %ssU   *** Internal Error: rpc.py:SocketIO.localcall()

 Object: %s 
 Method: %s 
 Args: %s
R   t	   EXCEPTION(   R?   s   Bad request format(   RE   N(   RF   N(   R9   t	   TypeErrorR.   t   _getmethodst   _getattributest   hasattrt   getattrt
   isinstancet   RemoteObjectt	   remotereft   request_queuet   putR   R   R   t   errorR   R   R   R    (   R   t   seqR#   t   howR:   t
   methodnameR6   t   kwargst   objt   methodst
   attributest   methodt   rett   msg(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt	   localcall¦   sL    


c         C   s8   |  j  d | | ƒ |  j | | | | ƒ } |  j | ƒ S(   Ns   remotecall:asynccall: (   R9   t	   asynccallt   asyncreturn(   R   R:   RT   R6   RU   RR   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt
   remotecallÐ   s    c         C   s8   |  j  d | | ƒ |  j | | | | ƒ } |  j | ƒ S(   Ns   remotequeue:asyncqueue: (   R9   t
   asyncqueueR^   (   R   R:   RT   R6   RU   RR   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   remotequeueÕ   s    c         C   s‰   d | | | | f f } |  j  ƒ  } t j ƒ  |  j k rU t j ƒ  } | |  j | <n  |  j d | | | | | ƒ |  j | | f ƒ | S(   NRC   s   asynccall:%d:(   t   newseqR   R   R*   t	   ConditionR0   R9   t
   putmessage(   R   R:   RT   R6   RU   R#   RR   t   cvar(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR]   Ú   s    c         C   s‰   d | | | | f f } |  j  ƒ  } t j ƒ  |  j k rU t j ƒ  } | |  j | <n  |  j d | | | | | ƒ |  j | | f ƒ | S(   NRD   s   asyncqueue:%d:(   Rb   R   R   R*   Rc   R0   R9   Rd   (   R   R:   RT   R6   RU   R#   RR   Re   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR`   ä   s    c         C   sG   |  j  d | ƒ |  j | d d ƒ} |  j  d | | ƒ |  j | ƒ S(   Ns#   asyncreturn:%d:call getresponse(): t   waitgš™™™™™©?s   asyncreturn:%d:response: (   R9   t   getresponset   decoderesponse(   R   RR   t   response(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR^   î   s    c         C   s«   | \ } } | d k r | S| d k r, d  S| d k rI |  j d ƒ d  S| d k rp |  j d ƒ |  j ƒ  d  S| d k r˜ |  j d | ƒ t | ‚ n  t | | f ‚ d  S(	   NRA   RE   RF   s   decoderesponse: EXCEPTIONt   EOFs   decoderesponse: EOFR?   s   decoderesponse: Internal ERROR:(   R   R9   t   decode_interrupthookt   RuntimeErrort   SystemError(   R   Ri   RS   t   what(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRh   ô   s     
c         C   s
   t  ‚ d S(   t    N(   t   EOFError(   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRk     s    c         C   s@   y |  j  d d d d ƒ Wn t k
 r; |  j d ƒ d SXd S(   s¥   Listen on socket until I/O not ready or EOF

        pollresponse() will loop looking for seq number None, which
        never comes, and exit on EOFError.

        t   myseqRf   gš™™™™™©?s   mainloop:returnN(   Rg   R   Rp   R9   (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   mainloop
  s
    c         C   sU   |  j  | | ƒ } | d  k	 rQ | \ } } | d k rQ | |  j | ƒ f } qQ n  | S(   NRA   (   t   _getresponseR   t   _proxify(   R   Rq   Rf   Ri   RS   Rn   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRg     s    c         C   sE   t  | t ƒ r t |  | j ƒ St  | t j ƒ rA t |  j | ƒ S| S(   N(   RL   t   RemoteProxyt   RPCProxyR:   t   typest   ListTypet   mapRt   (   R   RV   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRt     s
    c         C   sÒ   |  j  d | ƒ t j ƒ  |  j k rQ x¦ |  j | | ƒ } | d  k	 r( | Sq( Wn} |  j | } | j ƒ  x | |  j k r‡ | j	 ƒ  qk W|  j | } |  j  d | | f ƒ |  j | =|  j | =| j
 ƒ  | Sd  S(   Ns   _getresponse:myseq:s-   _getresponse:%s: thread woke up: response: %s(   R9   R   R   R*   t   pollresponseR   R0   t   acquireR/   Rf   t   release(   R   Rq   Rf   Ri   Re   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRs   '  s"    
	


c         C   s   |  j  d |  _  } | S(   Ni   (   t   nextseq(   R   RR   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRb   =  s    c         C   sÿ   |  j  d | d ƒ y t j | ƒ } Wn0 t j k
 rZ t j d It | ƒ IJ‚  n Xt j d t	 | ƒ ƒ | } x� t	 | ƒ d k rú y> t
 j
 g  |  j g g  ƒ \ } } } |  j j | t  ƒ } Wn  t t f k
 rì t d ‚ n X| | } qz Wd  S(   Ns   putmessage:%d:i    s   Cannot pickle:s   <is   socket no longer exists(   R9   t   pickleR   t   PicklingErrorR   R   R   t   structt   packt   lent   selectR,   t   sendt   BUFSIZEt   AttributeErrorRG   t   IOError(   R   t   messageR7   t   rt   wt   xt   n(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRd   A  s    $Ro   i   c         C   sÙ   |  j  ƒ  t |  j ƒ |  j k  rÏ t j |  j j ƒ  g g  g  | ƒ \ } } } t | ƒ d k re d  Sy |  j j t	 ƒ } Wn t
 j k
 r— t ‚ n Xt | ƒ d k r³ t ‚ n  |  j | 7_ |  j  ƒ  n  |  j ƒ  S(   Ni    (   t   _stage0R‚   t   buffert   bufneedRƒ   R,   t   filenoR   t   recvR…   R   RQ   Rp   t   _stage1(   R   Rf   R‰   RŠ   R‹   R7   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt
   pollpacketU  s    
-
	c         C   sj   |  j  d k rf t |  j ƒ d k rf |  j d  } |  j d |  _ t j d | ƒ d |  _ d |  _  n  d  S(   Ni    i   s   <ii   (   t   bufstateR‚   RŽ   R€   t   unpackR�   (   R   R7   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR�   e  s
    $c         C   sd   |  j  d k r` t |  j ƒ |  j k r` |  j |  j  } |  j |  j |  _ d |  _ d |  _  | Sd  S(   Ni   i   i    (   R”   R‚   RŽ   R�   (   R   t   packet(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR’   l  s    '		c         C   s–   |  j  | ƒ } | d  k r d  Sy t j | ƒ } Wn] t j k
 r‘ t j d IJt j d It | ƒ IJt j	 d t j ƒ t j d IJ‚  n X| S(   Ns   -----------------------s   cannot unpickle packet:R   (
   R“   R   R~   R   t   UnpicklingErrorR   R   R   R   t   print_stack(   R   Rf   R–   Rˆ   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   pollmessaget  s    c   
      C   s¿  x¸y t  j d ƒ } Wn t j k
 r, n, X| \ } } | d | f f } |  j | ƒ y# |  j | ƒ } | d k rz d SWn- t k
 r™ |  j ƒ  d St	 k
 rª d SX| \ } } | d } |  j
 d | | f ƒ | d	 k rU|  j
 d | ƒ |  j | | ƒ } |  j
 d | | f ƒ | d k r@|  j | | f ƒ q | d k r q q q | | k re| S|  j j | d ƒ }	 |	 d k	 r |	 j ƒ  | |  j | <|	 j ƒ  |	 j ƒ  q q q Wd S(
   sR  Handle messages received on the socket.

        Some messages received may be asynchronous 'call' or 'queue' requests,
        and some may be responses for other threads.

        'call' requests are passed to self.localcall() with the expectation of
        immediate execution, during which time the socket is not serviced.

        'queue' requests are used for tasks (which may block or hang) to be
        processed in a different thread.  These requests are fed into
        request_queue by self.localcall().  Responses to queued requests are
        taken from response_queue and sent across the link with the associated
        sequence numbers.  Messages in the queues are (sequence_number,
        request/response) tuples and code using this module removing messages
        from the request_queue is responsible for returning the correct
        sequence number in the response_queue.

        pollresponse() will loop until a response message with the myseq
        sequence number is received, and will save other responses in
        self.responses and notify the owning thread.

        i    RA   s   pollresponse:%d:myseq:%sRC   RD   s   pollresponse:%d:localcall:call:s%   pollresponse:%d:localcall:response:%sN(   RC   RD   (   t   response_queuet   gett   Queuet   EmptyRd   R™   R   Rp   t
   handle_EOFR†   R9   R\   R0   R{   R/   t   notifyR|   (
   R   Rq   Rf   t   qmsgRR   Ri   Rˆ   t   resqRS   t   cv(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRz   ‚  sN    

	

c         C   sq   |  j  ƒ  |  j d ƒ xI |  j D]> } |  j | } | j ƒ  d |  j | <| j ƒ  | j ƒ  q! W|  j ƒ  d S(   s+   action taken upon link being closed by peerRž   Rj   N(   Rj   N(	   t   EOFhookR9   R0   R{   R   R/   RŸ   R|   R2   (   R   t   keyR¢   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRž   Ë  s    


c         C   s   d S(   sB   Classes using rpc client/server can override to augment EOF actionN(    (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR£   Ø  s    N("   R'   R(   R}   R   R   R1   R2   R9   R<   R>   R\   R_   Ra   R]   R`   R^   Rh   Rk   Rr   Rg   Rt   Rs   Rb   Rd   RŽ   R�   R”   R“   R�   R’   R™   Rz   Rž   R£   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR)   |   s>   						*			
	
														I	RM   c           B   s   e  Z RS(    (   R'   R(   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRM   Þ  s   c         C   s    t  |  ƒ } |  t | <t | ƒ S(   N(   t   idR-   Ru   (   RV   R:   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRN   â  s    
Ru   c           B   s   e  Z d  „  Z RS(   c         C   s   | |  _  d  S(   N(   R:   (   R   R:   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR   é  s    (   R'   R(   R   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRu   ç  s   R	   c           B   s/   e  Z e Z d  Z d „  Z d „  Z d „  Z RS(   s   #Sc         C   s6   |  | _  t j |  | ƒ t j j |  | | | ƒ d  S(   N(   t   current_handlerR)   R   R
   t   BaseRequestHandler(   R   R,   R   t   svr(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR   ñ  s    	c         C   s   |  j  ƒ  d S(   s(   handle() method required by SocketServerN(   Rr   (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   handleö  s    c         C   s   t  |  | ƒ S(   N(   Rv   (   R   R:   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   get_remote_proxyú  s    (   R'   R(   t   FalseR+   R4   R   R©   Rª   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR	   ì  s
   		t	   RPCClientc           B   sA   e  Z e Z d  Z d Z e j e j d „ Z	 d „  Z
 d „  Z RS(   s   #Ci   c         C   s9   t  j  | | ƒ |  _ |  j j | ƒ |  j j d ƒ d  S(   Ni   (   R   t   listening_sockt   bindt   listen(   R   t   addresst   familyt   type(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR     s    c         C   sw   |  j  j ƒ  \ } } |  j r4 t j d I| IJn  | d t k rW t j |  | ƒ n t j d I| IJt j	 ‚ d  S(   Ns   ****** Connection request from i    s   ** Invalid host: (
   R­   t   acceptR+   R   R   t	   LOCALHOSTR)   R   R   RQ   (   R   t   working_sockR°   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR³   	  s    	c         C   s   t  |  | ƒ S(   N(   Rv   (   R   R:   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRª     s    (   R'   R(   R«   R+   R4   R}   R   t   AF_INETt   SOCK_STREAMR   R³   Rª   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR¬   ý  s   	
Rv   c           B   s8   e  Z d Z d Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s   | |  _  | |  _ d  S(   N(   t   sockioR:   (   R   R¸   R:   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR     s    	c         C   s¡   |  j  d  k r |  j ƒ  n  |  j  j | ƒ rD t |  j |  j | ƒ S|  j d  k r` |  j ƒ  n  | |  j k r” |  j j	 |  j d | f i  ƒ } | St
 | ‚ d  S(   Nt   __getattribute__(   t   _RPCProxy__methodsR   t   _RPCProxy__getmethodsR›   t   MethodProxyR¸   R:   t   _RPCProxy__attributest   _RPCProxy__getattributesR_   R†   (   R   t   namet   value(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   __getattr__  s    c         C   s%   |  j  j |  j d d i  ƒ |  _ d  S(   NRB   (    (   R¸   R_   R:   R½   (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   __getattributes-  s    c         C   s%   |  j  j |  j d d i  ƒ |  _ d  S(   NR@   (    (   R¸   R_   R:   Rº   (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   __getmethods1  s    N(	   R'   R(   R   Rº   R½   R   RÁ   R¾   R»   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRv     s   			c         C   s§   x? t  |  ƒ D]1 } t |  | ƒ } t | d ƒ r d | | <q q Wt |  ƒ t j k rj t |  j | ƒ n  t |  ƒ t j k r£ x! |  j	 D] } t | | ƒ q‰ Wn  d  S(   Nt   __call__i   (
   t   dirRK   RJ   R²   Rw   t   InstanceTypeRH   t	   __class__t	   ClassTypet	   __bases__(   RV   RW   R¿   t   attrt   super(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRH   5  s    c         C   sF   x? t  |  ƒ D]1 } t |  | ƒ } t | d ƒ s d | | <q q Wd  S(   NRÄ   i   (   RÅ   RK   RJ   (   RV   RX   R¿   RÊ   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRI   B  s    R¼   c           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   | |  _  | |  _ | |  _ d  S(   N(   R¸   R:   R¿   (   R   R¸   R:   R¿   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR   J  s    		c         O   s%   |  j  j |  j |  j | | ƒ } | S(   N(   R¸   R_   R:   R¿   (   R   R6   RU   RÀ   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyRÄ   O  s    !(   R'   R(   R   RÄ   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyR¼   H  s   	(%   t   __doc__R   R!   R   Rƒ   R
   R€   t   cPickleR~   R   Rœ   R   t   copy_regRw   R    R   R   t   CodeTypeR…   R´   R   R   R-   RO   Rš   R;   R)   RM   RN   Ru   R§   R	   R¬   Rv   RH   RI   R¼   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/idlelib/rpc.pyt   <module>   sB   		
2ÿ c			