mò &U²Ic@sYdkZdkZdkZdkZdkZdkZdkZdkZdkZdk Z dk Z dk Z dk Z dk Z dkZdZy dkZWnej onXd„Zee_eaeaed„Zd„Zd„Zd„Zd„Zd„Zd „Zd e ifd „ƒYZd e i fd „ƒYZ!dfd„ƒYZ"dS(Ns 127.0.0.1cCsfd}|d||f7}ti||ƒiƒ}|o|d|7}n|d|i|f7}|S(sFormat warnings the IDLE ways! Warning (from warnings module): s File "%s", line %s s %s s%s: %s N( tstfilenametlinenot linecachetgetlinetstriptlinetcategoryt__name__tmessage(R RRRRR((t(/data/zmath/lib/python2.4/idlelib/run.pytidle_formatwarning_subprocsc Csß|ad}tidottidƒ}ndgti(tidtdddt |ffƒ} | i t ƒ| i ƒx\y¬to(y tƒWq±tj o wq±Xnytiidƒ\}}Wn&tij otid ƒwnX|\} }}| ||Ž}tii||fƒWqtj ot o t aqqqt!j o ‚qti"ƒ\}} }y!t&ƒtii|d fƒWqt(i&|| |d ti)ƒtƒqÖXqqXqWd S( sjStart the Python execution server in a subprocess In the Python subprocess, RPCServer is instantiated with handlerclass MyHandler, which inherits register/unregister methods from RPCHandler via the mix-in class SocketIO. When the RPCServer 'server' is instantiated, the TCPServer initialization creates an instance of run.MyHandler and calls its handle() method. handle() instantiates a run.Executive object, passing it a reference to the MyHandler object. That reference is saved as attribute rpchandler of the Executive instance. The Executive methods have access to the reference and can pass it on to entities that they command (e.g. RemoteDebugger.Debugger.start_debugger()). The latter, in turn, can call MyHandler(SocketIO) register/unregister methods via the reference to register and unregister themselves. i"itttargettnamet SockThreadtargsif0.050000000000000003tfileN(*t del_exitfunct no_exitfunctporttsystargvtintt threadingtThreadt manage_sockett LOCALHOSTt sockthreadt setDaemontTruetstarttexit_nowtexittKeyboardInterrupttrpct request_queuetgettseqtrequesttQueuetEmptyttimetsleeptmethodRtkwargstrettresponse_queuetputtquittingt SystemExittexc_infottypetvaluettbtprint_exceptiontNonet tracebackt __stderr__( RR&R6R4RR.R-RR'RR5R,((R tmain,sZ         cCsžxtdƒD][}ti|ƒyt|tƒ}PWq ti j o"}t i d|ddIJq Xq Wt i dIJt ||ƒtadS|iƒdS(NisIDLE Subprocess: socket error: is, retrying....s8IDLE Subprocess: Connection to IDLE GUI failed, exiting.(trangetiR*R+t MyRPCServertaddresst MyHandlertservertsocketterrorterrRR:tshow_socket_errorRR thandle_request(R?RDR=RA((R Rns  "  cCsƒdk}dk}|iƒ}|iƒ|ddjo$d|}|id|d|ƒn|idd|dƒ|i ƒdS(Nii=s¿IDLE's subprocess can't connect to %s:%d. This may be due to your personal firewall configuration. It is safe to allow this internal connection because no data is visible on external ports.sIDLE Subprocess ErrortparentsSocket Error: %si( tTkintert tkMessageBoxtTktroottwithdrawRDR?tmsgt showerrortdestroy(RDR?RHRIRMRK((R RE€s     c CsÄdk}|iƒtƒti}tiƒ\} }}}|\t_ t_ t_ ti|ƒ}|dIJd }t||ƒti|d|ƒti| |ƒ}x|D]}||Iq¬WdS( Ns# Traceback (most recent call last):srun.pysrpc.pys threading.pysQueue.pysRemoteDebugger.pysbdb.pyR(srun.pysrpc.pys threading.pysQueue.pysRemoteDebugger.pysbdb.py(Rt checkcachet flush_stdoutRtstderrtefileR3ttyptvalR6texcinfot last_typet last_valuetlast_tracebackR9t extract_tbttbetexcludetcleanup_tracebackt print_listtformat_exception_onlytlinesR( R[RUR6R`RSRR\RVRRT((R R7s     c Csk|} xB|o:x,|D]#}|ddi|ƒoPqqWP|d=q WxB|o:x,|D]#}|ddi|ƒoPq]q]WP|d=qOWt|ƒdjo| |(tidIJnti di }x—t t|ƒƒD]ƒ}||\}}}}|djo d}n| o2|idƒo"|idd ||fhƒ}n||||f||       cCsQy1tiio dti_tiidƒnWnttfj onXdS(Nis (Rtstdoutt softspacetwritetAttributeErrortEOFError(((R RQ¿s   cCs"to t`ntidƒdS(sÐExit subprocess, possibly after first deleting sys.exitfunc If config-main.cfg/.def 'General' 'delete-exitfunc' is True, then any sys.exitfunc will be removed before exiting. (VPython support) iN(RRtexitfuncR!(((R R!Çs R>cBstZd„ZRS(Nc Cséy‚WnÛtj o ‚nÇtj otatiƒn¥ti}|dddIJ|dIJ|dt i ƒi ƒIJ|dI|IJ|dIt |ƒIJtid|ƒ|d IJ|ddIJtatiƒnXd S( srOverride RPCServer method for IDLE Interrupt the MainThread and exit server if link is dropped. s t-i(sUnhandled server exception!s Thread: %ssClient Address: s Request: Rs# *** Unrecoverable, server exiting!N(R2RrRR tthreadtinterrupt_mainRR:terfRt currentThreadtgetNametclient_addresstreprR'R9t print_excR1(tselfR'RzRw((R t handle_errorÔs,   (Rt __module__R~(((R R>ÒsR@cBs,tZd„Zd„Zd„Zd„ZRS(NcCs·t|ƒ}|id|ƒ|idƒt_|_|idƒt_|idƒt_ dk }|i ti_ ti_ ti _ |idƒ|_ t ii|dddd ƒdS( sOverride base methodRatstdinRnRRNtinterptmyseqtwaitf0.050000000000000003(t ExecutiveR}t executivetregistertget_remote_proxyRR€tconsoleRnRRt IOBindingtencodingRR#t RPCHandlert getresponseR8(R}R…R‰((R thandleós  #cCstidƒdS(s>override SocketIO method - wait for MainThread to shut us downi N(R*R+(R}((R texithookscCstatiƒdS(sEOverride SocketIO method - terminate wait on callback and exit threadN(RR1RuRv(R}((R tEOFhookscCstatiƒdS(sinterrupt awakened threadN(RR1RuRv(R}((R tdecode_interrupthook s(RRRRŽRR(((R R@ñs  R„cBsJtZd„Zd„Zd„Zd„Zd„Zd„Zdd„Z RS(NcCs(||_ti|_tiƒ|_dS(N(RhR}t__main__t__dict__tlocalstCallTipstcalltip(R}Rh((R t__init__s  cBs…yd|_||iUWn_eiƒ|_eo eƒne ƒ|i i i dƒ}|o|i iiƒqnXeƒdS(Ns<>(R8R}t usr_exc_infotcodeR“RR3R1R!R7RhRˆtgetvartjitRtopen_remote_stack_viewerRQ(R}R˜Rš((R truncodes  cCstiƒdS(N(RuRv(R}((R tinterrupt_the_server(scCsti|i|ƒS(N(tRemoteDebuggertstart_debuggerR}Rht gui_adap_oid(R}R ((R tstart_the_debugger+scCs|ii|ƒdS(sDUnregister the Idb Adapter. Link objects and Idb then subject to GCN(R}Rht unregistert idb_adap_oid(R}R£((R tstop_the_debugger.scCs|ii|ƒS(N(R}R•t fetch_tipR(R}R((R tget_the_calltip2scCs³|io|i\}}}ndSd}|dj o|ii |ƒ}nx2|o*|i i dddgjo |i }qPW|t _|t _ti||ƒ}ti|ƒS(NRR#trun(R}R—RTRUR6R8tflistt flist_oidRhR‡ttb_framet f_globalsttb_nextRRWRXt StackViewert StackTreeItemtitemtRemoteObjectBrowsertremote_object_tree_item(R}R©RURTR¨R¯R6((R t stackviewer5s  $  ( RRR–RœRR¡R¤R¦R8R²(((R R„s      (#RtosRR*RBR9RuRR(R”RžR°R­R#R‘Rtwarningst ImportErrorR t formatwarningtFalseR R1R;RRER7R]RQR!t RPCServerR>R‹R@R„(R„R R7R#R°R‘R­RRERQR!RR;R”R´R>R(R]RRRBRuRžR9RR*R³R@((R RbsB                  B