[/\c@@sKdZddlmZddlmZddlmZddlZddlmZddl m Z m Z ddl m Z mZmZmZmZmZmZdd lmZmZmZmZdd lmZdd lmZddlZddlZddl Zddl!Zddl"Zddl#Zddl Zddl$Zddl%Zddl&Zddl'Z'ddl(Z(ddl)Z)ddl*Z*ddl+Z+ddl,Z,ddl-Z-ddl.Z.e*j/d Z0d Z1dZ2de3fdYZ4dej5j6fdYZ7dej5j8fdYZ9defdYZ:e;dZ<dS(u"Handle actual output from the cli.i(tabsolute_import(tprint_function(tunicode_literalsN(tdeepcopy(t format_numbert format_time(t_tC_tP_tucdtfill_exact_widtht textwrap_fillt exact_width(txranget basestringtlongtunicode(tLoggingTransactionDisplay(tMergedTransactionWrapperudnfcC@s,tjji gd6gd6gd6gd6gd6gd6gd6gd6gd 6gd 6gd 6}x|D]}|jtjjkr|jj|qf|j tjj kr|j j|qf|j tjj kr\|j tjjkr|jj|q$|j tjjkr!|jj|q$|j tjjkrI|jj|q$|jj|qf|j tjjkr|jj|qf|j tjjkr|j tjjkr|jj|q$|j tjjkr|jj|q$|jj|qf|j tjjkrf|jj|qfqfW|S( Nu downgradeduerasedu erased_cleanu erased_depu installeduinstalled_groupu installed_depuinstalled_weaku reinstalleduupgradedufailed(tdnftutiltBunchtstatetlibdnft transactiontTransactionItemState_ERRORtfailedtappendtactiontTransactionItemAction_DOWNGRADEt downgradedtTransactionItemAction_INSTALLtreasontTransactionItemReason_GROUPtinstalled_groupt TransactionItemReason_DEPENDENCYt installed_dept%TransactionItemReason_WEAK_DEPENDENCYtinstalled_weakt installedtTransactionItemAction_REINSTALLt reinstalledtTransactionItemAction_REMOVEtTransactionItemReason_CLEANt erased_cleant erased_depterasedtTransactionItemAction_UPGRADEtupgraded(Rtgoaltbttsi((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyt _make_lists5sH   cC@stj|ftjd}t|}|d}| |}|sZtjd|}n|rt|jd|nt|}tt||g|S(Nui(u(t itertoolstchaintrepeattlentextendtitertlisttzip(t cols_counttlabeltlsttleftt lst_lengtht right_countt missing_itemstlst_iter((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyt_spread_in_columnsbs    tOutputcB@seZdZddZdZdZdZdZdZe dZ e d Z e d Z ed ed d Ze dZdZd d dZed eedZed eedZdZdZdZddZedZedZieidZeedZdZdZdZ dZ!d Z"d!Z#eeed"Z$ed#Z%ed$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.ed-Z/e d.Z0d/Z1d0Z2d1Z3ge4d2Z5gd3Z6i e7d4d56e7d4d46e7d6d66e7d7d76e7d8d86e7d9d96e7d:d:6e7d;d;6e7d<d<6e7d=d>6e7d?d@6Z8gdAZ9dBZ:RS(Cu+Main output class for the yum command line.u icC@s4||_||_tjjj|_d|_dS(N(tconftbaseRtclittermtTermtNonetprogress(tselfRHRG((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyt__init__ts  cC@s>|jj}d|}|jt||d}|||fS(Nu%su=u u=(RJtcolumnst fmtColumnsR<(RNtcol_datatrowt term_widthtruletheader((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyt_bannerzs  c C@sg|dD]}t^q }x[|D]S}xJt|D]<\}}||}t|}|j|dd||' - highlighting used when the package has a higher version number :return: (exit_code, [errors]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string ulistuinfounameunevraiiu%sunot inunormalu=u>uboldu$$        #    cC@s|jjjj}|jjjj}i}xitjtt|dD]H}||kr||d||s(R(tpackages((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pytnamessu u Group: %su Group-Id: %su Description: %suu Language: %su Mandatory Packages:u Default Packages:u Optional Packages:u Conditional Packages:iiN(RRtui_nameRGRR tidtui_descriptiont lang_onlytmandatory_packagestdefault_packagestoptional_packagestconditional_packagesRR R\R8RR ( RNtgroupRRRRt col_lengthsRPt section_nameR((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pytdisplay_pkgs_in_groupss8    &   cC@sd}ttd|j|jjrLttdt|jn|jrt|jpgd}ttd|ntd||jftd||j ff}xC|D];\}}t |dkrqnt||j |qWd S( uOutput information about the packages in a given environment :param environment: an Environment object to output information about cS@std|DS(Ncs@s|]}|jVqdS(N(R(RR((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pys s(R(tgroups((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyR suEnvironment Group: %su Environment-Id: %suu Description: %su Mandatory Groups:u Optional Groups:iN( RRRRGRR RRtmandatory_groupstoptional_groupsR8R (RNt environmentRRRRR((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pytdisplay_groups_in_environments     c @s5tfdfd}jjrCd}ndjjf}j|jpnd}rdkrjjnj |dt }nt ||dkrjj }n|sdSt t djt}t} xt|D]} j| kr3t } qnj| krmt d } | | |d t t }qj| krt d } | | |d tt }qj| krt d } | | |d tt }q|| |rt }qt d } xjD]} t| } tj| | rR| | |d tt }q| jd} tdtfd| Dr| jd}n| }tj| |r| | |d tt }qqWqWt|| gs*x9t|D](} t d} | | |d tqWnt dS(uOutput search/provides type callback matches. :param po: the package object that matched the search :param values: the information associated with *po* that matched the search :param matchfor: a list of strings to be highlighted in the output :param verbose: whether to output extra verbose information :param highlight: highlighting options for the highlighted matches c@s|sttdnt|p(d}|dkr;dSr_j|dt}n|r~tj||nt||dS(Nu Matched from:ut ignore_case(RRR RwRR(Rtitemtprinted_headlinet can_overflow(RntmatchforRN(s2/usr/lib/python2.7/site-packages/dnf/cli/output.pytprint_highlighted_key_item*s c@st|jd|jdgs(tStd}t}xBjD]7}tj||rDt}|||dtqDqDW|S(Nu/u*/uFilename : %sR'(tanyRlRRtfilestfnmatchR(R%t printed_matchRt file_matchtfilename(tpoR)(s2/usr/lib/python2.7/site-packages/dnf/cli/output.pytprint_file_provides7s$ u%s : u%s.%s : uR$NuRepo : %suDescription : R'uURL : %suLicense : %suProvide : %siu=<>c3@s|]}|kVqdS(N((Rtchar(tpossible(s2/usr/lib/python2.7/site-packages/dnf/cli/output.pys rsuOther : %s(RRGtshowdupesfromreposRRRRRLtcolor_search_matchRwRRRRRtsetRRRtprovidesRR,RjR*(RNR0tvaluesR(RRnR1RR-t name_matchR%Rtprovidet first_providetitem_new((RnR(R0R3R)RNs2/usr/lib/python2.7/site-packages/dnf/cli/output.pyt matchcallbacksp                   cC@s|j|||dtS(uqOutput search/provides type callback matches. This will output more information than :func:`matchcallback`. :param po: the package object that matched the search :param values: the information associated with *po* that matched the search :param matchfor: a list of strings to be highlighted in the output R(R=R(RNR0R8R(((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pytmatchcallback_verboses c C@snd}d}d}t}x|D]}yt|j}||7}y|jr]||7}nWntk rqnX|s~wnyt|j}Wntk rnX||7}Wqtk rt}td} tj | PqXqW|sj|rtj tdt |n||krBtj tdt ||n|rjtj tdt |qjndS(uReport the total download size for a set of packages :param packages: a list of package objects :param installonly: whether the transaction consists only of installations iu2There was an error calculating total download sizeuTotal size: %suTotal download size: %suInstalled size: %sN( RRRtverifyLocalPkgt Exceptiont installsizeRRtloggerterrortinfoR( RNRt installonlyttotsizetlocsizetinsizeRCRtsizeR((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pytreportDownloadSizesD          cC@sd}t}xY|D]Q}y|j}||7}Wqtk rct}td}tj|PqXqW|stjtdt|ndS(umReport the total size of packages being removed. :param packages: a list of package objects iu-There was an error calculating installed sizeuFreed space: %sN( RRR@RRRBRCRDR(RNRRFRCRRIR((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pytreportRemoveSizes      c C@s|s dSg}g}|jr5|jtdnxg|jD]\}t|j|}|j|}|rx|jn|} |jt dd| |q?W|j r|jtdnxX|j D]M}t|j |}|j j |j} |jt dd| |qW|r|j|} x0|D](} |j|jt| | dq5W|j| tdtdddf|d d +nd j|S( Nu+Marking packages as installed by the group:iu@u)Marking packages as removed by the group:u uGroupuPackagesuiu (RLt new_groupsRRR;tadded_packagest _group_by_idRR9REtremoved_groupstremoved_packagesRR[RfRQR<RWR( RNtcompsR}RtoutR`tgrp_idtpkgst group_objecttgrp_nameRRRS((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pytlist_group_transactions. ! ! &4c C@s|jjjtjtjBtjB@r-t}nt}t |jj}i|jj d6|d6td6}|j |}| r|rt j j|j}tj|nt|jdt}t|jdt|}||fS(ureturns set of conflicting packages and set of packages with broken dependency that would be additionally installed when --best and --allowerasinguallow_uninstallu force_bestu ignore_weakR(RHt_goaltactionsRtINSTALLtUPGRADEt UPGRADE_ALLRRRt_allow_erasingtrunRRt_format_resolve_problemst problem_rulesRBtwarningR6tproblem_conflictstproblem_broken_dependency( RNtreport_problemstbesttngtparamsRzRRbtproblem_dependency((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyt_skipped_packagess$   cG@smtjtjBtjBtjBtjBtjB}t}t}|dHkrSg}nt |j j }g}iid6id6id6}d}gfd} t j j rtdn td} xtdd |jftdd |jftdd |jf| |jftd |jftd |jftd|jftd|jftd|jftdd|jfg D]\} } g} i}x_|D]W}|jtjjkrqnx3|jjD]"}|j |tj!|qWqWxl| D]d}|jt jj"tjj#gkr5qnt$|j%|jg}| | |||j&|}qW|j'| | fqWt$t(j j)j*j+}|r,d} g} xW|D]O\}}x@t,|D]2}| j'd||fddddddfqWqW|j'| | fnt$t(j j)j-j+}|rd} g} xW|D]O\}}x@t,|D]2}| j'd||fddddddfqWqiW|j'| | fnt$t(j j)j.j+}|rWd} g} x6|D].\}}| j'|d|ddddfqW|j'| | fnt$t(j j)j/j+}|rd} g} xH|D]@\}}| j'|dd|d|dfddddfqW|j'| | fnt$t(j j)j0j+}|rsd} g} x6|D].\}}| j'|d|ddddfq+W|j'| | fnt$t(j j)j1j+}|rd} g} x6|D].\}}| j'|d|ddddfqW|j'| | fnj j2rj j2j3j4}|r}d} g} x<|j5D].}| j'|j6ddddddfq5W|j'| | fnj j2j3j7}|rd} g} x<|j5D].}| j'|j6ddddddfqW|j'| | fnj j2j3j8}|rod} g} x<|j5D].}| j'|j6ddddddfq'W|j'| | fnj j2j9j4} | rd} g} x<| j5D].}| j'|j6ddddddfqW|j'| | fnj j2j9j7}!|!rad } g} x<|!j5D].}| j'|j6ddddddfqW|j'| | fnj j2j9j8}"|"rd!} g} x<|"j5D].}| j'|j6ddddddfqW|j'| | fqnj:j; r j j j<|@r g} j=d"t>\}}x,t$|D]}#| | |||#g}q( Wd#g}$j j?so |$j'd$ntd%d&j@|$}%|j'|%| fg} x,t$|D]}#| | |||#g}q Wtd'}%j j:jAr |%d}%n|%td(}%|j'|%| fn|d rk j j)jB rk j j2oc j j2j9pc j j2j3 rk dS|di|d|dig}d|ddd)g}&jC|d*d+d,|&d-d.}&|&\}'}}(})}*d/d0jDjEjFtGd1d2d|' ftd3| ftd4|( ftd5|) ftd6|*ffd&d0jDjEfg}+x.|D]&\} } | r d7| },nx| D]\}-}.}/}0}1}2}3|-|' |3f|.| f|/|( f|0|) f|1|*ff}&jF|&d&d8}4jHj:jI\}5}6xTt$|2D]F}7d9td:d;}8|8|5|7jJ|6|7jK|7jLf;}8|4|87}4q! W|,|4},q W| ri |+j'|,qi qi W|+j'td<d0jDjEtd=tM|jtM|jtM|jtM|jdftd>tM|jdftd?tM|jtM|jtM|jdftd@tM|jdftdAtM|tM|dff}9d}:d};d}<d}=x|9D]\} }>}?|> r |? r q ntGd1d2|>}@tN| }AtNtO|>}BtN|@}C|?r"tNtO|?}Dnd}DtP|A|:}:tP|B|;};tP|C|<}<tP|D|=}=q Wx|9D]\} }>}?tGd1d2|>}@|?r'tGdBdC|?}EtQ| |:}F|>rdD}4|+j'|4|F|;|>dE|<|@f|=|?|Efq\dF}4|+j'|4|F|;|<d&|=|?|Efqo|>rodG}4|+j'|4tQ| |:|;|>|@fqoqoWdj@|+S(Iu]Return a string representation of the transaction in an easy-to-read format. unuvuric@s1|j\}}}}} |j} |j} t|j} |dkrNd}n|jrfjj} n$|j r~jj } n jj } |j ||| | | || fxidt |fdt | fdt | ffD]4\}}||j|d|||cd7 %siuDisabling module streamsuResetting module streamsuInstalling Environment GroupsuUpgrading Environment GroupsuRemoving Environment GroupsuInstalling GroupsuUpgrading GroupsuRemoving GroupsRdu--bestu--allowerasinguSSkipping packages with conflicts: (add '%s' to command line to force their upgrade)u u,Skipping packages with broken dependencies%su or part of a groupiRXu RPRiu %s %s %s u=uPackageuPackagesuArchuVersionu RepositoryuSizeu%s: u u u replacingu %s%s%s.%s %s u Transaction Summary %s uInstalluUpgradeuRemoveu DowngradeuSkipuDependent packageuDependent packagesu%s %*d %s (+%*d %s) u%-*su%s %s ( %*d %s) u %s %*d %s N(RRR[R\t DISTUPGRADEtDISTUPGRADE_ALLt DOWNGRADERZR6RLR4RHRXRt WITH_MODULESRRR'R0R)R"R$R&R.R-R,RRRRtTransactionItemAction_OBSOLETEDRt getReplacedByRltaddtFORWARD_ACTIONSR*RR[RRRYt_moduleContainertgetInstalledProfilesRR;tgetRemovedProfilestgetEnabledStreamstgetSwitchedStreamstgetDisabledStreamstgetResetStreamst_historytenvt _installedR8tgetNamet _upgradedt_removedRRGReRYRiRR]Rtupgrade_group_objects_upgradet isChangedR\RJRPRQRRrRRRRR8R RRmR (GRNRtforward_actionstskipped_conflictstskipped_brokent list_buncht pkglist_linesRRoRwt ins_group_msgRtpkglistRntreplacesR3Rat obsoletedtinstalledProfilesRtprofilestprofiletremovedProfilestenabledStreamststreamtswitchedStreamstdisabledStreamst resetStreamstinstall_env_groupRtupgrade_env_grouptremove_env_groupt install_groupt upgrade_groupt remove_groupRtrecommendationstskip_strRPtn_widtv_widtr_widts_widRRttotalmsgRqRrRRRIRpRvRRoRptobspotappendedt summary_datatmax_msg_actiont max_msg_countt max_msg_pkgstmax_msg_depcountRtdepcounttmsg_pkgstlen_msg_actiont len_msg_countt len_msg_pkgstlen_msg_depcountt msg_deppkgst action_msg((RNs2/usr/lib/python2.7/site-packages/dnf/cli/output.pytlist_transactions,      % $ "$4$4$&$8$&$& ,,,,,,      +!  "#"  &"(        c@sfd}d}t|jj}jdt\}}|j|}ttg|D]}t|^q^}xt d|j ft d|j ft d|j |j |j|jft d|jft d|ft d |j|j|jft d |jfgD]\} } | s9q!ng} |d | 7}x!| D]} | jt| qTWx'dD]} || | }|rxPqxqxW|sjjd g}nxV| r| t| }|d7}|jt||dd7}| t|} qWq!W|S(uReturns a human-readable summary of the results of the transaction. :return: a string containing a human-readable summary of the results of the transaction c@st||krgSjj|dd}|dkr>gSdg|}d}x|D]w}t|||krt|||}||krgS||8}t|||tt|D]*}||c||7<||cd9uSystemu cW@s!|j|}|sdS|dS(uf Split gives us a [0] for everything _but_ '', this function returns '' in that case. ui(Rj(ttexttargsRz((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyt _safe_split_0su;iu%s <%s>u %s ... <%s>u<%s>(li( RgR;RRLRR8R tpwdtgetpwuidRtpw_gecostpw_nameR ( RNRtlimittutloginidRRtusertfullnamet user_name((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyRs*#     c@sfd}d|krdS|jdd\}}||}|jkrVdS|dkrfdS||}|jkrdS|dks|dkrdS||kr||}}n||fS(u3 Convert a user "TID" string of 2..4 into: (2, 4). c@sy|dks|jdrvj}|jdrrt|td}|dkretdn||8}n|St|SWntk rdSXdS(Nu--lastu--last-iuz(RlttidRR8RRL(txRtoff(told(s2/usr/lib/python2.7/site-packages/dnf/cli/output.pytstr2ints     u..iiN(RLRjR(RRRtbtidtetid((Rs2/usr/lib/python2.7/site-packages/dnf/cli/output.pyt_historyRangeRTIDss"     cC@st}d}xt|D]}|d|kr_td}tj||d|dqn|d}x0t|d|ddD]}|j|qWqW|S(uu Convert a list of ranged tid typles into all the tids needed, Eg. [(2,4), (6,8)] == [2, 3, 4, 6, 7, 8]. iiu4Skipping merged transaction %d to %d, as it overlapsi(R6RRRBRaRR~(RNtrtidsttidstlast_endtmtidRR((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyt_historyRangeTIDss   "cC@s|jj}|dkr2tjtddSt}g}|}x|D]y}yt||j|WqNt k r|j ||}|r|j |j |gqNn|j |qNXqNW|r|j |jj|n| r|rtjtddS|S(NuNo transactionsu)Bad transaction IDs, or package(s), given(R}tlastRLRBtcriticalRR6RR~RRtupdateRRtsearch(RNtextcmdsRRtpatstusertidsRtrtid((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyt_history_list_transactionss.      c C@s|j|}|dk r|jj|}|jjdkrNddg}n|jjdkrldg}nt|jjdkstt}d}d}xD|D]<}|d7}|jdkr|d7}n|j |j qWd}t |dkrt d} n t d } t |tt d d d t| d d tt d ddtt dddtt dddft ddd}xV|D]K}t |dkr|jpd} n|j|j d } t| } tjdtj|j} |j|j\} } t| d d } t| dd} d} }|jdkrmd} }n,|jrd} }n|jrd} }n|jrd} n|jrd}nt ||j| | | | fd|| fqWndS( u)Output a list of information about the history of yum transactions. :param extcmds: list of extra command line arguments :return: (exit_code, [errors]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string uusersiiucommandsusingle-user-commandsiu%s | %s | %s | %s | %su Command lineu User nameuIDiiu Date and timeiu Action(s)iuAlterediu-iOu%6u | %s | %-16.16s | %s | %4uuu%Y-%m-%d %H:%Mu u*u#uEuu%s%sN(RRLR}RRGthistory_list_viewRR6tcmdlineR~tloginuidR8RRR RR Rtstrftimet localtimet beg_timestampRRt return_codet is_outputtaltered_lt_rpmdbtaltered_gt_rpmdbR(RNRRtold_tidstuidstdonetblanksRtfmtRttmRtuiactstrmarktlmark((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pythistoryListCmdsb                     cC@st|}|jj}|d krGtjtdddgfS|j}|j}g}| rt |dkr|jjdt }|d k r|j |j|j |qn|jj |}|stjtdddgfSd \} } d } t } |r3t|}|j\} } nxf|D]^} |d k r| j|kr|jj}| jt|nd }t }| j| kr| j| kr| d krt| } n | j| t}n| d k rb| rtdd nt} |j| d } |rb|j\} } | j| kr_| j| kr_| } t}q_qbn|s:| rtdd nt} |j| |q:q:W| d k r| rtdd n|j| nd S( uOutput information about a transaction in history :param extcmds: list of extra command line arguments :return: (exit_code, [errors]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string uNo transactionsiuFailed history infoitcomplete_transactions_onlyu$No transaction ID, or package, giveniu-iON(ii(R6R}RRLRBRRRtend_rpmdb_versionR8RR~RRRRR~t_rpmdb_versiontcompare_rpmdbvRRtmergeRRt_historyInfoCmd(RNRRtmtidsRRtlasttidtlastdbvt transactionstbmtidtemtidtmobjR ttranstrpmdbvtmerged((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pythistoryInfoCmd[sl                c@sY|j}t|tr$|g}ng|D]}j|^q+}itdd6tdd6tdd6tdd6itdd6td d6td d6td d6tgtjtjD]}t|^q}|d <|d u%s%sN(!R}RRLRBRRRHRR RRRR8RR8trpmdb_problemst trans_skipRRR*RJR[Rtui_nevraRRRRRR/RRR(RNRRRRKR RRRRRRRRNRLRORP((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pythistoryPackageListCmdsp    # "                (  !' '!  (;t__name__t __module__t__doc__RRORWRfRrRwt staticmethodR|tpropertyR}R~RLR\RRRQRRRRRRRRRRRRR R RRR#R=R>RJRKRWRiRRRRRRRRRRR6R"RRRHR7RT(((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyRFos      ~ /       5 $M-   '  b /    ) J   "%   ER           Package %s.%s %s will be installeduuu(---> Package %s.%s %s will be an upgradeueu$---> Package %s.%s %s will be eraseduru)---> Package %s.%s %s will be reinstalledudu)---> Package %s.%s %s will be a downgradeuou(---> Package %s.%s %s will be obsoletinguudu&---> Package %s.%s %s will be upgradeduodu'---> Package %s.%s %s will be obsoletedN(RLRRBtdebugRRR(RNRtmodeR8((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyt pkg_addeds&        cC@s&tjtd|jd7_dS(uRPerform setup at the beginning of the dependency solving process. u"--> Starting dependency resolutioniN(RBR[RRZ(RN((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pytstartscC@stjtddS(uAOutput a message stating that dependency resolution has finished.u"--> Finished dependency resolutionN(RBR[R(RN((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyRs(RURVRWROR]R^R(((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyRs   ) t CliKeyImportcB@seZdZdZRS(cC@s||_||_dS(N(RHR8(RNRHR8((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyRO%s cC@sd}td|||tjj||jddf}tjd||jjj rft S|jjj ryt S|j jS(NcS@s,tjjrdnd}|djd|S(Nu0t0ii(RtpycomptPY3trjust(Rtrj((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pytshort_id+suLImporting GPG key 0x%s: Userid : "%s" Fingerprint: %s From : %sufile://uu%s(RRtcryptot_printable_fingerprintRiRBRRHRGt assumeyesRtassumenoRR8R(RNRtuseridt fingerprintRt timestampReR((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyt_confirm)s   (RURVRORm(((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyR_$s tCliTransactionDisplaycB@sneZdZedZdZdZdZdZdZ dZ dZ e d d d ZRS( u1A YUM specific callback class for RPM operations.cC@stjjjS(N(RRIRJt _term_width(RN((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pytBscC@sDtt|jd|_d|_t|_d|_d|_ dS(Nuu=i( tsuperRnROtlastmsgRLt lastpackageRR8tmarktmarks(RN((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyRODs     c C@stjjj|}|dkr%dS|j}t|} ||_|dkr[d} n|td|} |j ||||| || |dS(uOutput information about an rpm operation. This may include a text progress bar. :param package: the package involved in the event :param action: the type of action that is taking place. Valid values are given by :func:`rpmtrans.LoggingTransactionDisplay.action.keys()` :param ti_done: a number representing the amount of work already done in the current transaction :param ti_total: a number representing the total amount of work to be done in the current transaction :param ts_done: the number of the current transaction in transaction set :param ts_total: the total number of transactions in the transaction set Niid( RRtACTIONSR[RLt_max_action_widthR RsRt _out_progress( RNR$Rtti_donetti_totaltts_donetts_totalt action_strtwid1tpkgnametpercent((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyRMNs      cC@slt|ds_d}x;tjjjD]'}t|}||kr(|}q(q(W||_n|j}|S(Nu_max_action_wid_cachei(thasattrRRRvR8R t_max_action_wid_cache(RNR~Rbtwid_val((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyRwns     c C@s|jrtjjs$||kr|j|||dtjjd|d|\} }} t|}| t|||t|| | f} | |jkrtj j d| tj| |_||krt dqqndS(NRMRR~u write_flushu ( R8RRtisattyt_makefmtR R RrRRt_terminal_messengerR( RNRyRzR{R|RtprocessRR~R twid2R((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyRxys$   cC@sdS(N((RNR$R((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pytfilelogscC@sdS(N((RNtmessage((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyRCscC@s#|r|jjt|ndS(utPrint messages originating from a package script. :param msgs: the messages coming from the script N(t rpm_loggerRDR (RNR((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyt scriptoutsicC@stt|}d||f}d|d|d} | ||f} |dkr]d} n t|} d|d} | d|d7} | d7} | d7} | d7} |j} | | kr| } n| | 8} | | dkr| d} n|j| | }d||f} d| d }| |d}|rN|d krNd | }|}n|r|d kr||jt||d f}nd}d|d| }| }n`|d krd| }|}nA|d kr||j|f}nd}d|d| }| }|||fS(Nu%s.%su%us/%usiiiu[%-us]idu %s: %s igY@uu %s: %s u u %s: %s u %s: %s (R8RRLR RRtR(RNRR{R|RMRR~tlRItfmt_doneR tpnltoverheadRRutfmt_bartfull_pnlR Rtbar((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyRsP              %     N(RURVRWRYRRORMRwRxRRCRRRLR(((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyRn?s    c C@s6d}tjjsdS|dkr.d}n%|dkrMt||}nd}tjjj}|dkr||krd}nd||f}|t |d8}|dkrd}n|dkr|d8}|dkrd}n|t ||}d|||f}n||kr?d t ||||f}n|d 8}|dkr^d}n|d} | t |krt |} n|| 8}|t ||}d t || | |||f}||krtj jd |tjn||krtj jd d tjntj jddtjdS(uIOutput the current status to the terminal using a simple text progress bar consisting of 50 # marks. :param current: a number representing the amount of work already done :param total: a number representing the total amount of work to be done :param name: a name to label the progress bar with u#Niu-u %d/%diiu [%-*s]%su %s%siu %s: [%-*s]%suwriteu uflushRR(RRRRRRIRJRoRLR8RR R RR( RxttotalRRtRRRthashbarR8tnwid((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pyRsL                    (=RWt __future__RRRtlibdnf.transactionRtcopyRtdnf.cli.formatRRtdnf.i18nRRRR R R R t dnf.pycompR RRRtdnf.yum.rpmtransRtdnf.db.historyRtdnf.baseRt dnf.callbacktdnf.cli.progresst dnf.cli.termtdnf.conft dnf.cryptotdnf.transactiontdnf.utilt dnf.yum.miscR,RR5tloggingR^RRRt getLoggerRBR4REtobjectRFtcallbacktDepsolveRt KeyImportR_RnRLR(((s2/usr/lib/python2.7/site-packages/dnf/cli/output.pytsV 4"                   - <