mò ê6 Hc@sdkTdkTdkZdkZdkZdkZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd „ƒYZ d efd „ƒYZ d efd „ƒYZ defd„ƒYZ defd„ƒYZ defd„ƒYZdefd„ƒYZdS((t*Nt ShellCommandcBs†tZdZdZdZhZdd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „Zd „Zd „Zd„ZRS(NtshellsShell Commandssexecute shell commandcCs=||_||_d|_d|_tƒ|_d|_dS(Nttnoclear(tcommandtselft signaturetverbtoutputtReasontlasttrytmode(RRR((tf/home/faculty/youssef/public_html/pacman/sample_cache/tarballs/pre/tmp/pacman-3.29/src/ShellCommand.pyt__init__s      cCs&t|dƒo |iSntƒSdS(NR (thasattrRR R (R((R t getLastTrys cCsdti| (RR Rtmiddlet outstring(RRL((R tstrbasejs&cCs |idƒS(Nsoutput contains(RRN(R((R RoscCs6|i|ijo#|i|ijo|i|ijS(N(RRtxRMtmaxout(RRO((R RqsiŸ†cCsW||_||_d|_t|ƒdjot|ƒ|_n ||_d|_dS(NRi(RRRMR R8RPR (RRRMRP((R Rss    cCsRti|dƒ}x9|D]1}ti|ƒdjp||i |_PqqWdS(Ns R(tstringtsplitR tltlltstripRRP(RR RTRS((R t firstline{s cCstƒS(N(R (R((R R‚scCs'td|id|id|i ƒS(Ns Test that [s ] contains [s] has not been performed.(R RRRMR(R((R RƒscCsjt|iƒ\}|_|iƒoAtd|id|idti |i|iƒdjƒ}n|S(NRJs] does not contain [s].i( R5RRR%R R.R RMRQR6(RR%((R R;„s AcCstƒS(N(R (R((R R<Šs(RCRDR4RERFRNRRRRVRRR;R<(((R RIes        t SetenvShellcBsPtZdZdZdZd„Zd„Zd„Zd„Zd„Z d „Z RS( Ns setenv shells Setenv Shells4sets environment variable to output of shell commandcCs5ti||dƒ||_tiddƒ|_dS(NR( RIRRRtenvt_nametEnvironmentVariabletSetenvt_env(RRXR((R R‘s cCs#|i|ijo|i|ijS(N(RR\ROR(RRO((R R–scCsQ|iidjod|id|idSn|iiƒd|idSdS(NRsSetenv [s] to the output of [RKs, output from [(RR\tnameRYRR(R((R R™scCsŒt|iƒ\}}|i|ƒ|idjotd|idƒ}n|iƒo.ti |i |iƒ|_ |i i ƒ}n|S(NRsShell command [s] returns an empty string.( R5RRR%R RVR R.RZR[RYR\tsatisfy(RR%R ((R R;s  cCsF|iidjp,|iiƒiƒtiddƒ|_ntƒS(NR(RR\R]trestoretrequireRZR[R (R((R R<¦scCs.|io |ii|||||ƒndS(N( RRR\RBR=R>R?R@RA(RR=R>R?R@RA((R RB¬s ( RCRDR4RERFRRRR;R<RB(((R RWŒs    tSetenvShellTempcBsGtZdZdZdZd„Zd„Zd„Zd„Zd„Z RS( Nssetenv shell tempsSetenv Shell TempsBsets a temporary environment variable to output of a shell commandcCs5ti||dƒ||_tiddƒ|_dS(NR( RIRRRRXRYRZt SetenvTempR\(RRXR((R R³s cCs#|i|ijo|i|ijS(N(RR\ROR(RRO((R R¸scCsQ|iidjod|id|idSn|iiƒd|idSdS(NRsSetenv [s] to the output of [RKs, output from [(RR\R]RYRR(R((R R»scCsŒt|iƒ\}}|i|ƒ|idjotd|idƒ}n|iƒo.ti |i |iƒ|_ |i i ƒ}n|S(NRsShell command [s] returns an empty string.( R5RRR%R RVR R.RZRbRYR\R^(RR%R ((R R;¿s  cCsF|iidjp,|iiƒiƒtiddƒ|_ntƒS(NR(RR\R]R_R`RZRbR (R((R R<Ès( RCRDR4RERFRRRR;R<(((R Ra¯s    t ShellOutputLEcBs,tZdZdZdZd„Zd„ZRS(Nsshell output LEsShell Output LEs%execute and test shell command outputcCs |idƒS(Ns output is <=(RRN(R((R RÓscCsit|iƒ\}}|i|ƒ|iƒo6td|id|id|i|ij ƒ}n|S(NRJs ] is not <= [s].( R5RRR%R RVR.R RM(RR R%((R R;Ôs   6(RCRDR4RERFRR;(((R RcÎs  t ShellOutputLTcBs,tZdZdZdZd„Zd„ZRS(Nsshell output LTsShell Output LTs%execute and test shell command outputcCs |idƒS(Ns output is <(RRN(R((R RàscCsit|iƒ\}}|i|ƒ|iƒo6td|id|id|i|ij ƒ}n|S(NRJs ] is not < [s].( R5RRR%R RVR.R RM(RR R%((R R;ás   6(RCRDR4RERFRR;(((R RdÛs  t ShellOutputEQcBs,tZdZdZdZd„Zd„ZRS(Nsshell output EQsShell Output EQs%execute and test shell command outputcCs |idƒS(Nsoutput is equal to(RRN(R((R RíscCsit|iƒ\}}|i|ƒ|iƒo6td|id|id|i|ij ƒ}n|S(NRJs] is not equal to [s].( R5RRR%R RVR.R RM(RR R%((R R;îs   6(RCRDR4RERFRR;(((R Reès  t ShellOutputGEcBs,tZdZdZdZd„Zd„ZRS(Nsshell output GEsShell Output GEs%execute and test shell command outputcCs |idƒS(Ns output is >=(RRN(R((R RúscCsit|iƒ\}}|i|ƒ|iƒo6td|id|id|i|ij ƒ}n|S(NRJs ] is not >= [s].( R5RRR%R RVR.R RM(RR R%((R R;ûs   6(RCRDR4RERFRR;(((R Rfõs  t ShellOutputGTcBs,tZdZdZdZd„Zd„ZRS(Nsshell output GTsShell Output GTs%execute and test shell command outputcCs |idƒS(Ns output is >(RRN(R((R RscCsit|iƒ\}}|i|ƒ|iƒo6td|id|id|i|ij ƒ}n|S(NRJs ] is not > [s].( R5RRR%R RVR.R RM(RR R%((R R;s   6(RCRDR4RERFRR;(((R Rgs  (t Environmentt ExecutionRttimeR0RZRRGRIRWRaRcRdReRfRg(RfRcRWRReRIRZRdRgRjRaRRGR0((R t?s$O '#