VULN_CHECK_I913V6 jq^dZddlmZddlmZddlmZddlZddlZddlZddlZ ddl Z ddl Z ddl Z ddl Z ddlZddlZddlmZmZddlmZmZmZmZmZmZmZmZddlmZmZmZm Z m!Z!dd l"m#Z#dd l$m%Z%ddl&Z'ddl(Z'ddl)Z'ddl*Z'ddl+Z'ddl,Z'ddlZ'ddl-Z'ddl.Z'ddl/Z'e j`d Z1d Z2Gd de3Z4Gdde'jjjlZ7Gdde'jjjpZ9Gdde#Z:ddZ;y)z"Handle actual output from the cli.)absolute_import)print_function)unicode_literalsN) format_number format_time)_C_P_ucdfill_exact_width textwrap_fill exact_widthselect_short_long)xrange basestringlongunicode sys_maxsize)TransactionDisplay)MergedTransactionWrapperdnfc(tj|ftjd}t|}|dz }| |z}|stjd|}n|r|j d|zt |}t t|g|g|zS)Nr) itertoolschainrepeatlenextenditerlistzip) cols_countlabellstleft lst_length right_count missing_itemslst_iters 3/usr/lib/python3.12/site-packages/dnf/cli/output.py_spread_in_columnsr-6s ??E8Y%5%5b%9 :DSJq.KK+-M r;/  5=()CyH D4H: 34 55c TeZdZdZdZej dZdZdZ dZ dZ dZ e d Zed Zed Z ddZ d>dZdZdZdZd?dZd@dZdAdZid ifdZdBdZdZ dZ!dZ"dZ#dZ$d Z% dCd!Z&dAd"Z'd@d#Z(d$Z)d%Z*dAd&Z+d'Z,d(Z-d)Z.d*Z/d+Z0dAd,Z1d@d-Z2ge3fd.Z4gfd/Z5e6d0e6d0e6d1e6d2e6d3e6d4e6d5e6d6e6d7e6d8e6d9d: Z7gfd;Z8y )DOutputz+Main output class for the yum command line.z z ^\*{0,2}/c||_||_tjjj |jj |_d|_y)N)color)confbaserclitermTermr2progress)selfr4r3s r,__init__zOutput.__init__Is<  GGLL%%DIIOO%<  r.c|jj}ddz|z}|jt||d}|||fS)N%s= )r6columns fmtColumnsr#)r9col_datarow term_widthruleheaders r,_bannerzOutput._bannerOsCYY&& czJ&S(!3S9VT!!r.c2|dDcgc] }t}}|D]=}t|D]-\}}||}t|}|j|ddz||</?|j |dd} t t tj| Scc}w)Nrr )indent) dict enumeraterget calcColumnsr"mapoperatorneg) r9rowsrrArBivalcol_dctlengthcolss r, _col_widthszOutput._col_widthsUs$(G,GqDFG,C%cNC"1+S")++fa"81"<+ $t<C d+,,-sBc"d}d}|snit|tr|dk(r|jjd}n9|dk(rn2|j ddj D]}|dk(rd} ||jjvr||jj|z }A||jj vr||jj |z }v|jdr;|dd|jj vr ||jj |ddz }|jds|dd|jjvs||jj|ddz }|r|jjd}||fS) Nrboldnormal,r>zfg:zbg:) isinstancerr6MODEreplacesplitFG_COLOR startswithBG_COLOR)r9 highlighthibeghiendhighs r, _highlightzOutput._highlight`sh Iz2i66IIINN6*E ( " "))#s399;8#ETYY^^+TYY^^D11ETYY///TYY//55Eooe,12h$))"4"44TYY//QR99Eooe,12h$))"4"44TYY//QR99E< IINN8,Eu~r.c j|j|\}}|jj||||fi|SN)rhr6sub)r9haystackrdneedleskwdsrerfs r,_sub_highlightzOutput._sub_highlight}s4y1 utyy}}XueWEEEr.cDd}|D]}||d|z kr|S||dz }|S)z; Spaces left on the current field will help how many pkgs? rr)current data_tupsr'rettups r,_calc_columns_spaces_helpsz!Output._calc_columns_spaces_helpssBCs1v'(  3q6MC r.c.|jjSrj)r4historyr9s r,rxzOutput.historysyy   r.c.|jjSrj)r4sackrys r,r{z Output.sacksyy~~r.Nct|}|}dg|z}td|D]!}t||j||<#||jj }|dg|dz z}|j d|sg} td|D]8}||} | r| j | dd"| j ||dz:| dxxt|z cc<|jj} t| | kDr| S| }|t||dz zt|zz}|ds|dz }|dkDr$d} d} td|D];}|j|||||}|s| r||dz k(r |dz | kr2|| kr8|} |} =| rB|| jdd|| z }|| s | |dz k(r|dz}|| xx|z cc<||z}d}td|D] }||s |dz }|r.||z}td|D]}||s ||xx|z cc<||z}|dz}||z}td|D]}||xx|z cc<||xx|||zz z cc<d}|dkDr$|S)aDynamically calculate the widths of the columns that the fields in data should be placed into for output. :param data: a list of dictionaries that represent the data to be output. Each dictionary in the list corresponds to a column of output. The keys of the dictionary are the lengths of the items to be output, and the value associated with a key is the number of items of that length. :param columns: a list containing the minimum amount of space that must be allocated for each row. This can be used to ensure that there is space available in a column if, for example, the actual lengths of the items being output cannot be given in *data* :param remainder_column: number of the column to receive a few extra spaces that may remain after other allocation has taken place :param total_width: the total width of the output. self.term.real_columns is used by default :param indent: string that will be prefixed to a line of output to create e.g. an indent :return: a list of the widths of the columns that the fields in data should be placed into for output Nrr) rrangesorteditemsr6 real_columnsappendrr?sumrrvpop)r9datar?remainder_column total_widthrIrVpdatad full_columnscol default_widthhelpsrSthelpsdiffoverflowed_columnsnorms r,rMzOutput.calcColumnss24yv}q$AU1X^^-.DG   ))00K ?cTAX&G NN1  LAt_1g ''B 3 '' Q7 % Os6{ *O II--M< =0##'K G q1K4GGH r{ 1 KAoECAt_88T!W9DFaD1HoFQJ%3GE>%"Cy}}Q'*WS\9s|): 1$K $ t# !" At_Aw"a'"%"#&884A7 AJ$&J4'K ) AID$&DAt_ d" % $ %t )D D %KkAonr.c|dkrd| fSd|fS)z$Returns tuple of (align_left, width)rTFrq)widths r,_fmt_column_align_widthzOutput._fmt_column_align_widths! 195&> !u~r.ct|dk(st|dk(sJt|dk(r |\}}dx}}t|dk(r|\}}}|j|\}}tfS)Nr~r\r)rrhr )r9rArSrrerfrds r, _col_datazOutput._col_datas{8}!S]a%777 x=A #LS% EE x=A &. #S%!__Y7NUEC%..r.ct|}t|}g}|ddD]}|j|\}}} } |s|dz }|j|2|j |\} }t |} | |kr?|dz }| r|j | |d|| z z| gnA|j | d|| z z|| gn%|dd||zdzzzz }|j | || g||z }|dz }|j|d\}}} } |j |\} }t||| | | }|d |zz }|j||t|zS) a.Return a row of data formatted into a string for output. Items can overflow their columns. :param columns: a list of tuples containing the data to output. Each tuple contains first the item to be output, then the amount of space allocated for the column, and then optionally a type of highlighting for the item :param msg: a string to begin the line of output with :param end: a string to end the line of output with :return: a row of data formatted into a string for output Nr}r<z %s%s%s%s r>z%s%s%s r)r'prefixsuffixz%%s%s) r"rrrrrr r tuple) r9r?msgendrrrArSrrerf align_left val_widths r,r@zOutput.fmtColumns%sw-#h  H)-)A &S%u  C "&">">u"E Z#C(IE!|#KKSEI4E-F NOKKuy/@(A3 NO{SK%,?!,C%DDD UC/0 5 K 1 K/%0&*^^GBK%@"eUE"::5AUsE %*5: x#~ CU4[  r.c|d}||jd|j}|ddg}t||j|jf||}t |j |y)aPrint a package as a line. :param pkg: the package to be printed :param ui_overflow: unused :param indent: string to be prefixed onto the line to provide e.g. an indent :param highlight: highlighting options for the name of the package :param columns: tuple containing the space allocated for each column of output. The columns are the package name, version, and repository N)ii.rZ)namearchr#evr _from_repoprintr@)r9pkg ui_overflowrIrdr?nahi_colss r, simpleListzOutput.simpleListTs\ ?%G #((CHH 5h1r377CNN3WgF doog&'r.c|d}|t|}|ddg}|j}t||f||}t|j |y)a(Print a package as a line, with the package itself in envra format so it can be passed to list/install/etc. :param pkg: the package to be printed :param ui_overflow: unused :param indent: string to be prefixed onto the line to provide e.g. an indent :param highlight: highlighting options for the name of the package :param columns: tuple containing the space allocated for each column of output. The columns the are the package envra and repository N)irrZ)r ui_from_repor#rr@) r9rrrIrdr?envrarrids r,simpleEnvraListzOutput.simpleEnvraListjsV ? G #c(+h1uclGW5 doog&'r.c@tt|jy)z.Print a package as a line containing its name.N)rr rr9rs r,simple_name_listzOutput.simple_name_lists c#((mr.c,tt|y)z/Print a package as a line containing its NEVRA.N)rr rs r,simple_nevra_listzOutput.simple_nevra_lists  c#hr.ct|}|jj}|st}n|dkrd}d|dz zdz}|s|St |}t ||||}|j ddkDr||dzkDrt |||d }|S) zReturn a key value pair in the common two column output format. :param key: the key to be formatted :param val: the value associated with *key* :return: the key value pair formatted in two columns for output r>r~z: )rinitial_indentsubsequent_indent rr\z ...: )rr6rrr r count)r9keyrSkeylenrVnxtrts r, fmtKeyValFillzOutput.fmtKeyValFillsS!yy%%D BYDVaZ 4'J#hCtC.13 99T?Q 6TQY#742>@C r.ct|}|jjdz }t|}||dz k\r|dzx}}n|||z dzz}|||z t |z z}|d|d|S)aFormat and return a section header. The format of the header is a line with *name* centered, and *fill* repeated on either side to fill an entire line on the terminal. :param name: the name of the section :param fill: the character to repeat on either side of *name* to fill an entire line. *fill* must be a single character. :return: a string formatted to be a section header r~r>)r r6r?rr)r9rfillrVname_lenbegrs r, fmtSectionzOutput.fmtSections|4yyy  1$t$ q !q C#4(?q01C$/CH45C $,,r.c  d}fd}g}j|\}}tdtddtdd}|j||||j||j r+|j|t d|j tdtddtdd}|j|||j|j|t d |jtdtdd tdd }|j|||jtdtdd tdd }|j||tt|j|j|t d |jtdtddtdd}|j|||j|jr>j j#|} | r!|j|t d| j$j&r8|j|t d|j(|j|t dt*j,j/|j0|j2rH|j|t dt*j,j/|j2j j5|} | rT t7| j8j;} |j|t dj?| tdtddtdd}|j|||j@|jBr4|j|t dtE|jB|j|t d|jFtdtddtdd}|j|||jHdjK|S#t<$rd} Y@wxYw)zPrint information about the given package. :param pkg: the package to print information about :param highlight: highlighting options for the name of the package cRdjt|dddt|gS)Nr> :)joinr str)rrSs r,format_key_valz)Output.infoOutput..format_key_vals&88-c2r:CSJK Kr.cLjt|dddz|xsdS)Nr : r)rr )rrSr9s r,format_key_val_fillz.Output.infoOutput..format_key_val_fills*%%&6sB&Ce&KSYTVW Wr.rshortNamerEpochVersionReleaseArch ArchitectureSizeSourceRepo Repositoryz From repoPackager Buildtimez Install timeNz Installed bySummaryURLLicense Descriptionr)&rhrr rrepochrversionreleaserrfloat_size sourcerpmrepoid _from_systemrxrepor3verbosepackagerrutilnormalize_time buildtime installtime package_dataint_itemgetInstalledBy ValueError_pwd_ui_usernamesummaryurlr license descriptionr) r9rrdrr output_listrerfr history_repo history_pkguids ` r, infoOutputzOutput.infoOutputs L X 3 Bw$7$&vv$68>#6;SXXu*MO P 99   ~aj#))D EBw $:$&vy$9;>#s{{;<>!I, DEBw$7$&v~$>@>#sxx89Bw$7FF9KL>#*7cii8H*IK L >!H+s}}EFBw$7$&v|$<>>#szz:;   <<,,S1L"">!K.,#OP 99     ~a mS\\J K   ~a n.1hh.E.Ecmm.T V W"">!N2C25((2I2I#//2Z$\],,33C8Kk//>>@AC"">!N2CTEZEZ[^E_#`a Bw $:$&vy$9;.sCKK@A 77   ~ahCGG E F.q|S[[IJ Bw $>$&v}$=?.sCOODEyy%%)"Cs#R// R>=R>c |\}}||jj}|jtjk7r|jj }|j ||||j ||d|jjy|j}|jd|j}|j} t|dd| dd |d d |d y) a{Print a simple string that explains the relationship between the members of an update or obsoletes tuple. :param uotup: an update or obsoletes tuple. The first member is the new package, and the second member is the old package :param changetype: a string indicating what the change between the packages is, e.g. 'updates' or 'obsoletes' :param columns: a tuple containing information about how to format the columns of output. The absolute value of each number in the tuple indicates how much space has been allocated for the corresponding column. If the number is negative, the text in the column will be left justified, and if it is positive, the text will be right justified. The columns of output are the package name, version, and repository N)r?rd )r?rIrdrz35.35z [z.12z] z.10r>z20.20) r3color_update_remotereponamehawkeySYSTEM_REPO_NAMEcolor_update_localrcolor_update_installed compactPrintrrrr) r9uotup changetyper? changePkginstPkgchi c_compact i_compactc_repos r,updatesObsoletesListzOutput.updatesObsoletesLists" %G  ))//C!!V%<%<<ii22 OOIw#O F OOGWW&*ii&F&F  H **, &||W\\: !! &*i9 :r.cp|dvrt|dkDrtd|zt}|dk(r=i}|D]&} | |t| t| jz<(|j }t |D] } | j| jf} d} | |vr|jdd} n`| j|| r|jdd} n9| j|| r|jd d } n|jd d} |dk(r|j| d | | |dk(r&|j|j| | dz|dk(r|j| |dk(r|j!|   |r#tdj#t |t|Sy)aPrints information about the given list of packages. :param lst: a list of packages to print information about :param description: string describing what the list of packages contains, e.g. 'Available Packages' :param outputType: The type of information to be printed. Current options:: 'list' - simple pkg list 'info' - similar to rpm -qi output 'name' - simple name list 'nevra' - simple nevra list :param highlight_na: a dictionary containing information about packages that should be highlighted in the output. The dictionary keys are (name, arch) tuples for the package, and the associated values are the package objects themselves. :param columns: a tuple containing information about how to format the columns of output. The absolute value of each number in the tuple indicates how much space has been allocated for the corresponding column. If the number is negative, the text in the column will be left justified, and if it is positive, the text will be right justified. The columns of output are the package name, version, and repository :param highlight_modes: dictionary containing information about to highlight the packages in *highlight_na*. *highlight_modes* should contain the following keys:: 'not_in' - highlighting used for packages not in *highlight_na* '=' - highlighting used when the package versions are equal '<' - highlighting used when the package has a lower version number '>' - highlighting used when the package has a higher version number :return: number of packages listed )r"infornevrarr<r"Fznot inrZr=>rY IIOO%//1<<> !c8n)=a)@AH9$'1!4( Y&'1!4( B r.c|i}i}tjtt|dD]}|j |}|t t |t |jz}t t |j}|j |ddz||<|j |ddz||<||fSr4) rrr"r#rLrr GRP_PACKAGE_INDENTr) r9r9 name_dict nevra_lengths repo_lengthsr:rnevra_lrepo_ls r,_pkgs2col_lengthszOutput._pkgs2col_lengthss  !c8n)=a)@AH--)C{!#c(+k$:Q:Q.RRG S\\!23F%2%6%6w%BQ%FM' "#/#3#3FA#>#BL B|,,r.cD|D]}t|j|yrj)rr=)r9 pkg_namesrs r,_display_packageszOutput._display_packagessD D33T: ;r.c|D]L} ||}d}|js|jj }|j |d|j||Ny#t$rt|j|YtwxYw)NFT)rrIrdr?)KeyErrorrr=rr3color_list_available_installr)r9rEr>r?rrrds r,_display_packages_verbosez Output._display_packages_verbosesD o I## IIBB  $(,(?(?+4)0 ! 2  7 7>? sA"A87A8cd}ttdtjj |j z|j j}|r*ttdt|jz|jr.ttdt|jzxsd|jr!ttd|jztd||jftd||jftd ||jftd ||jff}|rx|j!|}|j#||}|j%|}|d  |d  f}|D]2\}} t'| d krt||j)| ||4y |D]0\}} t'| d krt||j+| 2y )zOutput information about the packages in a given group :param group: a Group object to output information about c&td|DS)Nc3nK|]-}tjj|j/ywrjrr_name_unset_wrapperr.0rs r, z?Output.display_pkgs_in_groups..names..s$UHS#((66sxx@H35r)packagess r,namesz,Output.display_pkgs_in_groups..namessUHUU Ur.z Group: %sz Group-Id: %s Description: %srz Language: %sz Mandatory Packages:z Default Packages:z Optional Packages:z Conditional Packages:rrN)rrrrrOui_namer3rr idui_description lang_onlymandatory_packagesdefault_packagesoptional_packagesconditional_packagesr;rCrMrrJrF) r9grouprVrr9r> col_lengthsr? section_namerUs r,display_pkgs_in_groupszOutput.display_pkgs_in_groupss  V a nsxx;;EMMJJK))##  !O$s588}4 5    !&'#e.B.B*CCIr J ?? !O$u6 7% &e.F.F(G H # $eE,B,B&C D $ %uU-D-D'E F ' (%0J0J*K L N ,,X6I009EK&&{3G {WQZK0G,4(xx=1$l#..xGL -5 -5(xx=1$l#&&x0 -5r.c\d}ttdtjj |j z|j jr*ttdt|jz|jr0t|jxsd}ttd|ztd||jftd||jff}|D]0\}}t|dkrt||j|2y ) zOutput information about the packages in a given environment :param environment: an Environment object to output information about c&td|DS)Nc3nK|]-}tjj|j/ywrjrN)rQr`s r,rRzFOutput.display_groups_in_environment..names.. s&WPVu#((66uzzBPVrSrT)groupss r,rVz3Output.display_groups_in_environment..namessWPVWW Wr.zEnvironment Group: %sz Environment-Id: %srrWz Mandatory Groups:z Optional Groups:rN)rrrrrOrXr3rr rYrZmandatory_groupsoptional_groupsrrF)r9 environmentrVrr9rbrUs r,display_groups_in_environmentz$Output.display_groups_in_environments  X a'(388+G+G H[H[+\\] 99   !)*S-@@ A  % %k889?RK !&'+5 6# $eK,H,H&I J " #U;+F+F%G HJ)1 $\88}q  ,   " "8 , )1r.cdfd fd}jjrdz}njdjd}j |j xsd}r-jj j|d }t||jj}|syttd jzd}d} t|D]U} j | k(rd } j| k(rtd } | | |d d }?j| k(rtd} | | |d d }hj| k(rtd} | | |d d }|| |rd }td} j D]} t#| } t%j$| | r| | |d d }3| j'd} tdt)fd| Dr| j'd}n| }t%j$| |s| | |d d }Xt)|| gs't|D]} td} | | |d ty)aOutput 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 Fc|sttdt|xsd}|dk(ryrj|d}|rtj ||yt||zy)Nz Matched from:rT ignore_case)rrr ror)ritemprinted_headline can_overflowrdmatchforr9s r,print_highlighted_key_itemz8Output.matchcallback..print_highlighted_key_item'sk#a()t9?Drz**4HRV*Wd((d34cDj!r.cjj|sytd}d}jD]+}t j||s|||xs|dd}-|S)NFzFilename : %srrT)FILE_PROVIDE_REmatchrfilesfnmatch)rp printed_matchr file_matchfilenameportr9s r,print_file_providesz1Output.matchcallback..print_file_provides4sk''--d3&'CJHH??8T2.Xz'B]QVX!%J %  r.z%s : rrrNTrnzRepo : %szDescription : rvzURL : %szLicense : %szProvide : %srz=<>c3&K|]}|v ywrjrq)rQcharpossibles r,rRz'Output.matchcallback..psCdd 0dszOther : %sF)r3showdupesfromreposrrrrcolor_search_matchrorrrrrrrrprovidesrrzr`any)r9r~rrsrrdrrr{ name_matchrprprovide first_provideitem_newrrts`` ` ` @@r, matchcallbackzOutput.matchcallbacksY "  99 ' 'B,C "1C  bjj&6B7   II88 %%c9hD%QC c ?ii''G  a"#boo56  KDzzT!! ~~%()*3mRVW $ 4*+*3mRWX $ t#*+*3mRWX $ $T=9 $ )*!{{G!'lGw523]bc(, (/ (: #&u:CdCC'+zz|AH'+H"??=(C6 #Wm%Q,0M ++ LM:./F *+*3mRWX$ r.c,|j|||dS)aqOutput 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 T)r)r)r9r~rrss r,matchcallback_verbosezOutput.matchcallback_verboses!!"fh!EEr.cpd}d}d}d}|D]Q} t|j}||z } |jr||z }|s7 t|j}||z }S|s|r(t jt dt|||k7r+t jt dt||z |r)t jt dt|yyy#t$rYwxYw#t$rYwxYw#t$r&d}t d} t j| YwxYw) zReport 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 rFTz2There was an error calculating total download sizezTotal size: %szTotal download size: %szInstalled size: %sN) rrverifyLocalPkg Exception installsizerloggererrorrr) r9rU installonlytotsizelocsizeinsizerrsizers r,reportDownloadSizezOutput.reportDownloadSizesH C 399~4))+4#s/D$)6 A./(5g(>@'! A78(5g6G(HJ A23]65JK#!! LM S!  sWDC(DC7D( C41D3C44D7 DDDD+D54D5cd}d}|D]} |j}||z }|s)tj tdt |yy#t$r&d}td}tj |YZwxYw)zmReport the total size of packages being removed. :param packages: a list of package objects rFTz-There was an error calculating installed sizezFreed space: %sN)rrrrrrr)r9rUrrrrrs r,reportRemoveSizezOutput.reportRemoveSizes C yy4  KK+,mG.D E  GH S!  sA  +A98A9c ^|syg}g}|jr|jtd|jD]\}t|j |}|j |}|r |j n|} |jtdd| z|^|jr|jtd|jD]`}t|j|}|jj|j } |jtdd| z|b|rn|j|} |D]-} |j|jt| | d/|j!| tdtdddf|d d d j#|S) Nz+Marking packages as installed by the group:r@z)Marking packages as removed by the group:r>GroupPackagesrrr) new_groupsrrr"added_packages _group_by_idrXr r-removed_groupsremoved_packagesr`rLrWr@r#rFr) r9compsrxroutrQgrp_idpkgs group_objectgrp_namerArBs r,list_group_transactionzOutput.list_group_transactionso ?? JJqFG HooF++F34D --f5L/;|++H KK*1cHndC D &    JJqDE F))F--f56D}}((088H KK*1cHndC D* ''-H 4??3sH+=sCD||Hqz1Z="b.QRC!Hyy~r.c tjtjztjztjztj ztj z}t}t}|g}tjj|}g}iiid}d} gffd } tjjr tdn td} tdd|jftdd |j ftdd |j"f| |j$ftd |j&ftd |j(ftd |j*ftd|j,ftd|j.ftdd|j0ff D]%\} } g}i}|D]r}|j2t4j6j8k7r+|j:j=D]+}|j?|tjA|-ttC| dD]}|j2tj6jDt4j6jFgzvrFtC|jI|j:g}| ||| |jJ|} |jM| |f(tCtOjjPjSjU}|rWtd} g}|D]2\}}tW|D]}|jM|d|ddddddf!4|jM| |ftCtOjjPjYjU}|rWtd} g}|D]2\}}tW|D]}|jM|d|ddddddf!4|jM| |ftCtOjjPj[jU}|rBtd} g}|D]\}}|jM|d|ddddf|jM| |ftCtOjjPj]jU}|rMtd} g}|D](\}}|jM|d|dd|dddddf*|jM| |ftCtWjjPj_}|r?td} g}|D]}|jM|ddddddf|jM| |ftCtWjjPja}|r?td} g}|D]}|jM|ddddddf|jM| |fjjbrd}jjbjdjf}|rLtd} g}|jiD]}|jM|||jM| |fjjbjdjj} | rLtd} g}| jiD]}|jM|||jM| |fjjbjdjl}!|!rLtd } g}|!jiD]}|jM|||jM| |fjjbjnjf}"|"rLtd!} g}|"jiD]}|jM|||jM| |fjjbjnjj}#|#rLtd"} g}|#jiD]}|jM|||jM| |fjjbjnjl}$|$rLtd#} g}|$jiD]}|jM|||jM| |fjpjrrjpjtsyjjvjx|zrUg}jj{d$|%\}}tOd&|D}tC|D]}%| ||| |%g} d'g}&jj|s|&jMd(td)d*j|&z}'|Dcgc] }|dd+d,z }}|jM|'|fg}tC|jUD]\}(}%| ||| |%g} td-}'jjpjr|'dz}'n|'td.z}'|Dcgc] }|dd+d,z }}|jM|'|fjj})|d/s{jjPjsWjjbr@jjbjns!jjbjdsy|d/i|d0|d1ig}d| ddd2g}*j|d3|*d4|5}*|*\}+} },}-}.t|*d2z}/|)|/k\r|)n|/})t|+td6d7td8d7}0t| td6d9td8d:}1t|,td6d;td8d;}2t|-td6d<td8d=}3t|.td6d>td8d>}4d?|)zd@j|0|+ f|1| f|2|, f|3|- f|4|.ffd*d@d?|)zd@g}5|D]\} }|rdA| z}6|D]\}7}8}9}:};}<}=|7|+ |=f|8| f|9|, f|:|- f|;|.ff}*j|*d*d@}>jjpj\}?}@tC|<D]@}AdBtdCzdDz}B|B|?|Aj@|Aj|Ajfz}B|>|Bz }>B6|>z}6|s|5jM6|5jMtdEd?|)zztdFt|jt|j$zt|j(zt|j&zdftdGt|j dftdHt|j*t|j,zt|j.zdftdIt|j0dftdJt|t|zdff}Cd}Dd}Ed}Fd}G|CD]\} }H}I|HsIs td7dKH}Jt| }Ktt|H}Lt|J}MIrttI}Nnd}NtKD}DtLE}EtMF}FtNG}GCD]\} }H}Itd7dK|H}J|Ir`tdLdMI}Ot| D}PHr#dN}>|5jM|>PEHdOFJfzGIOfzTdP}>|5jM|>PEFzd*zGIOfzvHsydQ}>|5jM|>t| DEHJfzdj|5Scc}wcc}w)Rz]Return a string representation of the transaction in an easy-to-read format. N)r%vrrc F|j\}}}}} |j} |j} t|j} |d}|j rj j} n9|jrj j} nj j} |j||| | | || fdt|fdt| fdt| ffD]*\}}||j|d|||xxdz cc<,t|t|}|S)Nnoarchr%rrrr)pkgtuprrrrrr3r _from_cmdlinerrrr setdefaultmax)linesra_widr~ obsoletesr%aerrrrrhirr9s r, _add_linez*Output.list_transaction.._add_lines iiOQ1a&&C]]F *DyYY55!!YY11YY22 LL!QVT9bA B Q=3C/CV;MNAQ""1a(Q a Os1v&ELr.z Installing group/module packageszInstalling group packagesr Installing Upgrading ReinstallingzInstalling dependencieszInstalling weak dependenciesRemovingzRemoving dependent packageszRemoving unused dependencies Downgradingc|jSrj)r)xs r,z)Output.list_transaction..4sQUUr.)rzInstalling module profiles/rzDisabling module profileszEnabling module streamszSwitching module streamsz -> rzDisabling moduleszResetting modulescjtjj|jddddddfS)Nr)rrrOgetName)r`s r, format_linez,Output.list_transaction..format_lineqs/44U]]_Er2rSUWY[]^^r.zInstalling Environment GroupszUpgrading Environment GroupszRemoving Environment GroupszInstalling GroupszUpgrading GroupszRemoving GroupsT)report_problems transactionc36K|]}t||fywrj)rrPs r,rRz*Output.list_transaction..s!L^c3s8S/^sz--bestz--allowerasingzSSkipping packages with conflicts: (add '%s' to command line to force their upgrade)r>r}rz,Skipping packages with broken dependencies%sz or part of a groupr%rrrHr~)rIr?rrrPackagerrrrrrrr=rz%s:  replacingz %s%s%s.%s %s z Transaction Summary %s InstallUpgradeRemove DowngradeSkiprzDependent packagezDependent packagesz%s %*d %s (+%*d %s) z%-*sz%s %s ( %*d %s) z %s %*d %s )SrUPGRADE UPGRADE_ALL DISTUPGRADEDISTUPGRADE_ALL DOWNGRADEINSTALLrrr _make_listsr4 WITH_MODULESrr r6upgraded reinstalledinstalled_group installed_depinstalled_weakerased erased_dep erased_clean downgradedactionlibdnfrTransactionItemAction_OBSOLETEDr getReplacedByrrrFORWARD_ACTIONSTransactionItemAction_REMOVErLrrrJ_moduleContainergetInstalledProfilesrr"getRemovedProfilesgetEnabledStreamsgetSwitchedStreamsgetDisabledModulesgetResetModules_historyenv _installedr _upgraded_removedr`r3beststrict_goalactions_skipped_packages_allow_erasingrupgrade_group_objects_upgrader6r? isChangedrMrrr@rhrrrrrr rrrr )Qr9rrforward_actionsskipped_conflictsskipped_broken list_bunch pkglist_linesrrr ins_group_msgrpkglistrreplacestsirR obsoletedinstalledProfilesrprofilesprofileremovedProfilesenabledStreamsstreamswitchedStreamsdisabledModules resetModulesrinstall_env_groupr`upgrade_env_groupremove_env_group install_group upgrade_group remove_grouprrecommendationsskip_strr output_widthr?n_widv_widr_wids_wid real_width msg_packagemsg_arch msg_versionmsg_repositorymsg_sizertotalmsgr%rrrrrrrrerfobspoappended summary_datamax_msg_action max_msg_count max_msg_pkgsmax_msg_depcountrdepcountmsg_pkgslen_msg_action len_msg_count len_msg_pkgslen_msg_depcount msg_deppkgs action_msgsQ` r,list_transactionzOutput.list_transactions`!..6+=+==@R@RR  " "#%+%5%568>GE  KXX))+6  "-8: 0BEAVAV<=./  I|,j.B.BCI{+Z-@-@AI~. 0F0FG : :;,-z/G/GH12J4M4MN: 1 1201:3H3HI12J4K4KLI}-z/D/DE"G VW EH"::!3!3!S!SS002A''35155c:3# g?;::S__%D%DHZHZHwHwGx%xx#8<< 2#>? !%ucggyI<  &% 1I"GL#4 (B(B(W(W(Y#Z#`#`#bc 34FE"3h#H~GLLT7";RRRQS!TU .#4  &% 1 dii&@&@&S&S&U!V!\!\!^_ 23FE"1h#H~GLLT7";RRRQS!TU .#2  &% 1TYY%?%?%Q%Q%S T Z Z \] 01FE . f dBBB?@!/  &% 1 dii&@&@&S&S&U!V!\!\!^_ 12FE / f dBfQi(KRQSUWY[\]!0  &% 1 dii&@&@&S&S&U!VW *+FE' dBBB;<(  &% 1d499#=#=#M#M#OPQ *+FE$ dBBB;<%  &% 1 99   _!% 2 2 6 6 A A  :;.557ELLU!348$$fe_5 $ 2 2 6 6 @ @  9:.557ELLU!348$$fe_5#yy1155>> 89-446ELLU!347$$fe_5 II..44??M./*113ELLU!344$$fe_5 II..44>>M-.*113ELLU!344$$fe_599--33<1'jO99++&&'783469hh6OPH/44eQsVf_eE4  (E!2 3E$^%9%9%;< s!%uc2>=GHHyy~~;;#b=#a(=&>>/44eQsVf_eE4  (E!2 3yy(( Cy!;!;!E!E!G##););)A)ATYYEWEWE[E[Ir49d3i=B 8$ - 1 l  y\3z334 ++ ,- ** +,)) *+-. /y\3z223Q 7 x[#j//03z7L7L3MM (( )*+, . {^S!6!67 ; vY-.^1DDa H J   '3 #FE8)Z7H(0N'7M&x0L#.wx/@#A #$  @N }=M|\:L"#35EF #(4&(4 #FE8)Z7H !46J!)+ -fnE 2CJJsj&3U&, h/G&G&6+&O OP 0CJJsj'4|'Cs&J&6+&O OP$ 3"26>"J"/"BBC'(4*wws|o55s : c fd}|syg}g}|jdj||D]}|jt|dD]}|||}|snsjjdz g}|rX|dt |} |jdjj t| ||t |d}|rX|S)Nct||krgSjj|dz dzz }|dkrgSdg|z}d}|D]S}t|||kDr-t|||z }||krgcS||z}t|||<|dz }|t|z}Utt|D]}||xx||zz cc<||xxdzcc<!|S)zb Work out how many columns we can use to display stuff, in the post trans output. rr~rr})rr6r?r)msgsnumr'col_lensrrrr9s r, _fits_in_colsz+Output._pto_callback.._fits_in_colsJs4y3 99$$qA 6Dqy sSyHCs8hsm+Hx}4Dt|! DLD$'HHSMqs8}$S]+ ,  # ,Or.rz{}:)rrr\r~r~z {})rformatrr6r?rr@r#) r9rtsisr<rr9rr:rV current_msgss ` r, _pto_callbackzOutput._pto_callbackGs 6 5<<'(C KKC !(C s+D)ii''!+,-D T+L JJv}}T__St5L%MN OD #D r.cltjj|j||jS)z{ Return a human-readable summary of the transaction. Packages in sections are arranged to columns. )rr_post_transaction_outputr4rC)r9rs r,post_transaction_outputzOutput.post_transaction_outputys' xx00KI[I[\\r.c:d}|jjdk\rutjjj t j}tjjj t j|_|tfS)z_Set up the progress callbacks and various output bars based on debug level. Nr~)fo) r3 debuglevelrr5r8MultiFileProgressMetersysstdoutDepSolveProgressCallBack)r9 progressbars r,setup_progress_callbackszOutput.setup_progress_callbackssp 99  1 $''**AASZZAPKGG,,CCszzCRDM5788r.cz|dkry|jj}tjd|zt dt j |z }dt ||zddt |ddt|d d }ttd |t|z |z}tj|y) a!Outputs summary information about the download process. :param remote_size: the total amount of information that was downloaded, in bytes :param download_start_timestamp: the time when the download process started, in seconds since the epoch rN-g{Gz?r>z>5zB/s | zB z>9rTotal) r6r?rrrtimerrr rr)r9 remote_sizedownload_start_timestamprdl_timers r,download_callback_total_cbz!Output.download_callback_total_cbs !   !! C%K dDIIK*BBC +0 1 + &  "qz53s8+;Systemr>c0|j|}|sy|dS)zf Split gives us a [0] for everything _but_ '', this function returns '' in that case. rr)r`)textargsrts r, _safe_split_0z.Output._pwd_ui_username.._safe_split_0s#$**d#Cq6Mr.;r~z ) r]r"rrrr pwdgetpwuidrpw_gecospw_namerH) r9rlimituloginidrrfuserfullname user_names r,rzOutput._pwd_ui_usernames c4 =@ASD))!U3SA A ;#!99 lGX;$w.D SY%6t9   <<C)D$S%7a@HDLL)I ()4D SY%6(5h(?Kt9u$!I-DK9B: s8O sC?4B DDDc $|jj|}|jjdk(rddg}n~|jjdk(rdg}na|jjdk(sJt }d}d}|D]3}|dz }|j |dz }|j |j5d}t|dk(r]td } |jj} | )tjjjd} | d } | d kDr| d z nd } n td } d } t|t!tdddt!| | | t!tdddt!tdddt!tdddfzd| zdzdzdzdzdzdz} td| zd}|dur t#|}|D]5}t|dk(r|j xsd} n|j%|jd } t'| } t)j*tdt)j,|j.} |j1|j3\}}t!| | | } t!|dd}dx}}|j4dx}}n!|j4rdx}}n|j6rd x}}|j8rd!}|j:rd"}t||j<| | ||fz||8y)#zOutput a list of information about the history of yum transactions. :param tids: transaction Ids; lists all transactions if empty usersrr~commandszsingle-user-commandsrNz%s | %s | %s | %s | %sz Command lineO7z User nameIDr?z Date and timez Action(s)Alteredr> r\rQz%6u | %s | %-16.16s | %s | %4uTrz%Y-%m-%d %H:%Mr>*#Err)rxoldr3history_list_viewrcmdlinerloginuidrrr6rrr5_real_term_widthrr reversedrr rSstrftime localtime beg_timestampr`r return_code is_outputaltered_lt_rpmdbaltered_gt_rpmdbtid)r9tidsreverse transactionsuidsdoneblanksrfmtr real_cols name_width table_widthtmr:uiactsrmarklmarks r,historyListCmdzOutput.historyListCmds ||''- 99 & &' 1q6D YY ( (J 63D99..2HH HH5DDF+  &&.aKF--. , ' t9>^$D ..I  GGLL99!<   +4r>RrJ[>DJ c%agq!4%dJ C%a&8"bA%a nb"=%a lAq9 ;; <j(1,r1A5:Q>B  cK . d?#L1L'K4yA~"**0b,,[-A-A2Ft9D q!12#~~k.G.GHJB11+2B2B2DEKC#D*jAD%fb"5F EE&&. ##(( ##&& ##++++ #$FC@@ESXBY Z9(r.c<t|}|jj}|Ftj t dt jjt d|j}|j}g}|sK|jjd}|H|j|j|j|n|jj|}|sFtj t dt jjt dd\}} d} d} |rt|}|j\}} |D]} |M| j|k(r>|j j"j%} | j't)| d}d}| j|k\r1| j| kr"| t+| } n| j-| d}n[| Y| r t/d d} |j1| d} |r5|j\}} | j|k\r| j| kr| } d}|r| r t/d d} |j1| || | r t/d |j1| yy) zOutput information about a transaction in history :param tids: transaction Ids; prints info for the last transaction if empty :raises dnf.exceptions.Error in case no transactions were found NzNo transactionszFailed history infoF)complete_transactions_onlyz$No transaction ID, or package, given)r}r}TzO-------------------------------------------------------------------------------)rrxlastrcriticalrr exceptionsErrorrend_rpmdb_versionrrrrrr4_tsdbCookiecompare_rpmdbvrrmerger_historyInfoCmd)r9rpatsmtidsrlasttidlastdbvrbmtidemtidmobjrtransrpmdbvmergeds r,historyInfoCmdzOutput.historyInfoCmd'sD 4y||  " < OOA/0 1..&&q)>'?@ @(((( <<$$$FD"##D)<<++D1L OOADE F..&&q)>'?@ @ u 5ME 99;LE5!E"uyyG';//1$$S[1GFyyE!eii5&8<3E:DJJu%!(O$$T*#(99;LE5yyE)eii5.@$!%(O$$UD1E"H  h   & r.c  j}t|tr|g}|Dcgc]}j|}}t dt dt dt ddt dt dt dt ddt t jt jzDcgc] }t|c}}|d <|d < d3fd }j} t| d kDr!tt dd| d | dfzntt d| d tj} tjdtj| } tt d| j Lj"r!tt dj dntt dj j$j$} tjdtj| } | | z }|dkrt d|z}n?|dkrt d|dzz}n(|dkrt d|dzz}nt d|dzz}tt d| |j&Lj(r!tt d j&dntt d j&t|t t*fr=t-}|D]-}||vr|j/|tt d!|/ntt d!|tj0t t*frj0}|d &tt d"dt d#d|d d}nt3|stt d"t d$n|rtt d"t d%d&j5|Dcgc] }t7|c}nj0!tt d"dt d#dnTj0r*tt d"t d'j0ntt d"t d$tj8t t*frGt-}j8D]}||vr|j/|tt d(ntt d(j8j:ftj:t t*fr'j:D]}tt d)|ntt d)j:fd*}tj<t t*frj<D] }|| n|j<j>ftj>t t*fr'j>D]}tt d+|ntt d+j>jA}|rtt d,d }|D]}tt7|}||kDs|} |D]}||d-d |.tt d/jC|jE}|r1tt d0d }|D]}|d z }td1|z|jG}|r2tt d2d }|D]}|d z }td1|z|yycc}wcc}wcc}w)4N InstalledErasedUpgraded Downgraded)rRror%z Not installedOlderNewermaxlenrTc >d|z}|r}n}|d}jjjj|jj } | s|d}nGj j| d} | r'|j| } | dk(rn| dkDr|d}n|d}|rjd\} } njd \} } t||d }d }|r|j}td || || |t||fzy) Nr>rR)rrrrr%rYrZrr%s%s%s%s %-*s %s)r{r5r6filtermrrunrxpackagecomparerhr rrr)r prefix_len was_installedrd pkg_max_len show_repor _pkg_statesstateipkgsinst_pkgresrerfui_repo_pkg_states_available_pkg_states_installedr9s r, _simple_pkgz+Output._historyInfoCmd.._simple_pkgs2:%F3 3 $EIIOO%//199sxx9HLLNE#C( <<//a9++h/C axq +C 0 +C 0!%!8!%!:$UK,ABEG**, $ue(3SXw(HH Ir.rzTransaction ID :z%u..%ur}z%czBegin time :zBegin rpmdb :z**i,z (%u seconds)iPFz (%u minutes)<iz (%u hours)iz (%u days)iQzEnd time :zEnd rpmdb :zUser :zReturn-Code :AbortedSuccessz Failures:rYzFailure:zReleasever :zCommand Line :cjtjjk(rd}n,jtjjk(rd}nd}t t d|y)NPersist TransientUnknownzPersistence :) persistencerrTransactionPersistence_PERSIST TransactionPersistence_TRANSIENTrr)rpersistence_strrs r,print_persistencez1Output._historyInfoCmd..print_persistencesR&"4"4"S"SS"+F$6$6$W$WW"-"+ !&' 9r.zComment :zTransaction performed with:r)rrzPackages Altered:zScriptlet output:z%4dzErrors:)FFrT)$rr]rrrrr"rrrrrrrSrrbeg_rpmdb_versionr end_timestamprrrrrrallrr releaseverrrcommentperformed_withhistoryInfoCmdPkgsAlteredoutputr) r9rrrrrrrrrbegtbegtmendtendtmrseenrRcodesrrrr perf_withmax_lenwith_pkgstr_lent_outr:linet_errrrs `` @@r,rzOutput._historyInfoCmdts\<< h $ zH6>?hs%%c*h?'(~Qx['(}AlO!M'(~Q=O'(z7!Et,A,H,H,J'K'+,A,H,H,J'K(LN(Lc!f(LNO*0h'*0h'HM15' IRxxz t9q= !&'T!Wd2h4G)G H !&'a 1S&&' dDNN4$89 a"#U+  ,##a*+S-B-BDIa*+S-B-BC    ($$DMM$t(<=E$;Df}(4/ #(DBJ7(($7*;<~,)?@ !&' 5  ,##a*+S-B-BDIa*+S-B-BC dT5M *5D9 a*+Q/  !&' . cooe} 5OOEQxa*+T1Y<Fab Za*+Qy\:a*+Q{^TYYX]G^X]STAX]G^=_` __ $ !&'q|T B __ !&': H !&'9 6 cnntUm 45D^^9 $ !&' + !&' 8 ;; "#++e}5"{{G!./9 +a*+S[[9 : cooe} 5" !+. / coo . ;; "#++e}5"{{G!./9 +a*+S[[9&&(  !12 3!H#h-(G !""H !4W M" a#$% &&sD1   !'( )Cqeck4(   !I, Cqeck4( Q@ NzH_s^^^ r Dep-Install Obsoleted ObsoletingErase Reinstallrrrr) z True-InstallrrrrrrrrUpdateUpdatedc |j}d}d}|j}|D]]}|j|j|j}|t |kr t |}t t |} || ks\| }_|D]}d} |j tjjk7rd} d} |r*t|D cgc]} |j| c} rd} |j| \} }|j|j|j}tt||}td| | |||t ||j!fzycc} w)aPrint information about how packages are altered in a transaction. :param old: the :class:`DnfSwdbTrans` to print information about :param pats: a list of patterns. Packages that match a patten in *pats* will be highlighted in the output rrz ** rZrYrN)_history_state2uistaterUrLr\rrrrrTransactionItemState_DONErrxrhr r rr)r9rr all_uistatesrrrUruistatepkg_lenrrdpatrerfs r,rz Output.historyInfoCmdPkgsAltered4sD22  <<>C"&&sHGG $W#c(mGW$% CFyyF..HHH I$7$3 #$78 &I!__Y7NUE"&&sHG&s7|V Package %s.%s %s will be installedrmz(---> Package %s.%s %s will be an upgraderz$---> Package %s.%s %s will be erasedrz)---> Package %s.%s %s will be reinstalledrz)---> Package %s.%s %s will be a downgraderz(---> Package %s.%s %s will be obsoletingudz&---> Package %s.%s %s will be upgradedodz'---> Package %s.%s %s will be obsoleted)rrdebugrrr)r9rmoders r, pkg_addedz"DepSolveProgressCallBack.pkg_addedbs( 3;@AF S[ABF S[=>F S[BCF S[BCF S[ABF T\?@F T\@AF  LL388SWW = r.c@tjtdy)zRPerform setup at the beginning of the dependency solving process. z"--> Starting dependency resolutionNrr rrys r,startzDepSolveProgressCallBack.starts  Q;<=r.c@tjtdy)zAOutput a message stating that dependency resolution has finished.z"--> Finished dependency resolutionNrrys r,rzDepSolveProgressCallBack.ends Q;<=r.N)rrrrr rrrqr.r,rMrM_sQ'>R> >r.rMceZdZdZdZy) CliKeyImportc ||_||_yrj)r4r)r9r4rs r,r:zCliKeyImport.__init__s  r.cvd}td|||tjj||j ddfz}t j d||jjjry|jjjry|jjS)Nchtjjrdnd}|ddjd|S)N00ir=)rpycompPY3rjust)rYrjs r,short_idz'CliKeyImport._confirm..short_ids* DBbc7==B' 'r.zLImporting GPG key 0x%s: Userid : "%s" Fingerprint: %s From : %szfile://rr<TF) rrcrypto_printable_fingerprintr_rrr4r3 assumeyesassumenorr2)r9rYuserid fingerprintr timestamprrs r,_confirmzCliKeyImport._confirms ($% f 11+> Ir*, , c" 99>> # # 99>> " "{{&&((r.N)rrrr:r%rqr.r,rrs )r.rcReZdZdZedZfdZdZdZdZ ddZ xZ S) CliTransactionDisplayz1A YUM specific callback class for RPM operations.cRtjjjSrj)rr5r6 _term_widthrys r,rzCliTransactionDisplay.s#'',,":":""D8*.D &)) r.c |jrtjjs||k(r|j |||tjj||\} }} t |}| t |||t || | fz} | |jk7rHtjjd| tj| |_||k(r tdyyyyy)N)r8r=r< write_flushr>) rrKrLisatty_makefmtr r r-rr_terminal_messengerr) r9r7r8r9r:r>processr=r<rwid2rs r,r6z#CliTransactionDisplay._out_progresss ;;CJJ--/7h3F $ gw7:zz7H7H7J6=D!.!J S$'lG)'4>)'4>@@Cdll",,]CL" h&#J'#4G;r.chtt|}|d|}d|zdz|zdz} | ||fz} |d} n t|} d|zdz} | d|zdzz } | dz } | dz } | dz } |j} | | kr| } | | z} | | dzkDr| dz} |j| | zz }|d|} d| zd z}| |zdz}|r |d k(rd | z}|}no|r8|d kDr#||jt ||d z zzfz}nd}d|zdz| z}| }n5|d k(rd| z}|}n(|d kDr||j|zfz}nd}d|zdz| z}| }|||fS)Nr%zs/%sr+r~rz[%-zs]r3z %s: %s rgY@rz %s: %s r>z %s: %s z %s: %s )rrrrr/r)r9r>r9r:r8r=r<lrfmt_donerpnloverheadrr0fmt_barfull_pnlrrIbars r,rFzCliTransactionDisplay._makefmts H Q:%,s27H-- ?Cg&CEQ;AHaKA A A   8 E  ! 1*C hn- %(%-$&;? 3!D(CD qyS'E/1J-K!K NN#%+d2CD ^$&CDqyU!2 55#c)D0CDD$r.)TN) rrrrrrr:r8r5r6rF __classcell__)r1s@r,r'r's4; < =E?@  =A$&4r.r'cxd}tjjsy|dk(rd}n|dk7rt||z }nd}tj j j}|||k(rd}d||fz}|t|dzz}|dkrd}|&|dz}|dkrd}|t||zz}d|||fz}nl||k(rd t||||}nT|d z}|dkrd}|dz} | t|kDr t|} || z}|t||zz}d t|| | |||fz}||kr/tjjd |tj||k(r/tjjd d tjtjjdtjy)aIOutput 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 r~NrrQz %d/%drr~z [%-*s]%s rz %s: [%-*s]%swriterflush)r)rKrLrErrr5r6r)rrr rrrG) rrtotalrr/r>rrhashbarrnwids r,rNrN0s D ::   !| A:Gnu,GG GGLL $ $ &E |5( gu% %C SX\E qy |   19EUW_-- 55 E -dE5A3G   19Ez +d# #t$D  UW_--!%5dD$%G%,c%33% $$WfcjjA% $$WdCJJ?HH  cjj 9r.rj)rss$)&%'  5dddEE/3   5 ! 6Z=VZ=x84>s||444>n)3<<)))6}.}~::r.