<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
ž
©ÿfÙQ  c               @   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 d l Z d d „  Z d d „  Z e j e j e e ƒ d d Z d	 Z Gd
 d „  d e j ƒ Z i  Z e	 j d ƒ Z e	 j d ƒ Z Gd d „  d e ƒ Z Gd d „  d e ƒ Z d d „  Z Gd d „  d e ƒ Z Gd d „  d e j e ƒ Z  Gd d „  d e ƒ Z! Gd d „  d e ƒ Z" d d „  Z# d d „  Z$ Gd d „  d e ƒ Z% d  d! „  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
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(   u   marshalu   loads(   u   msu   co(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   unpickle_code.   s    u   unpickle_codec             C   s   t  j |  ƒ } t | f f S(   N(   u   marshalu   dumpsu   unpickle_code(   u   cou   ms(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   pickle_code3   s    u   pickle_codei   i   u	   127.0.0.1c             B   sS   |  Ee  Z d  Z d d d „ Z d d „  Z d d „  Z d d „  Z d	 d
 „  Z d S(   u	   RPCServerc             C   s/   | d  k r t } n  t j j |  | | ƒ d  S(   N(   u   Noneu
   RPCHandleru   socketserveru	   TCPServeru   __init__(   u   selfu   addru   handlerclass(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   __init__H   s    	u   RPCServer.__init__c             C   s   d S(   u@   Override TCPServer method, no bind() phase for connecting entityN(    (   u   self(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   server_bindM   s    u   RPCServer.server_bindc             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(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   server_activateQ   s    u   RPCServer.server_activatec             C   s   |  j  |  j f S(   u:   Override TCPServer method, return already connected socket(   u   socketu   server_address(   u   self(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   get_requestZ   s    u   RPCServer.get_requestc             C   så   y ‚  Wn× t  k
 r ‚  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   nameu   repru	   tracebacku	   print_excu   osu   _exit(   u   selfu   requestu   client_addressu   erf(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   handle_error^   s    	u   RPCServer.handle_errorN(	   u   __name__u
   __module__u   __qualname__u   Noneu   __init__u   server_bindu   server_activateu   get_requestu   handle_error(   u
   __locals__(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu	   RPCServerF   s
   	u	   RPCServerc             B   sv  |  Ee  Z d  Z d Z d: d: d d „ Z d d „  Z d d „  Z d d	 „  Z d
 d „  Z	 d d „  Z
 d d „  Z d d „  Z d d „  Z d d „  Z d d „  Z d d „  Z d d „  Z d d „  Z d d „  Z d  d! „  Z d" d# „  Z d$ d% „  Z d& d' „  Z d( d) „  Z d* Z d+ Z d Z d, d- „  Z d. d/ „  Z d0 d1 „  Z d2 d3 „  Z d4 d5 „  Z  d6 d7 „  Z! d8 d9 „  Z" d: S(;   u   SocketIOi    c             C   sd   t  j ƒ  |  _ | d  k	 r' | |  _ n  | |  _ | d  k rE t } n  | |  _ i  |  _ i  |  _	 d  S(   N(
   u	   threadingu   current_threadu
   sockthreadu   Noneu	   debuggingu   socku   objecttableu   objtableu	   responsesu   cvars(   u   selfu   socku   objtableu	   debugging(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   __init__   s    				u   SocketIO.__init__c             C   s/   |  j  } d  |  _  | d  k	 r+ | j ƒ  n  d  S(   N(   u   socku   Noneu   close(   u   selfu   sock(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   closeŒ   s    		u   SocketIO.closec             C   s   t  j d ƒ d S(   u!   override for specific exit actioni    N(   u   osu   _exit(   u   self(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   exithook’   s    u   SocketIO.exithookc             G   si   |  j  s d  S|  j d t t j ƒ  j ƒ } x" | D] } | d t | ƒ } q4 Wt | d t j ƒd  S(   Nu    u   file(	   u	   debuggingu   locationu   stru	   threadingu   current_threadu   nameu   printu   sysu
   __stderr__(   u   selfu   argsu   su   a(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   debug–   s    	 u   SocketIO.debugc             C   s   | |  j  | <d  S(   N(   u   objtable(   u   selfu   oidu   object(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   registerž   s    u   SocketIO.registerc             C   s'   y |  j  | =Wn t k
 r" Yn Xd  S(   N(   u   objtableu   KeyError(   u   selfu   oid(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu
   unregister¡   s    u   SocketIO.unregisterc             C   s-  |  j  d | ƒ y | \ } \ } } } } Wn t k
 rD d SYn X| |  j k re 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 r9| | | Ž  } t | t ƒ r/t	 | ƒ } n  d | f S| d
 k ret
 j | | | | f f ƒ d Sd d | f SWn² t k
 r‹‚  Ynž t k
 rŸ‚  YnŠ t j k
 r¶‚  Yns t k
 rä} z d | f SWYd  d  } ~ XnE 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: %su   CALLEXCuU   *** 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   KeyboardInterruptu   socketu   erroru	   Exceptionu   printu   sysu
   __stderr__u	   tracebacku	   print_exc(   u   selfu   sequ   requestu   howu   oidu
   methodnameu   argsu   kwargsu   obju   methodsu
   attributesu   methodu   retu   exu   msg(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu	   localcall§   sT    	


 u   SocketIO.localcallc             C   s8   |  j  d | | ƒ |  j | | | | ƒ } |  j | ƒ S(   Nu   remotecall:asynccall: (   u   debugu	   asynccallu   asyncreturn(   u   selfu   oidu
   methodnameu   argsu   kwargsu   seq(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu
   remotecallÕ   s    u   SocketIO.remotecallc             C   s8   |  j  d | | ƒ |  j | | | | ƒ } |  j | ƒ S(   Nu   remotequeue:asyncqueue: (   u   debugu
   asyncqueueu   asyncreturn(   u   selfu   oidu
   methodnameu   argsu   kwargsu   seq(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   remotequeueÚ   s    u   SocketIO.remotequeuec             C   s‰   d | | | | f f } |  j  ƒ  } t j ƒ  |  j k rU 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(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu	   asynccallß   s    u   SocketIO.asynccallc             C   s‰   d | | | | f f } |  j  ƒ  } t j ƒ  |  j k rU 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(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu
   asyncqueueé   s    u   SocketIO.asyncqueuec             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(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   asyncreturnó   s    u   SocketIO.asyncreturnc             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  | d	 k rÀ |  j d
 | ƒ | ‚ n  t | | ƒ ‚ d  S(   Nu   OKu   QUEUEDu	   EXCEPTIONu   decoderesponse: EXCEPTIONu   EOFu   decoderesponse: EOFu   ERRORu   decoderesponse: Internal ERROR:u   CALLEXCu   decoderesponse: Call Exception:(   u   Noneu   debugu   decode_interrupthooku   RuntimeErroru   SystemError(   u   selfu   responseu   howu   what(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   decoderesponseù   s&    
	u   SocketIO.decoderesponsec             C   s
   t  ‚ d S(   u    N(   u   EOFError(   u   self(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   decode_interrupthook  s    u   SocketIO.decode_interrupthookc             C   sD   y |  j  d d d d ƒ Wn# t k
 r? |  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(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   mainloop  s
    u   SocketIO.mainloopc             C   sU   |  j  | | ƒ } | d  k	 rQ | \ } } | d k rQ | |  j | ƒ f } qQ n  | S(   Nu   OK(   u   _getresponseu   Noneu   _proxify(   u   selfu   mysequ   waitu   responseu   howu   what(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   getresponse  s    u   SocketIO.getresponsec             C   sH   t  | t ƒ r t |  | j ƒ St  | t ƒ rD t t |  j | ƒ ƒ S| S(   N(   u
   isinstanceu   RemoteProxyu   RPCProxyu   oidu   listu   mapu   _proxify(   u   selfu   obj(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   _proxify'  s
    u   SocketIO._proxifyc             C   sÑ   |  j  d | ƒ t j ƒ  |  j k rP x¥ |  j | | ƒ } | d  k	 r( | Sq( n} |  j | } | j ƒ  x | |  j k r† | j	 ƒ  qj 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(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   _getresponse/  s"    

	


u   SocketIO._getresponsec             C   s   |  j  d |  _  } | S(   Ni   (   u   nextseq(   u   selfu   seq(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   newseqE  s    u   SocketIO.newseqc             C   s*  |  j  d | d ƒ y t j | ƒ } Wn4 t j k
 r^ t d t | ƒ d t j ƒ‚  Yn Xt j	 d t
 | ƒ ƒ | } x¨ t
 | ƒ d k r%yD t j g  |  j g g  ƒ \ } } } |  j j | d  t … ƒ } Wn; t t f k
 rú t d ƒ ‚ Yq~ t j k
 r‚  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   OSErroru   socketu   error(   u   selfu   messageu   su   ru   wu   xu   n(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu
   putmessageI  s     $ u   SocketIO.putmessages    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 ‚ Yn Xt | ƒ d k r´ 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(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu
   pollpacket`  s    
-	u   SocketIO.pollpacketc             C   sv   |  j  d k rr t |  j ƒ d k rr |  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(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   _stage0p  s
    $u   SocketIO._stage0c             C   sp   |  j  d k rl t |  j ƒ |  j k rl |  j d  |  j … } |  j |  j d  … |  _ d |  _ d |  _  | Sd  S(   Ni   i   i    (   u   bufstateu   lenu   buffu   bufneed(   u   selfu   packet(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   _stage1w  s    '		u   SocketIO._stage1c             C   s¦   |  j  | ƒ } | d  k r d  Sy t j | ƒ } Wnm t j k
 r¡ 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(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   pollmessage  s    u   SocketIO.pollmessagec       
      C   sÇ  xÀy t  j d ƒ } Wn t j k
 r- Yn, X| \ } } | d | f f } |  j | ƒ y# |  j | ƒ } | d k r{ d SWn5 t k
 rž |  j ƒ  d SYn t	 k
 r³ d SYn X| \ } } | d } |  j
 d | | f ƒ | d	 k r^|  j
 d | ƒ |  j | | ƒ } |  j
 d | | f ƒ | d k rI|  j | | f ƒ q | d k r q q q | | k rn| S|  j j | d ƒ }	 |	 d k	 r |	 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(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   pollresponse  sN    
	
	

u   SocketIO.pollresponsec             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(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu
   handle_EOFÖ  s    


u   SocketIO.handle_EOFc             C   s   d S(   uB   Classes using rpc client/server can override to augment EOF actionN(    (   u   self(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   EOFhookã  s    u   SocketIO.EOFhookN(#   u   __name__u
   __module__u   __qualname__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__(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   SocketIO}   s>   .

Iu   SocketIOc             B   s   |  Ee  Z d  Z d S(   u   RemoteObjectN(   u   __name__u
   __module__u   __qualname__(   u
   __locals__(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   RemoteObjecté  s   u   RemoteObjectc             C   s    t  |  ƒ } |  t | <t | ƒ S(   N(   u   idu   objecttableu   RemoteProxy(   u   obju   oid(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu	   remoterefí  s    
u	   remoterefc             B   s    |  Ee  Z d  Z d d „  Z d S(   u   RemoteProxyc             C   s   | |  _  d  S(   N(   u   oid(   u   selfu   oid(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   __init__ô  s    u   RemoteProxy.__init__N(   u   __name__u
   __module__u   __qualname__u   __init__(   u
   __locals__(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   RemoteProxyò  s   u   RemoteProxyc             B   sD   |  Ee  Z d  Z d	 Z d Z d d „  Z d d „  Z d d „  Z d S(
   u
   RPCHandleru   #Sc             C   s6   |  | _  t j |  | ƒ t j j |  | | | ƒ d  S(   N(   u   current_handleru   SocketIOu   __init__u   socketserveru   BaseRequestHandler(   u   selfu   socku   addru   svr(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   __init__ü  s    	u   RPCHandler.__init__c             C   s   |  j  ƒ  d S(   u(   handle() method required by socketserverN(   u   mainloop(   u   self(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   handle  s    u   RPCHandler.handlec             C   s   t  |  | ƒ S(   N(   u   RPCProxy(   u   selfu   oid(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   get_remote_proxy  s    u   RPCHandler.get_remote_proxyNF(	   u   __name__u
   __module__u   __qualname__u   Falseu	   debuggingu   locationu   __init__u   handleu   get_remote_proxy(   u
   __locals__(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu
   RPCHandler÷  s
   u
   RPCHandlerc             B   sV   |  Ee  Z d  Z d
 Z d Z d Z e j e j	 d d „ Z
 d d „  Z d d „  Z d	 S(   u	   RPCClientu   #Ci   c             C   s9   t  j  | | ƒ |  _ |  j j | ƒ |  j j d ƒ d  S(   Ni   (   u   socketu   listening_socku   bindu   listen(   u   selfu   addressu   familyu   type(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   __init__  s    u   RPCClient.__init__c             C   s}   |  j  j ƒ  \ } } |  j r7 t d | d t j ƒn  | d t k rZ 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(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   accept  s    	u   RPCClient.acceptc             C   s   t  |  | ƒ S(   N(   u   RPCProxy(   u   selfu   oid(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   get_remote_proxy  s    u   RPCClient.get_remote_proxyNF(   u   __name__u
   __module__u   __qualname__u   Falseu	   debuggingu   locationu   nextsequ   socketu   AF_INETu   SOCK_STREAMu   __init__u   acceptu   get_remote_proxy(   u
   __locals__(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu	   RPCClient  s   
u	   RPCClientc             B   sP   |  Ee  Z d  Z d	 Z d	 Z d d „  Z d d „  Z d d „  Z d d „  Z	 d	 S(
   u   RPCProxyc             C   s   | |  _  | |  _ d  S(   N(   u   sockiou   oid(   u   selfu   sockiou   oid(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   __init__&  s    	u   RPCProxy.__init__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(   Nu   __getattribute__(   u   _RPCProxy__methodsu   Noneu   _RPCProxy__getmethodsu   getu   MethodProxyu   sockiou   oidu   _RPCProxy__attributesu   _RPCProxy__getattributesu
   remotecallu   AttributeError(   u   selfu   nameu   value(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   __getattr__*  s    u   RPCProxy.__getattr__c             C   s%   |  j  j |  j d f  i  ƒ |  _ d  S(   Nu   __attributes__(   u   sockiou
   remotecallu   oidu   _RPCProxy__attributes(   u   self(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   __getattributes8  s    u   RPCProxy.__getattributesc             C   s%   |  j  j |  j d f  i  ƒ |  _ d  S(   Nu   __methods__(   u   sockiou
   remotecallu   oidu   _RPCProxy__methods(   u   self(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   __getmethods<  s    u   RPCProxy.__getmethodsN(
   u   __name__u
   __module__u   __qualname__u   Noneu   _RPCProxy__methodsu   _RPCProxy__attributesu   __init__u   __getattr__u   _RPCProxy__getattributesu   _RPCProxy__getmethods(   u
   __locals__(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   RPCProxy!  s   u   RPCProxyc             C   sv   x< t  |  ƒ D]. } t |  | ƒ } t | ƒ r d | | <q q Wt |  t ƒ rr x! |  j D] } t | | ƒ qX Wn  d  S(   Ni   (   u   diru   getattru   callableu
   isinstanceu   typeu	   __bases__u   _getmethods(   u   obju   methodsu   nameu   attru   super(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   _getmethods@  s    u   _getmethodsc             C   sC   x< t  |  ƒ D]. } t |  | ƒ } t | ƒ s d | | <q q Wd  S(   Ni   (   u   diru   getattru   callable(   u   obju
   attributesu   nameu   attr(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   _getattributesK  s    u   _getattributesc             B   s,   |  Ee  Z d  Z d d „  Z d d „  Z d S(   u   MethodProxyc             C   s   | |  _  | |  _ | |  _ d  S(   N(   u   sockiou   oidu   name(   u   selfu   sockiou   oidu   name(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   __init__S  s    		u   MethodProxy.__init__c             O   s%   |  j  j |  j |  j | | ƒ } | S(   N(   u   sockiou
   remotecallu   oidu   name(   u   selfu   argsu   kwargsu   value(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   __call__X  s    !u   MethodProxy.__call__N(   u   __name__u
   __module__u   __qualname__u   __init__u   __call__(   u
   __locals__(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   MethodProxyQ  s   u   MethodProxyc             C   s¥   |  d k r d Sd t _ t |  ƒ } y t j j | ƒ WnL t k
 r‡ d } | j | d ƒ } | j	 | d ƒ } t j j | ƒ Yn Xt j j d ƒ |  t _ d S(   u9   Override standard display hook to use non-locale encodingNu   asciiu   backslashreplaceu   strictu   
(
   u   Noneu   builtinsu   _u   repru   sysu   stdoutu   writeu   UnicodeEncodeErroru   encodeu   decode(   u   valueu   textu   encodingu   bytes(    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   displayhook`  s    	u   displayhook('   u   __doc__u   sysu   osu   socketu   selectu   socketserveru   structu   pickleu	   threadingu   queueu	   tracebacku   copyregu   typesu   marshalu   builtinsu   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   MethodProxyu   displayhook(    (    (    u0   /opt/alt/python33/lib64/python3.3/idlelib/rpc.pyu   <module>   sF   
2ÿ m