;
Ñâ"Ic               @   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 Gd „  d	 e j ƒ Z i  Z e	 j d ƒ Z e	 j d ƒ Z Gd
 „  d e ƒ Z Gd „  d e ƒ Z d „  Z Gd „  d e ƒ Z Gd „  d e j e ƒ Z Gd „  d e ƒ Z  Gd „  d e ƒ Z! d „  Z" d „  Z# Gd „  d e ƒ Z$ d S(   u  RPC Implemention, 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
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 |  ƒ } t | t j ƒ p t ‚ | S(   N(   u   marshalu   loadsu
   isinstanceu   typesu   CodeTypeu   AssertionError(   u   msu   co(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   unpickle_code-   s    c             C   s6   t  |  t j ƒ p t ‚ t j |  ƒ } t | f f S(   N(   u
   isinstanceu   typesu   CodeTypeu   AssertionErroru   marshalu   dumpsu   unpickle_code(   u   cou   ms(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   pickle_code2   s    i   i   u	   127.0.0.1c             B   s>   |  Ee  Z d d  „ Z d „  Z d „  Z d „  Z d „  Z d S(   c             C   s1   | d  k o
 t } n t j j |  | | ƒ d  S(   N(   u   Noneu
   RPCHandleru   socketserveru	   TCPServeru   __init__(   u   selfu   addru   handlerclass(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   __init__G   s    
c             C   s   d S(   u@   Override TCPServer method, no bind() phase for connecting entityN(    (   u   self(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   server_bindL   s    c             C   s   |  j  j |  j ƒ d S(   uÎ   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(   u   socketu   connectu   server_address(   u   self(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   server_activateP   s    c             C   s   |  j  |  j f S(   u:   Override TCPServer method, return already connected socket(   u   socketu   server_address(   u   self(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   get_requestY   s    c             C   sê   y ‚  WnÜ t  k
 o ‚  YnÇ t j } t d d d d | ƒt d d | ƒt d t j ƒ  j ƒ  d | ƒt d | d | ƒt d t | ƒ d | ƒt j	 d | ƒ t d	 d | ƒt d d d | ƒt
 j d
 ƒ Yn Xd S(   uÜ   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.

        u   
u   -i(   u   fileu   Unhandled server exception!u
   Thread: %su   Client Address: u	   Request: u#   
*** Unrecoverable, server exiting!i    N(   u
   SystemExitu   sysu
   __stderr__u   printu	   threadingu   current_threadu   get_nameu   repru	   tracebacku	   print_excu   osu   _exit(   u   selfu   requestu   client_addressu   erf(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   handle_error]   s    	 N(   u   __name__u
   __module__u   Noneu   __init__u   server_bindu   server_activateu   get_requestu   handle_error(   u
   __locals__(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu	   RPCServerE   s
   
				u	   RPCServerc             B   s  |  Ee  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! d S(   i    c             C   sh   t  j ƒ  |  _ | d  k	 o | |  _ n | |  _ | d  k o
 t } n | |  _ i  |  _ i  |  _	 d  S(   N(
   u	   threadingu   current_threadu
   sockthreadu   Noneu	   debuggingu   socku   objecttableu   objtableu	   responsesu   cvars(   u   selfu   socku   objtableu	   debugging(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   __init__€   s    	
		c             C   s1   |  j  } d  |  _  | d  k	 o | j ƒ  n d  S(   N(   u   socku   Noneu   close(   u   selfu   sock(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   close‹   s    		c             C   s   t  j ƒ  d S(   u!   override for specific exit actionN(   u   osu   _exit(   u   self(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   exithook‘   s    c             G   sn   |  j  p d  S|  j d t t j ƒ  j ƒ  ƒ } x" | D] } | d t | ƒ } q9 Wt | d t j ƒd  S(   Nu    u   file(	   u	   debuggingu   locationu   stru	   threadingu   current_threadu   get_nameu   printu   sysu
   __stderr__(   u   selfu   argsu   su   a(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   debug•   s    
# c             C   s   | |  j  | <d  S(   N(   u   objtable(   u   selfu   oidu   object(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   register   s    c             C   s)   y |  j  | =Wn t k
 o Yn Xd  S(   N(   u   objtableu   KeyError(   u   selfu   oid(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu
   unregister    s    c             C   sÿ  |  j  d | ƒ y | \ } \ } } } } Wn t k
 o d SYn X| |  j k o d d | f f S|  j | } | d k o i  }	 t | |	 ƒ d |	 f S| d k o i  }
 t | |
 ƒ d |
 f St | | ƒ p d d | f f St | | ƒ } y‡ | d	 k o: | | | Ž  } t | t ƒ o t	 | ƒ } n d | f S| d
 k o! t
 j | | | | f f ƒ d Sd d | f SWnt t k
 o ‚  Yn_ t j k
 o ‚  YnF d } t | | | | f d t j ƒt j d t j ƒ d SYn Xd  S(   Nu
   localcall:u   ERRORu   Bad request formatu   Unknown object id: %ru   __methods__u   OKu   __attributes__u   Unsupported method name: %ru   CALLu   QUEUEu   QUEUEDu   Unsupported message type: %suU   *** Internal Error: rpc.py:SocketIO.localcall()

 Object: %s 
 Method: %s 
 Args: %s
u   fileu	   EXCEPTION(   u   ERRORu   Bad request format(   u   QUEUEDN(   u	   EXCEPTIONN(   u   debugu	   TypeErroru   objtableu   _getmethodsu   _getattributesu   hasattru   getattru
   isinstanceu   RemoteObjectu	   remoterefu   request_queueu   putu   Noneu
   SystemExitu   socketu   erroru   printu   sysu
   __stderr__u	   tracebacku	   print_exc(   u   selfu   sequ   requestu   howu   oidu
   methodnameu   argsu   kwargsu   obju   methodsu
   attributesu   methodu   retu   msg(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu	   localcall¦   sL    
 c             C   s8   |  j  d | | ƒ |  j | | | | ƒ } |  j | ƒ S(   Nu   remotecall:asynccall: (   u   debugu	   asynccallu   asyncreturn(   u   selfu   oidu
   methodnameu   argsu   kwargsu   seq(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu
   remotecallÐ   s    c             C   s8   |  j  d | | ƒ |  j | | | | ƒ } |  j | ƒ S(   Nu   remotequeue:asyncqueue: (   u   debugu
   asyncqueueu   asyncreturn(   u   selfu   oidu
   methodnameu   argsu   kwargsu   seq(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   remotequeueÕ   s    c             C   s‹   d | | | | f f } |  j  ƒ  } t j ƒ  |  j k o t j ƒ  } | |  j | <n |  j d | | | | | ƒ |  j | | f ƒ | S(   Nu   CALLu   asynccall:%d:(   u   newsequ	   threadingu   current_threadu
   sockthreadu	   Conditionu   cvarsu   debugu
   putmessage(   u   selfu   oidu
   methodnameu   argsu   kwargsu   requestu   sequ   cvar(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu	   asynccallÚ   s    c             C   s‹   d | | | | f f } |  j  ƒ  } t j ƒ  |  j k o t j ƒ  } | |  j | <n |  j d | | | | | ƒ |  j | | f ƒ | S(   Nu   QUEUEu   asyncqueue:%d:(   u   newsequ	   threadingu   current_threadu
   sockthreadu	   Conditionu   cvarsu   debugu
   putmessage(   u   selfu   oidu
   methodnameu   argsu   kwargsu   requestu   sequ   cvar(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu
   asyncqueueä   s    c             C   sG   |  j  d | ƒ |  j | d d ƒ} |  j  d | | ƒ |  j | ƒ S(   Nu#   asyncreturn:%d:call getresponse(): u   waitgš™™™™™©?u   asyncreturn:%d:response: (   u   debugu   getresponseu   decoderesponse(   u   selfu   sequ   response(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   asyncreturnî   s    c             C   s¸   | \ } } | d k o | S| d k o d  S| d k o |  j d ƒ d  S| d k o |  j d ƒ |  j ƒ  d  S| d k o  |  j d | ƒ t | ƒ ‚ n t | | ƒ ‚ d  S(	   Nu   OKu   QUEUEDu	   EXCEPTIONu   decoderesponse: EXCEPTIONu   EOFu   decoderesponse: EOFu   ERRORu   decoderesponse: Internal ERROR:(   u   Noneu   debugu   decode_interrupthooku   RuntimeErroru   SystemError(   u   selfu   responseu   howu   what(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   decoderesponseô   s     
c             C   s
   t  ‚ d S(   u    N(   u   EOFError(   u   self(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   decode_interrupthook  s    c             C   sF   y |  j  d d d d ƒ Wn% t k
 o |  j d ƒ d SYn Xd S(   u¥   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.

        u   mysequ   waitgš™™™™™©?u   mainloop:returnN(   u   getresponseu   Noneu   EOFErroru   debug(   u   self(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   mainloop
  s
    c             C   sY   |  j  | | ƒ } | d  k	 o6 | \ } } | d k o | |  j | ƒ f } qU n | S(   Nu   OK(   u   _getresponseu   Noneu   _proxify(   u   selfu   mysequ   waitu   responseu   howu   what(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   getresponse  s    c             C   sL   t  | t ƒ o t |  | j ƒ St  | t ƒ o t t |  j | ƒ ƒ S| S(   N(   u
   isinstanceu   RemoteProxyu   RPCProxyu   oidu   listu   mapu   _proxify(   u   selfu   obj(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   _proxify  s
    c             C   s×   |  j  d | ƒ t j ƒ  |  j k o. xª |  j | | ƒ } | d  k	 o | Sq) n€ |  j | } | j ƒ  x | |  j k o | j	 ƒ  qn W|  j | } |  j  d | | f ƒ |  j | =|  j | =| j
 ƒ  | Sd  S(   Nu   _getresponse:myseq:u-   _getresponse:%s: thread woke up: response: %s(   u   debugu	   threadingu   current_threadu
   sockthreadu   pollresponseu   Noneu   cvarsu   acquireu	   responsesu   waitu   release(   u   selfu   mysequ   waitu   responseu   cvar(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   _getresponse'  s$    
 	


c             C   s   |  j  d |  _  } | S(   Ni   (   u   nextseq(   u   selfu   seq(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   newseq=  s    c             C   s2  |  j  d | d ƒ y t j | ƒ } Wn6 t j k
 o' t d t | ƒ d t j ƒ‚  Yn Xt j	 d t
 | ƒ ƒ | } x® t
 | ƒ d k oš yD t j g  |  j g g  ƒ \ } } } |  j j | d  t … ƒ } Wn? t t f k
 o t d ƒ ‚ Yq€ t j k
 o ‚  Yq€ X| | d  … } q€ Wd  S(   Nu   putmessage:%d:i    u   Cannot pickle:u   fileu   <iu   socket no longer exists(   u   debugu   pickleu   dumpsu   PicklingErroru   printu   repru   sysu
   __stderr__u   structu   packu   lenu   selectu   socku   sendu   BUFSIZEu   AttributeErroru	   TypeErroru   IOErroru   socketu   error(   u   selfu   messageu   su   ru   wu   xu   n(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu
   putmessageA  s"    	 $ 	s    i   c          	   C   sâ   |  j  ƒ  t |  j ƒ |  j k  oµ t j |  j j ƒ  g g  g  | ƒ \ } } } t | ƒ d k o d  Sy |  j j t	 ƒ } Wn t
 j k
 o t ‚ Yn Xt | ƒ d k o
 t ‚ n |  j | 7_ |  j  ƒ  n |  j ƒ  S(   Ni    (   u   _stage0u   lenu   buffu   bufneedu   selectu   socku   filenou   Noneu   recvu   BUFSIZEu   socketu   erroru   EOFErroru   _stage1(   u   selfu   waitu   ru   wu   xu   s(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu
   pollpacketX  s    
-
c             C   sy   |  j  d k oe t |  j ƒ d k oO |  j d  d … } |  j d d  … |  _ t j d | ƒ d |  _ d |  _  n d  S(   Ni    i   u   <ii   (   u   bufstateu   lenu   buffu   structu   unpacku   bufneed(   u   selfu   s(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   _stage0h  s
    &c             C   ss   |  j  d k o_ t |  j ƒ |  j k oF |  j d  |  j … } |  j |  j d  … |  _ d |  _ d |  _  | Sd  S(   Ni   i   i    (   u   bufstateu   lenu   buffu   bufneed(   u   selfu   packet(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   _stage1o  s    )		c             C   sª   |  j  | ƒ } | d  k o d  Sy t j | ƒ } Wno t j k
 o` t d d t j ƒt d t | ƒ d t j ƒt	 j
 d t j ƒ t d d t j ƒ‚  Yn X| S(   Nu   -----------------------u   fileu   cannot unpickle packet:(   u
   pollpacketu   Noneu   pickleu   loadsu   UnpicklingErroru   printu   sysu
   __stderr__u   repru	   tracebacku   print_stack(   u   selfu   waitu   packetu   message(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   pollmessagew  s    	c       
      C   sÙ  xÒy t  j d ƒ } Wn t j k
 o Yn- X| \ } } | d | f f } |  j | ƒ y% |  j | ƒ } | d k o d SWn9 t k
 o |  j ƒ  d SYn t	 k
 o d SYn X| \ } } | d } |  j
 d | | f ƒ | d	 k ov |  j
 d | ƒ |  j | | ƒ } |  j
 d | | f ƒ | d k o |  j | | f ƒ q | d k o q q q | | k o | S|  j j | d ƒ }	 |	 d k	 o/ |	 j ƒ  | |  j | <|	 j ƒ  |	 j ƒ  q q q d S(
   uR  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    u   OKu   pollresponse:%d:myseq:%su   CALLu   QUEUEu   pollresponse:%d:localcall:call:u%   pollresponse:%d:localcall:response:%sN(   u   CALLu   QUEUE(   u   response_queueu   getu   queueu   Emptyu
   putmessageu   pollmessageu   Noneu   EOFErroru
   handle_EOFu   AttributeErroru   debugu	   localcallu   cvarsu   acquireu	   responsesu   notifyu   release(
   u   selfu   mysequ   waitu   qmsgu   sequ   responseu   messageu   resqu   howu   cv(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   pollresponse…  sN    	
	

	

c             C   sq   |  j  ƒ  |  j d ƒ xI |  j D]> } |  j | } | j ƒ  d |  j | <| j ƒ  | j ƒ  q! W|  j ƒ  d S(   u+   action taken upon link being closed by peeru
   handle_EOFu   EOFN(   u   EOFN(	   u   EOFhooku   debugu   cvarsu   acquireu   Noneu	   responsesu   notifyu   releaseu   exithook(   u   selfu   keyu   cv(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu
   handle_EOFÎ  s    

 

c             C   s   d S(   uB   Classes using rpc client/server can override to augment EOF actionN(    (   u   self(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   EOFhookÛ  s    N("   u   __name__u
   __module__u   nextsequ   Noneu   __init__u   closeu   exithooku   debugu   registeru
   unregisteru	   localcallu
   remotecallu   remotequeueu	   asynccallu
   asyncqueueu   asyncreturnu   decoderesponseu   decode_interrupthooku   mainloopu   getresponseu   _proxifyu   _getresponseu   newsequ
   putmessageu   buffu   bufneedu   bufstateu
   pollpacketu   _stage0u   _stage1u   pollmessageu   pollresponseu
   handle_EOFu   EOFhook(   u
   __locals__(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   SocketIO|   s>   
						*			
	
														I	u   SocketIOc             B   s   |  Ee  Z d  S(   N(   u   __name__u
   __module__(   u
   __locals__(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   RemoteObjectá  s   
u   RemoteObjectc             C   s    t  |  ƒ } |  t | <t | ƒ S(   N(   u   idu   objecttableu   RemoteProxy(   u   obju   oid(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu	   remoterefå  s    
c             B   s   |  Ee  Z d  „  Z d S(   c             C   s   | |  _  d  S(   N(   u   oid(   u   selfu   oid(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   __init__ì  s    N(   u   __name__u
   __module__u   __init__(   u
   __locals__(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   RemoteProxyê  s   
u   RemoteProxyc             B   s5   |  Ee  Z d Z d  Z d „  Z d „  Z d „  Z d S(   u   #Sc             C   s6   |  | _  t j |  | ƒ t j j |  | | | ƒ d  S(   N(   u   current_handleru   SocketIOu   __init__u   socketserveru   BaseRequestHandler(   u   selfu   socku   addru   svr(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   __init__ô  s    	c             C   s   |  j  ƒ  d S(   u(   handle() method required by socketserverN(   u   mainloop(   u   self(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   handleù  s    c             C   s   t  |  | ƒ S(   N(   u   RPCProxy(   u   selfu   oid(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   get_remote_proxyý  s    NF(   u   __name__u
   __module__u   Falseu	   debuggingu   locationu   __init__u   handleu   get_remote_proxy(   u
   __locals__(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu
   RPCHandlerï  s
   
		u
   RPCHandlerc             B   sG   |  Ee  Z d Z d  Z d Z e j e j d „ Z	 d „  Z
 d „  Z d S(   u   #Ci   c             C   sU   t  j  | | ƒ |  _ |  j j t  j t  j d ƒ |  j j | ƒ |  j j d ƒ d  S(   Ni   (   u   socketu   listening_socku
   setsockoptu
   SOL_SOCKETu   SO_REUSEADDRu   bindu   listen(   u   selfu   addressu   familyu   type(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   __init__  s
    c             C   s   |  j  j ƒ  \ } } |  j o t d | d t j ƒn | d t k o t j |  | ƒ n  t d | d t j ƒt	 j
 ‚ d  S(   Nu   ****** Connection request from u   filei    u   ** Invalid host: (   u   listening_socku   acceptu	   debuggingu   printu   sysu
   __stderr__u	   LOCALHOSTu   SocketIOu   __init__u   socketu   error(   u   selfu   working_socku   address(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   accept  s    
c             C   s   t  |  | ƒ S(   N(   u   RPCProxy(   u   selfu   oid(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   get_remote_proxy  s    NF(   u   __name__u
   __module__u   Falseu	   debuggingu   locationu   nextsequ   socketu   AF_INETu   SOCK_STREAMu   __init__u   acceptu   get_remote_proxy(   u
   __locals__(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu	   RPCClient   s   
	
u	   RPCClientc             B   s>   |  Ee  Z d Z d Z d  „  Z d „  Z d „  Z d „  Z d S(   c             C   s   | |  _  | |  _ d  S(   N(   u   sockiou   oid(   u   selfu   sockiou   oid(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   __init__   s    	c             C   s¬   |  j  d  k o |  j ƒ  n |  j  j | ƒ o t |  j |  j | ƒ S|  j d  k o |  j ƒ  n | |  j k o& |  j j	 |  j d | f i  ƒ } | St
 | ƒ ‚ d  S(   Nu   __getattribute__(   u   _RPCProxy__methodsu   Noneu   _RPCProxy__getmethodsu   getu   MethodProxyu   sockiou   oidu   _RPCProxy__attributesu   _RPCProxy__getattributesu
   remotecallu   AttributeError(   u   selfu   nameu   value(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   __getattr__$  s    c             C   s%   |  j  j |  j d d i  ƒ |  _ d  S(   Nu   __attributes__(    (   u   sockiou
   remotecallu   oidu   _RPCProxy__attributes(   u   self(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   __getattributes2  s    c             C   s%   |  j  j |  j d d i  ƒ |  _ d  S(   Nu   __methods__(    (   u   sockiou
   remotecallu   oidu   _RPCProxy__methods(   u   self(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   __getmethods6  s    N(	   u   __name__u
   __module__u   Noneu   _RPCProxy__methodsu   _RPCProxy__attributesu   __init__u   __getattr__u   _RPCProxy__getattributesu   _RPCProxy__getmethods(   u
   __locals__(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   RPCProxy  s   
			u   RPCProxyc             C   s}   xA t  |  ƒ D]3 } t |  | ƒ } t | d ƒ o d | | <q q Wt |  t ƒ o% x" |  j D] } t | | ƒ q^ Wn d  S(   Nu   __call__i   (   u   diru   getattru   hasattru
   isinstanceu   typeu	   __bases__u   _getmethods(   u   obju   methodsu   nameu   attru   super(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   _getmethods:  s     
 c             C   sH   xA t  |  ƒ D]3 } t |  | ƒ } t | d ƒ p d | | <q q Wd  S(   Nu   __call__i   (   u   diru   getattru   hasattr(   u   obju
   attributesu   nameu   attr(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   _getattributesE  s
     c             B   s    |  Ee  Z d  „  Z d „  Z d S(   c             C   s   | |  _  | |  _ | |  _ d  S(   N(   u   sockiou   oidu   name(   u   selfu   sockiou   oidu   name(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   __init__M  s    		c             O   s%   |  j  j |  j |  j | | ƒ } | S(   N(   u   sockiou
   remotecallu   oidu   name(   u   selfu   argsu   kwargsu   value(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   __call__R  s    !N(   u   __name__u
   __module__u   __init__u   __call__(   u
   __locals__(    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   MethodProxyK  s   
	u   MethodProxy(%   u   __doc__u   sysu   osu   socketu   selectu   socketserveru   structu   pickleu	   threadingu   queueu	   tracebacku   copyregu   typesu   marshalu   unpickle_codeu   pickle_codeu   CodeTypeu   BUFSIZEu	   LOCALHOSTu	   TCPServeru	   RPCServeru   objecttableu   Queueu   request_queueu   response_queueu   objectu   SocketIOu   RemoteObjectu	   remoterefu   RemoteProxyu   BaseRequestHandleru
   RPCHandleru	   RPCClientu   RPCProxyu   _getmethodsu   _getattributesu   MethodProxy(    (    (    u(   /mit/python/lib/python3.0/idlelib/rpc.pyu   <module>   sB   		
2ÿ f			