mò ©ËŽGc@s>dkTdkTdefd„ƒYZdefd„ƒYZdS((t*tChowncBs_tZdZdZdZeƒd„Zd„Zd„Zd„Z d„Z d„Z d „Z RS( Nschange ownershipsChange OwnershipscCs||_||_d|_dS(Nt(townertselft_ownertpatht_patht_originalOwner(RRR((t_/home/faculty/youssef/public_html/pacman/sample_cache/tarballs/pre/tmp/pacman-3.29/src/Chown.pyt__init__ s  cCs|i|ijS(N(RRtch(RR ((R tequalscCsd|id|idS(Ns of [s] by [t](RRR(R((R tstrscCstd| d|i ƒS(Nt[s] has not been attempted yet.(tReasonRtacquired(R((R t satisfiedscCstƒS(N(R(R((R t satisfiablescCs¢tƒ}t|iƒ\}}}y>t|i ƒ|_ t |i ƒ|_ t i |i ||ƒWn<ttfj o*|id|i d|idƒnX|S(NsFailed to change ownership of [s] to [s].(RtreasontuseridsRRtgotittuidtgidtfullpathRRRtostchowntIOErrortOSError(RRRRR((R tacquires (cCsŒtƒ}|iout|iƒ\}}}yt i |i ||ƒWqˆt t fj o*|id|i d|idƒqˆXn|S(Ns Failed to restore ownership of [s] to [s].(RRRRRRRRRRRRRR(RRRRR((R tretract$s  ,( t__name__t __module__ttypettitletactiont getusernameR R RRRRR(((R Rs     tOwnedBycBs,tZdZdZdZd„Zd„ZRS(Nstest file ownershipsTest File OwnershipscCsÁt|iƒ|_|idjo tƒSntd|idtii|iƒ ƒ}|i ƒoYt |iƒ\}}|i ƒo3td|id|id||ij ƒ}q½n|S(Ns- any -sFile [s] does not exist.s] is not owned by [s].( RRRRRRRtexistsRtoktowner2town(RR*R((R R3s *  7cCstƒS(N(R(R((R R<s(R R!R"R#R$RR(((R R&.s  N(t EnvironmenttBaseRR&(RR&((R t?s'