mò ©ËŽGc@sDdkTdkTdkTdkZdkZdeefd„ƒYZdS((t*NtComputercBstZeƒeƒd„Zd„Zd„Zd„Zd„Zdd„Z dd„Z d d „Z d d „Z d d „Z d „Zd„ZRS(NcCs(||_||_||_||_dS(N(thosttselftlocationtusernametshtshell(RRRRR((tb/home/faculty/youssef/public_html/pacman/sample_cache/tarballs/pre/tmp/pacman-3.29/src/Computer.pyt__init__ s   cCs,d|id|id|id|iS(Ns Computer s , location s , username s, shell (RRRRR(R((Rt__repr__scCsI|i|ijo6|i|ijo#|i|ijo|i|ijS(N(RRtcRRR(RR ((Rt__eq__scCs|i| ƒdS(N(twttextR(RR ((RthtmlOutscCs9tiƒ}|i|ƒ|i||ƒ}t|ƒ|S(N( ttempfiletmktemptfilenametobjtputRtpathtreasont removeFile(RRRRR((RtputObjs    tcCsätd|dtiit|ƒƒ ƒ}|iƒo©dt|ƒd|i d|i dtii |i |ƒ}tidd|d ƒ}|iƒo>tid|ƒti|ƒ\}}t||d jƒ}qàn|S( NsCan't find file [s].sscp t t@t:tsshsAbout to execute [s]. OK?i(tReasonRtosRtexiststfullpathRtokRRRtjoinRtcomtasktretverbotlogtcommandstgetstatusoutputtstatustoutput(RRRR+R$RR,((RRs* @ cCsÙd|d|id|idtii|i|ƒ}t i dd|dƒ}|i ƒottii |ƒo>tid|ƒti|ƒ\}}t||djƒ}qÕtd |d |id ƒ}n|S( Nsscp -r RRRRsAbout to execute [s]. OK?isCan't putdir [s] to [s]. It's not a directory.(tdirnameRRRRRR#RR$R%R&RR"tisdirR'R(R)R*R+R,R(RR-RR+RR,R$((Rtputdir(s: #t.cCs£d|id|idtii|i|ƒd|}t i dd|dƒ}|i ƒo>t id|ƒti|ƒ\}}t||djƒ}n|S( Nsscp RRRRsAbout to execute [s]. OK?i(RRRRRR#RRR$R%R&RR"R'R(R)R*R+R,R(RRRR+RR,R$((Rtget4s: cCs£d|id|idtii|i|ƒd|}t i dd|dƒ}|i ƒo>t id|ƒti|ƒ\}}t||djƒ}n|S( Nsscp -r RRRRsAbout to execute [s]. OK?i(RRRRRR#RRR$R%R&RR"R'R(R)R*R+R,R(RRRR+RR,R$((Rtgetdir=s: c Cs!ti|ƒdjo d}n|}d|id|idd|id|d}t i d d |d ƒ}|i ƒo“t id |ƒti|ƒ\}}|d joMti|d ƒ} g}| D]}|ti|ƒqÏ~} tƒ| fSqt|ƒgfSn |gfSdS(NRR0sssh RRs"cd s; cd s; ls "RsAbout to execute [s]. OK?is (tstringtstriptpath2RRRRRR$R%R&RR"R'R(R)R*R+R,tsplittfilest_[1]tfR( RR5R+R9R8RR,RR$R7((RtlistdirFs 3  *cCs|iƒ\}}|S(N(RR:Rtli(RRR;((RtaccessXscCsð|itƒjo,d|idd|id|d}n4d|id|idd|id|d}tidd|d | d ƒ}|i ƒoJt i d|ƒt i|ƒ}d |}td |d |djƒ}n|S(Nsssh Rs"cd s; t"RRsAbout to execute [s] at s. OK?sError: sError executing [s].i(RRt getusernameRRtcommandtlineR%R&RR"R'R(RtsystemR+R,R(RR?R+RR,R@((Rtexecute[s,3#  !(t__name__t __module__R>RR R R RRRR/R1R2R:R<RB(((RR s      (tBaset ExecutiontWebPageR)RtSettPrintOutR(RR)R((Rt?s