Ñò ¾[c @sgdZddkZddkZddkZddkZddklZddkTddd„ƒYZdS(s= Progress display callback classes for the yum command line. iÿÿÿÿN(t_(t*tRPMInstallCallbackcBsSeZdZdd„Zd„Zd„Zd„Zed„Zd„Z d„Z RS( sM Yum command line callback class for callbacks from the RPM library. icCs'||_h|_d|_d|_g|_d|_d|_d|_d|_ t i dƒ|_ t |_htdƒt6tdƒt6tdƒt6tdƒt6tdƒt6tdƒt6|_htd ƒt6td ƒt6td ƒt6td ƒt6tdƒt6td ƒt6|_d|_dS( Nit#is"yum.filelogging.RPMInstallCallbacktUpdatingtErasingt Installingt ObsoletedtUpdatedtErasedt Installed(toutputtcallbackfilehandlest total_actionsttotal_installedtinstalled_pkg_namest total_removedtmarktmarkstNonetlastmsgtloggingt getLoggertloggertFalsetfilelogRt TS_UPDATEtTS_ERASEt TS_INSTALLtTS_TRUEINSTALLt TS_OBSOLETEDt TS_OBSOLETINGt myprocesst mypostprocessttsInfo(tselfR ((s/usr/share/yum-cli/callback.pyt__init__#s0                  cCsP|d}|djo d}n t|ƒ}|d|d||d|dfS(Ntepocht0tnametarchtversiontrelease(Rtstr(R#thdrttmpepochR%((s/usr/share/yum-cli/callback.pyt _dopkgtup?s    cCs1d|d|d|d|d|df}|S(Ns%s:%s.%s-%s-%sR%R'R)R*R(((R#R,thandle((s/usr/share/yum-cli/callback.pyt _makeHandleFscCs|io |GHndS(N(R (R#tmsg((s/usr/share/yum-cli/callback.pyt _localprintLs c Csðtt|iƒƒ}d||f}d|d|d}||i|i|if}|id|}d||f}d|d} |o8| |it||dƒf} d | d |} n'| |i|f} d | d |} | S( Ns%s.%ss[%ss/%ss]is%-tsgY@s %-10.10s: %-28.28s t s %-10.10s: %-28.28s (tlenR+R RRRRtint( R#tpercenttprogresstltsizetfmt_donetdoneRtwidthtfmt_bartbartfmt((s/usr/share/yum-cli/callback.pyt_makefmtPs "cCsb|i|ƒ\}}}}}|djod||||f}nd|||||f}|S(s5return nice representation of the package for the logR&s %s.%s %s-%ss%s.%s %s:%s-%s(R.(R#R,tntatetvtrtpkg((s/usr/share/yum-cli/callback.pyt _logPkgStringas  cCs±|tijo|djo ||_q­n€|tijonl|tijonX|tijo˜d|_d}|dj oe|\}}|i|ƒ}t i |t i ƒ} | |i |<|i d7_ |ii|dƒ| S|itdƒƒn°|tijoüd}|dj oå|\}}|i|ƒ}t i|i |ƒd} |i|ƒ} |iid| ƒ} x‰| D]}} y$|i| i} |i| i}Wntj onX|io3|i|ƒ}d||f}|ii|ƒqqWq­n¤|tijo;|dj o*t |ƒt dƒjoÁ|djo d}n|d |}|i!oŽt"i#i$ƒo~|i%|ƒ}|td ƒ|f}||jo|d }n||ijo*t"i#i&|ƒt"i#i'ƒ||_qýqMqQ|\}}|djo d}n|d |}|i|ƒ} |iid| ƒ} xø| D]ì} y|i| i} Wn1tj o%}td ƒ| i|dfGHq]X|i!o”t"i#i$ƒp ||jow|i%|ƒ}|| |df}||ijo*t"i#i&|ƒt"i#i'ƒ||_n||jo d GHqIq]q]Wq­nY|ti(jonE|ti)jon1|ti*joä|i+d7_+|io4||ijo$td|ƒ}|ii|ƒn|i!o‰t"i#i$ƒoy||ijotdƒ} n tdƒ} d}|i%|t,ƒ}|| |f}t"i#i&|d ƒt"i#i'ƒq­n=|ti-jon)|ti.jon|ti/jondS(NiiR'sNo header - huh?itpkgtups%s: %stldt Repackages s&Error: invalid output state: %s for %sR4s Erased: %stRemovingtCleanupid(0trpmtRPMCALLBACK_TRANS_STARTR tRPMCALLBACK_TRANS_PROGRESStRPMCALLBACK_TRANS_STOPtRPMCALLBACK_INST_OPEN_FILERRR0tostopentO_RDONLYR RRtappendR2RtRPMCALLBACK_INST_CLOSE_FILEtcloseR.R"t getMembersR t output_stateR!tKeyErrorRRHRtinfotRPMCALLBACK_INST_PROGRESSttypeR tsyststdouttisattyRAtwritetflushtRPMCALLBACK_UNINST_STARTtRPMCALLBACK_UNINST_PROGRESStRPMCALLBACK_UNINST_STOPRRtRPMCALLBACK_REPACKAGE_STARTtRPMCALLBACK_REPACKAGE_STOPtRPMCALLBACK_REPACKAGE_PROGRESS(R#twhattbytesttotalthtuserR,trpmlocR/tfdRIttxmbrsttxmbrtprocesst processedtpkgrepR1R7R@RDtlogmsg((s/usr/share/yum-cli/callback.pytcallbackksÈ                  '    ( t__name__t __module__t__doc__R$R.R0R2tTrueRARHRw(((s/usr/share/yum-cli/callback.pyRs      (( RzRNRSR_RtyumRt yum.constantsR(((s/usr/share/yum-cli/callback.pyts