^c@sddlZddlZddlZddlTddlmZddlmZddlZdZdefdYZdZ d Z d Z e d kre ndS( iN(t*(t ScrolledText(tDialogit ShellWindowcBsheZd d dZdZdZdZdZdZdZ dZ dZ d Z RS( cKs|s>ytjd}Wntk r0d}nX|d}ntj|}|d}ttj||f|d|_|j d|j |j d|j |j d|j |j d |j |j d |jt||\|_|_|_|jj|jt|jdS( NtSHELLs/bin/shs -iis1.0ss s s s (tostenvirontKeyErrortstringtsplittapplyRt__init__tpostbindt inputhandlertsiginttsigtermtsigkilltsendeoftspawntpidt fromchildttochildttktcreatefilehandlertREADABLEt outputhandler(tselftmastertshelltcnftargs((s6/usr/lib64/python2.7/Demo/tkinter/guido/ShellWindow.pyR s$     !c Cstj|t}|s|jj|tj|jd\}}dG|GdG|GHd|_|d?}|d@}|dkrd|}n%d|d@}|d @r|d }nt|j d |d d dddddddS|j t ||j d|_ |jt dS(NiRtstatusiisexit status %dskilled by signal %diis -- core dumpedttextttitles Exit statustbitmaptwarningtdefaulttstringstOKs end - 1 char(R'(RtreadtBUFSIZERtdeletefilehandlertwaitpidRtNoneRRtinserttENDtindexR tyview_pickplace( RtfiletmasktdataRtststdetailtcausetmsg((s6/usr/lib64/python2.7/Demo/tkinter/guido/ShellWindow.pyR#s.        cGse|js|jdS|jtd|j|jd}|jt|_tj|j |dS(Ntbreaks s end - 1 char( Rt no_processR-R.tgetR R/RtwriteR(RRtline((s6/usr/lib64/python2.7/Demo/tkinter/guido/ShellWindow.pyR=s  cGs+|js|jdStj|jdS(NR8(RR9RtcloseR(RR((s6/usr/lib64/python2.7/Demo/tkinter/guido/ShellWindow.pyRGs   cCs.|js|jdStj|j|dS(NR8(RR9Rtkill(Rtsig((s6/usr/lib64/python2.7/Demo/tkinter/guido/ShellWindow.pytsendsigNs   cGs|jtjS(N(R@tsignaltSIGINT(RR((s6/usr/lib64/python2.7/Demo/tkinter/guido/ShellWindow.pyRUscGs|jtjS(N(R@RAtSIGQUIT(RR((s6/usr/lib64/python2.7/Demo/tkinter/guido/ShellWindow.pytsigquitXscGs|jtjS(N(R@RAtSIGTERM(RR((s6/usr/lib64/python2.7/Demo/tkinter/guido/ShellWindow.pyR[scGs|jtjS(N(R@RAtSIGKILL(RR((s6/usr/lib64/python2.7/Demo/tkinter/guido/ShellWindow.pyR^sc Cs/t|jddddddddd d dS( NR!sNo active processR"s No processR#terrorR%iR&R'(R'(RR(R((s6/usr/lib64/python2.7/Demo/tkinter/guido/ShellWindow.pyR9as  N( t__name__t __module__R,R RRRR@RRDRRR9(((s6/usr/lib64/python2.7/Demo/tkinter/guido/ShellWindow.pyR s       idcCs\tj\}}tj\}}tj}|dkr5x6dD].}ytj|WqCtjk rpqCXqCWtj|dkrtjjdntj|dkrtjjdntj|dkrtjjdntj dt ztj ||Wdtjjdtj dXntj|tj||||fS( Niiispopen2: bad read dup spopen2: bad write dup isexecvp failed (iii( RtpipetforkR=RGtduptsyststderrR;t closerangetMAXFDtexecvpt_exit(tprogRtp2creadtp2cwritetc2preadtc2pwriteRti((s6/usr/lib64/python2.7/Demo/tkinter/guido/ShellWindow.pyRks.     cCstjtjd}t}|jdd|rJt|d|}n t|}|jdddt|j |j j dS(NiRtexpandtfill( RtjoinRMtargvtTktminsizeRtpacktBOTHt focus_setRtmainloop(Rtroottw((s6/usr/lib64/python2.7/Demo/tkinter/guido/ShellWindow.pyttests   t__main__( RRMRtTkinterRRRAR)RRPRReRH(((s6/usr/lib64/python2.7/Demo/tkinter/guido/ShellWindow.pyts     ^