/usr/lib/python3.9/site-packages/dnf/cli/__pycache__
NameSizeModeActions
aliases.cpython-39.opt-1.pyc54920644editdlrm
aliases.cpython-39.pyc54920644editdlrm
cli.cpython-39.opt-1.pyc331390644editdlrm
cli.cpython-39.pyc332010644editdlrm
completion_helper.cpython-39.opt-1.pyc84320644editdlrm
completion_helper.cpython-39.pyc84320644editdlrm
demand.cpython-39.opt-1.pyc15970644editdlrm
demand.cpython-39.pyc15970644editdlrm
format.cpython-39.opt-1.pyc23610644editdlrm
format.cpython-39.pyc23610644editdlrm
main.cpython-39.opt-1.pyc54430644editdlrm
main.cpython-39.pyc54430644editdlrm
option_parser.cpython-39.opt-1.pyc175290644editdlrm
option_parser.cpython-39.pyc175290644editdlrm
output.cpython-39.opt-1.pyc572830644editdlrm
output.cpython-39.pyc573530644editdlrm
progress.cpython-39.opt-1.pyc46690644editdlrm
progress.cpython-39.pyc46690644editdlrm
term.cpython-39.opt-1.pyc118010644editdlrm
term.cpython-39.pyc118220644editdlrm
utils.cpython-39.opt-1.pyc32500644editdlrm
utils.cpython-39.pyc32500644editdlrm
__init__.cpython-39.opt-1.pyc5270644editdlrm
__init__.cpython-39.pyc5270644editdlrm
Edit: /usr/lib/python3.9/site-packages/dnf/cli/__pycache__/output.cpython-39.pyc (57353B)
a jñ\ã@sœ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  0d ¡Z1d d „Z2Gdd„de3ƒZ4Gdd„de'j5j6ƒZ7Gdd„de'j5j8ƒZ9Gdd„de#ƒZ:ddd„Z;dS)z"Handle actual output from the cli.é)Úabsolute_import)Úprint_function)Úunicode_literalsN)Ú format_numberÚ format_time)Ú_ÚC_ÚP_ÚucdÚfill_exact_widthÚ textwrap_fillÚ exact_widthÚselect_short_long)ÚxrangeÚ basestringÚlongÚunicodeÚ sys_maxsize)ÚTransactionDisplay)ÚMergedTransactionWrapperÚdnfcCstt |ft d¡¡}t|ƒ}|d}| |}|s@t d|¡}n|rR| d|¡t|ƒ}tt|g|g|¢RŽƒS)NÚé©r)Ú itertoolsÚchainÚrepeatÚlenÚextendÚiterÚlistÚzip)Z cols_countZlabelÚlstÚleftZ lst_lengthZ right_countZ missing_itemsZlst_iter©r$ú2/usr/lib/python3.9/site-packages/dnf/cli/output.pyÚ_spread_in_columns6s r&c @s eZdZdZdZe d¡Zdd„Zdd„Z dd „Z d d „Z d d „Z e dd„ƒZedd„ƒZedd„ƒZdldd„Ze dd„ƒZdd„Zdmdd„Zdnd d!„Zdod"d#„Zd$d%„Zd&d'„Zd(d)„Zdpd+d,„Zdqd-d.„Zdrd/d0„Zidifd1d2„Zdsd3d4„Zd5d6„Z d7d8„Z!d9d:„Z"d;d<„Z#d=d>„Z$d?d@„Z%dtdAdB„Z&dudCdD„Z'dvdEdF„Z(dGdH„Z)dIdJ„Z*dwdKdL„Z+dMdN„Z,dOdP„Z-dQdR„Z.dSdT„Z/dUdV„Z0dxdWdX„Z1dydYdZ„Z2ge3ƒfd[d\„Z4gfd]d^„Z5e6d_ƒe6d_ƒe6d`ƒe6daƒe6dbƒe6dcƒe6ddƒe6deƒe6dfƒe6dgƒe6dhƒdiœ Z7gfdjdk„Z8dS)zÚOutputz+Main output class for the yum command line.z z ^\*{0,2}/cCs$||_||_tjj ¡|_d|_dS©N)ÚconfÚbaserÚcliÚtermZTermÚprogress)Úselfr*r)r$r$r%Ú__init__IszOutput.__init__cCs0|jj}dd|}| t||ƒd¡}|||fS)Nú%sú=ú )r,ÚcolumnsÚ fmtColumnsr!)r.Úcol_dataÚrowZ term_widthZruleÚheaderr$r$r%Ú_bannerOs zOutput._bannerc Csrdd„|dDƒ}|D]:}t|ƒD],\}}||}t|ƒ}| |d¡d||<q"q|j|ddd�}tttj|ƒƒS)NcSsg|] }tƒ‘qSr$)Údict)Ú.0rr$r$r%Ú Vóz&Output._col_widths..rrú )Úindent)Ú enumeraterÚgetÚ calcColumnsr ÚmapÚoperatorÚneg) r.Úrowsr5r6ÚiÚvalZcol_dctÚlengthÚcolsr$r$r%Ú _col_widthsUszOutput._col_widthscCs d}d}|snøt|tƒr |dkr.|jjd}nØ|dkr8nÎ| dd¡ ¡D]¼}|dkrZd}qH||jjvrx||jj|7}qH||jjvr–||jj|7}qH| d¡rÎ|dd…|jjvrÎ||jj|dd…7}qH| d¡rH|dd…|jjvrH||jj|dd…7}qH|�r|jjd}||fS) NrÚboldÚnormalú,r2zfg:ézbg:) Ú isinstancerr,ZMODEÚreplaceÚsplitZFG_COLORÚ startswithZBG_COLOR)r.Ú highlightÚhibegÚhiendZhighr$r$r%Ú _highlight`s4   ÿ ÿ zOutput._highlightcKs(| |¡\}}|jj||||fi|¤ŽSr()rVr,Úsub)r.ZhaystackrSZneedlesÚkwdsrTrUr$r$r%Ú_sub_highlight}szOutput._sub_highlightcCs2d}|D]$}||d|kr q.||d7}q|S)z; Spaces left on the current field will help how many pkgs? rrr$)ÚcurrentZ data_tupsr#ÚretÚtupr$r$r%Ú_calc_columns_spaces_helps�s z!Output._calc_columns_spaces_helpscCs|jjSr()r*Úhistory©r.r$r$r%r^‹szOutput.historycCs|jjSr()r*Úsackr_r$r$r%r`�sz Output.sackNrrcCs¶t|ƒ}|}dg|}td|ƒD]}t|| ¡ƒ||<q |durJ|jj}|durjdg|d}| d¡|säg} td|ƒD]6}||} | r |  | dd¡q||  ||d¡q|| dt|ƒ7<|jj} t | ƒ| krà| S| }|t |ƒ|dt |ƒ8}|d�s|d7}|dk�r²d} d} td|ƒD]b}|  |||||¡}|�sR�q.| �rx||dk�rx|d| k�rx�q.|| k�r†�q.|} |} �q.| �rî||   d¡d|| }|| �sÒ| |dk�rÒ|d8}|| |7<||8}�qd}td|ƒD]}||�s�qü|d7}�qü|�r`||}td|ƒD],}||�sD�q2|||7<||8}�q2|d8}||}td|ƒD]}|||7<�qz|||||7<d}�q|S)aôDynamically 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éÿÿÿÿé) rÚrangeÚsortedÚitemsr,Ú real_columnsÚappendrr3Úsumr r]Úpop)r.Údatar3Úremainder_columnÚ total_widthr>rIZpdataÚdZ full_columnsÚcolZ default_widthZhelpsrGZthelpsÚdiffZoverflowed_columnsZnormr$r$r%rA“s„      ÿ"     zOutput.calcColumnscCs|dkrd| fSd|fS)z$Returns tuple of (align_left, width)rTFr$)Úwidthr$r$r%Ú_fmt_column_align_widths zOutput._fmt_column_align_widthcCslt|ƒdkst|ƒdksJ‚t|ƒdkr8|\}}d}}t|ƒdkr\|\}}}| |¡\}}t|ƒ|||fS)NrbrNr)rrVr )r.r5rGrprTrUrSr$r$r%Ú _col_datas   zOutput._col_datac CsBt|ƒ}t|ƒ}g}|dd…D]È}| |¡\}}} } |sN|d7}| |¡q | |¡\} }t|ƒ} | |kr°|d7}| r”| | |d|| | g¡qØ| | d|| || g¡n(|dd||d7}| | || g¡||7}|d7}q | |d¡\}}} } | |¡\} }t||| | | d�}|d |7}| |¡|t|ƒS) 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 Nrar0z %s%s%s%s r2z%s%s%s r)r#ÚprefixÚsuffixz%%s%s) r rrrrgrqr rr Útuple) r.r3ÚmsgÚendrlrjr5rGrprTrUZ align_leftZ val_widthr$r$r%r4%s8   ÿ  zOutput.fmtColumnsFcCsP|dur d}d||j|jf}|ddg}t||j|jf||ƒ}t| |¡ƒdS)aÔPrint 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)iØÿÿÿiêÿÿÿéðÿÿÿz%s%s.%srL)ÚnameÚarchr!ÚevrÚ _from_repoÚprintr4)r.ÚpkgÚ ui_overflowr>rSr3ZnaÚhi_colsr$r$r%Ú simpleListTs  zOutput.simpleListc CsN|dur d}d|t|ƒf}|ddg}|j}t||f||ƒ}t| |¡ƒdS)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)iÁÿÿÿrxú%s%srL)r Ú ui_from_repor!r}r4) r.r~rr>rSr3Zenvrar€Zridr$r$r%ÚsimpleEnvraListjs zOutput.simpleEnvraListcCstt|jƒƒdS)z.Print a package as a line containing its name.N)r}r ry©r.r~r$r$r%Úsimple_name_list�szOutput.simple_name_listcCstt|ƒƒdS)z/Print a package as a line containing its NEVRA.N)r}r r…r$r$r%Úsimple_nevra_list…szOutput.simple_nevra_listcCs„t|ƒ}|jj}|st}n |dkr&d}d|dd}|s>|St|ƒ}t||||d�}| d¡dkr€||dkr€t|||d d�}|S) zùReturn 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 ér2rbz: )rpÚinitial_indentÚsubsequent_indentÚ rrNz ...: )r r,rfrr r Úcount)r.ÚkeyrGZkeylenrIZnxtr[r$r$r%Ú fmtKeyValFill‰s$ÿÿzOutput.fmtKeyValFillr1cCsht|ƒ}|jjd}t|ƒ}||dkr6|d}}n$|||d}|||t|ƒ}d|||fS)a¶Format 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 rbéz%s %s %s)r r,r3r r)r.ryÚfillrIZname_lenZbegrwr$r$r%Ú fmtSection¤s   zOutput.fmtSectionc sÒdd„}‡fdd„}g}ˆ |¡\}}tdtddƒtddƒƒ}| ||d ||j|fƒ¡|jrv| |td ƒ|jƒ¡tdtdd ƒtdd ƒƒ}| |||jƒ¡| |td ƒ|jƒ¡tdtdd ƒtddƒƒ}| |||j ƒ¡tdtddƒtddƒƒ}| ||t t |j ƒƒƒ¡| |tdƒ|j ƒ¡tdtddƒtddƒƒ}| |||jƒ¡|j�r€ˆj |¡} | �r€| |tdƒ| ƒ¡ˆjj�r<| |tdƒ|jƒ¡| |tdƒtj |j¡ƒ¡|j�rä| |tdƒtj |j¡ƒ¡ˆj |¡} | �r.format_key_valcsˆ t|ddƒd|pd¡S)Nr’z : r)rŽr r–r_r$r%Úformat_key_val_fillÃsz.Output.infoOutput..format_key_val_fillr’ÚshortÚNamerz%s%s%sZEpochÚVersionZReleaseÚArchÚ ArchitectureÚSizeZSourceÚRepoÚ Repositoryz From repoZPackagerZ Buildtimez Install timeNz Installed byZSummaryZURLZLicenseZ Descriptionr‹)&rVrrrgryZepochrÚversionÚreleaserzrÚfloatÚ_sizeZ sourcerpmÚrepoidÚ _from_systemr^Zrepor)ÚverboseZpackagerrÚutilZnormalize_timeZ buildtimeZ installtimeZ package_dataÚintÚ_itemZgetInstalledByÚ ValueErrorÚ_pwd_ui_usernameÚsummaryÚurlr ÚlicenseÚ descriptionr”) r.r~rSr—r˜Z output_listrTrUr�Z history_repoZ history_pkgÚuidr$r_r%Ú infoOutput¹s|  ÿÿ ÿ ÿ ÿ ÿ    ÿ  ÿ   ÿ ÿzOutput.infoOutputc CsŒ|\}}|durV|jj}|jtjkr,|jj}|j|||d�|j||d|jjd�dS| ¡}d|j |j f}|j } t d|| ||fƒdS)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)r3rSú )r3r>rSú%s.%sz%-35.35s [%.12s] %.10s %-20.20s) r)Úcolor_update_remoteÚreponameÚhawkeyZSYSTEM_REPO_NAMEÚcolor_update_localr�Úcolor_update_installedZ compactPrintryrzr¥r}) r.ZuotupZ changetyper3Z changePkgZinstPkgZchiZ c_compactZ i_compactZc_repor$r$r%ÚupdatesObsoletesLists   ÿ ÿzOutput.updatesObsoletesListc Csd|dv�r`t|ƒdk�rXtd|ƒtƒ}|dkr^i}|D]} | |t| ƒt| jƒ<q:| ¡}t|ƒD]Ø} | j| jf} d} | |vr�|  dd¡} nD|   || ¡r¬|  dd¡} n(|   || ¡rÈ|  d d ¡} n |  d d¡} |dkrð|j | d | |d �qf|dk�r|  |j| | d�d¡qf|dk�r*| | ¡qf|dkrf| | ¡qfqf|�rXtd t|ƒ¡ƒt|ƒSdS)aŠPrints 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 ÚinforyÚnevrarr0r Fznot inrLr1ú>rKú||vr>||d||<q>|S©Nrr) r`ÚqueryÚ installedZ _name_dictÚ availablerrr r!)r.ÚsectionsrÍrÎrmÚpkg_namer$r$r%Ú_pkgs2name_dict¯szOutput._pkgs2name_dictc CsŒi}i}tjtt|ŽƒdŽD]d}| |¡}|dur6qtt|ƒƒt|jƒ}tt|jƒƒ}| |d¡d||<| |d¡d||<q||fSrË) rrr r!r@r r ÚGRP_PACKAGE_INDENTr¶) r.rÏÚ name_dictZ nevra_lengthsZ repo_lengthsrÐr~Znevra_lZrepo_lr$r$r%Ú_pkgs2col_lengths»s zOutput._pkgs2col_lengthscCs |D]}td|j|fƒqdS)Nr‚)r}rÒ)r.Ú pkg_namesryr$r$r%Ú_display_packagesÈszOutput._display_packagesc Csl|D]b}z ||}Wn(ty<td|j|fƒYqYn0d}|jsP|jj}|j|d|j||d�qdS)Nr‚FT)rr>rSr3)ÚKeyErrorr}rÒr¦r)Zcolor_list_available_installr„)r.rÕrÓr3ryr~rSr$r$r%Ú_display_packages_verboseÌs   ýz Output._display_packages_verbosec Cshdd„}ttdƒtj |j¡ƒ|jj}|rDttdƒt|j ƒƒ|j rdttdƒt|j ƒp`dƒ|j r|ttdƒ|j ƒtdƒ||j ƒftd ƒ||j ƒftd ƒ||jƒftd ƒ||jƒff}|�r0| |¡}| ||¡}| |¡}|d  |d  f}|D].\}} t| ƒd k�rqþt|ƒ| | ||¡qþn4|D].\}} t| ƒd k�rN�q4t|ƒ| | ¡�q4dS)z�Output information about the packages in a given group :param group: a Group object to output information about cSstdd„|DƒƒS)Ncss|]}tj |j¡VqdSr(©rr¨Ú_name_unset_wrapperry©r:r~r$r$r%Ú âr<z?Output.display_pkgs_in_groups..names..©rd)Úpackagesr$r$r%Únamesász,Output.display_pkgs_in_groups..namesz Group: %sz Group-Id: %sú Description: %srz Language: %sz Mandatory Packages:z Default Packages:z Optional Packages:z Conditional Packages:rrN)r}rrr¨rÚÚui_namer)r§r ÚidÚui_descriptionZ lang_onlyZmandatory_packagesZdefault_packagesZoptional_packagesZconditional_packagesrÑrÔrArrØrÖ) r.Úgrouprßr§rÏrÓZ col_lengthsr3Ú section_namerÞr$r$r%Údisplay_pkgs_in_groupsÜs:ü     zOutput.display_pkgs_in_groupscCsºdd„}ttdƒtj |j¡ƒ|jjr@ttdƒt|j ƒƒ|j rdt|j ƒpRd}ttdƒ|ƒtdƒ||j ƒftdƒ||j ƒff}|D](\}}t |ƒd kr¢qŒt|ƒ| |¡qŒd S) z”Output information about the packages in a given environment :param environment: an Environment object to output information about cSstdd„|DƒƒS)Ncss|]}tj |j¡VqdSr(rÙ)r:rär$r$r%rÜ r<zFOutput.display_groups_in_environment..names..rÝ)Úgroupsr$r$r%rßsz3Output.display_groups_in_environment..nameszEnvironment Group: %sz Environment-Id: %srràz Mandatory Groups:z Optional Groups:rN)r}rrr¨rÚrár)r§r rârãZmandatory_groupsZoptional_groupsrrÖ)r.Z environmentrßr°rÏrårÞr$r$r%Údisplay_groups_in_environmentsþ  z$Output.display_groups_in_environmentcsHd‡‡‡fdd„ ‰‡‡‡fdd„}ˆjjr4dˆ}ndˆjˆjf}ˆ |ˆjpRd¡}ˆr|ˆd urjˆjj‰ˆj|ˆˆd d �}t|ƒ|d ur”ˆjj }|sœd Stt d ƒˆj ƒd}d} t |ƒD�]F} ˆj| krÔd } q¾ˆj | k�rþt d ƒ} ˆ| | |d d�d }q¾ˆj| k�r(t dƒ} ˆ| | |dd�d }q¾ˆj| k�rRt dƒ} ˆ| | |dd�d }q¾|| |ƒ�rdd }q¾t dƒ} ˆjD]’} t| ƒ} t | | ¡�r¢ˆ| | |dd�d }n`|  ¡d} t dƒ‰t‡fdd„| Dƒƒ�rÜ|  ¡d}n| }t | |¡�rrˆ| | |dd�d }�qrq¾t|| gƒ�s>t |ƒD]} t dƒ} ˆ| | |dd��qtƒd S)a¹Output 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 Fcsd|sttdƒƒt|ƒpd}|dkr(dSˆr>ˆj|ˆˆdd�}|rTtˆ ||¡ƒn t||ƒdS)Nz Matched from:rT©Z ignore_case)r}rr rYrŽ)r�ÚitemZprinted_headlineÚ can_overflow)rSÚmatchforr.r$r%Úprint_highlighted_key_item's  z8Output.matchcallback..print_highlighted_key_itemcsPˆj |¡sdStdƒ}d}ˆjD](}t ||¡r"ˆ|||p>|dd�d}q"|S)NFzFilename : %s©rëT)ÚFILE_PROVIDE_REÚmatchrÚfilesÚfnmatch)rêÚ printed_matchr�Z file_matchÚfilename)Úporír.r$r%Úprint_file_provides4s    ÿz1Output.matchcallback..print_file_providesz%s : z%s.%s : rNTrézRepo : %szDescription : rîzURL : %szLicense : %szProvide : %srz=<>c3s|]}|ˆvVqdSr(r$)r:Úchar)Úpossibler$r%rÜpr<z'Output.matchcallback..zOther : %s)F)r)ZshowdupesfromreposryrzrŽr­Zcolor_search_matchrYr}r§rrƒr¿r°r®r¯Zprovidesr•ròrQÚany)r.rõrÀrìr§rSrörvróZ name_matchrêr�ZprovideZ first_provideZitem_newr$)rSrìrõrørír.r%Ú matchcallbacksr           ÿ  zOutput.matchcallbackcCs|j|||dd�S)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ú)r.rõrÀrìr$r$r%Úmatchcallback_verboses zOutput.matchcallback_verbosec Csd}d}d}d}|D]¤}zpt|jƒ}||7}z| ¡r>||7}WntyRYn0|s\Wqzt|jƒ}Wnty|Yn0||7}Wqty¶d}tdƒ} t | ¡YqºYq0q|�s|rØt tdƒt |ƒ¡||krøt tdƒt ||ƒ¡|�rt tdƒt |ƒ¡dS) zÄReport 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) r©r¤ZverifyLocalPkgÚ ExceptionZ installsizerÚloggerÚerrorr»r) r.rÞZ installonlyÚtotsizeZlocsizeZinsizerþr~Úsizervr$r$r%ÚreportDownloadSize‹sH        ÿ  ÿzOutput.reportDownloadSizec Cspd}d}|D]F}z|j}||7}Wq tyPd}tdƒ}t |¡YqTYq 0q |slt tdƒt|ƒ¡dS)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)r¤rürrýrþr»r)r.rÞrÿrþr~rrvr$r$r%ÚreportRemoveSizeºs   zOutput.reportRemoveSizec Cs|sdSg}g}|jr$| tdƒ¡|jD]@}t| |¡ƒ}| |¡}|rP|jn|} | tdd| |ƒ¡q*|j r€| tdƒ¡|j D]6}t|  |¡ƒ}|j   |¡j} | tdd| |ƒ¡q†|�r|  |¡} |D]} | | t| | ƒd¡¡qÒ| | tdƒtdƒddf¡|d d …<d  |¡S) Nz+Marking packages as installed by the group:r�ú@z)Marking packages as removed by the group:r2ZGroupÚPackagesrrr‹)Z new_groupsrgrr Zadded_packagesZ _group_by_idrárr&Zremoved_groupsZremoved_packagesrär@rJr4r!r8r”) r.Úcompsr^roÚoutrEZgrp_idZpkgsZ group_objectZgrp_namer5r6r$r$r%Úlist_group_transactionÐs.    $zOutput.list_group_transactioncQ sz tjtjBtjBtjBtjBtjB}tƒ}tƒ}|durt dƒ} g}|D]:\}}t+|ƒD]&}| &d||fddddddf¡�q�qô| &| |f¡t!t'ˆj j( ,¡ƒ *¡ƒ}|�r¶t dƒ} g}|D]:\}}t+|ƒD]&}| &d||fddddddf¡�q|�ql| &| |f¡t!t'ˆj j( -¡ƒ *¡ƒ}|�rt dƒ} g}|D]"\}}| &|d|ddddf¡�qä| &| |f¡t!t'ˆj j( .¡ƒ *¡ƒ}|�r†t dƒ} g}|D]2\}}| &|dd|d|dfddddf¡�qD| &| |f¡t!t+ˆj j( /¡ƒƒ}|�rÞt dƒ} g}|D]}| &|ddddddf¡�q°| &| |f¡t!t+ˆj j( 0¡ƒƒ}|�r6t dƒ} g}|D]}| &|ddddddf¡�q| &| |f¡ˆj j1�rdd „}ˆj j1j2j3}|�r’t d!ƒ} g}| 4¡D]}| &||ƒ¡�qn| &| |f¡ˆj j1j2j5} | �rÜt d"ƒ} g}|  4¡D]}| &||ƒ¡�q¸| &| |f¡ˆj j1j2j6}!|!�r&t d#ƒ} g}|! 4¡D]}| &||ƒ¡�q| &| |f¡ˆj j1j7j3}"|"�rpt d$ƒ} g}|" 4¡D]}| &||ƒ¡�qL| &| |f¡ˆj j1j7j5}#|#�rºt d%ƒ} g}|# 4¡D]}| &||ƒ¡�q–| &| |f¡ˆj j1j7j6}$|$�rt d&ƒ} g}|$ 4¡D]}| &||ƒ¡�qà| &| |f¡ˆj8j9�rˆj8j:�s,ˆj j;j<|@�r,g}ˆj j=d'|d(�\}}t'd)d*„|Dƒƒ}t!|ƒD]}%| ||| |%gƒ} �qZd+g}&ˆj j>�sŒ|& &d,¡t d-ƒd. ?|&¡}'d/d0„|Dƒ}| &|'|f¡g}t!| *¡ƒD]\}(}%| ||| |%gƒ} �qÊt d1ƒ}'ˆj j8j@�r|'d}'n |'t d2ƒ}'d3d0„|Dƒ}| &|'|f¡ˆjAjB})|d4�srˆj j( C¡�srˆj j1�rnˆj j1j7�srˆj j1j2�srdS|d4i|d5|d6ig}d| ddd7g}*ˆjD|d8|*d9|d:�}*|*\}+} },}-}.tE|*ƒd7}/|)|/k�rÖ|)n|/})tF|+td;d<ƒtd=d<ƒƒ}0tF| td;d>ƒtd=d?ƒƒ}1tF|,td;d@ƒtd=d@ƒƒ}2tF|-td;dAƒtd=dBƒƒ}3tF|.td;dCƒtd=dCƒƒ}4dDdE|)ˆ G|0|+ f|1| f|2|, f|3|- f|4|.ffd.¡dE|)fg}5|D]Ö\} }|�r²dF| }6|D]¨\}7}8}9}:};}<}=|7|+ |=f|8| f|9|, f|:|- f|;|.ff}*ˆ G|*d.dG¡}>ˆ Hˆj8jI¡\}?}@t!|<ƒD]6}AdHt dIƒdJ}B|B|?|AjJ|@|AjK|AjLf;}B|>|B7}>� q|6|>}6�q¶|�rœ|5 &|6¡�qœ|5 &t dKƒdE|)¡t dLƒtM|jƒtM|jƒtM|jƒtM|jƒdft dMƒtM|jƒdft dNƒtM|jƒtM|jƒtM|jƒdft dOƒtM|jƒdft dPƒtM|ƒtM|ƒdff}Cd}Dd}Ed}Fd}G|CD]„\} }H}I|H� sN|I� sN� q4tNd|5 &|>|P|E|HdU|F|Jf|G|I|Of¡n$dV}>|5 &|>|P|E|Fd.|G|I|Of¡n&|H� r¾dW}>|5 &|>tR| |Dƒ|E|H|Jf¡� q¾d ?|5¡S)Xz]Return a string representation of the transaction in an easy-to-read format. N)rÄÚvÚrrc sÔ|j\}}}}} |j} |j} t|jƒ} |dur2d}|jrBˆjj} n|jrRˆjj } nˆjj } |  ||| | | || f¡dt |ƒfdt | ƒfdt | ƒffD],\}}||  |d¡|||d7<q”t|t |ƒƒ}|S)NZnoarchrÄrr rr)Zpkgtupr{r|rr¤r¦r)r¹Z _from_cmdliner¸rµrgrÚ setdefaultÚmax)ÚlinesrjÚa_widrõÚ obsoletesrÄÚaÚerr r{r¥rÚhirmr_r$r%Ú _add_lineþs"   *z*Output.list_transaction.._add_linez Installing group/module packageszInstalling group packagesr­Z InstallingZ UpgradingZ ReinstallingzInstalling dependencieszInstalling weak dependenciesZRemovingzRemoving dependent packageszRemoving unused dependenciesZ DowngradingcSs|jSr(©r~)Úxr$r$r%Ú4r<z)Output.list_transaction..)r�zInstalling module profilesz%s/%srzDisabling module profileszEnabling module streamszSwitching module streamsz%s -> %srzDisabling moduleszResetting modulescSstj | ¡¡ddddddfS)Nr)rr¨rÚÚgetName)rär$r$r%Ú format_lineqsz,Output.list_transaction..format_linezInstalling Environment GroupszUpgrading Environment GroupszRemoving Environment GroupszInstalling GroupszUpgrading GroupszRemoving GroupsT)Zreport_problemsÚ transactioncss|]}t|ƒ|fVqdSr(©r•rÛr$r$r%rÜ£r<z*Output.list_transaction..z--bestz--allowerasingzSSkipping packages with conflicts: (add '%s' to command line to force their upgrade)r2cSsg|]}|dd…d‘qS©Nrarr$©r:rFr$r$r%r;­r<z+Output.list_transaction..z,Skipping packages with broken dependencies%sz or part of a groupcSsg|]}|dd…d‘qSrr$rr$r$r%r;ºr<rÄrr ér=rb)r>r3rkrlr™ZPackagerrœr�r›rŸr ržz %s %s %s r1z%s: r‹z Z replacingz %s%s%s.%s %s z Transaction Summary %s ÚInstallÚUpgradeZRemoveÚ DowngradeZSkiprzDependent packagezDependent packagesz%s %*d %s (+%*d %s) z%-*sz%s %s ( %*d %s) z %s %*d %s )Sr·ZUPGRADEZ UPGRADE_ALLZ DISTUPGRADEZDISTUPGRADE_ALLZ DOWNGRADEZINSTALLr¿rr¨Z _make_listsr*Z WITH_MODULESrrrÍZupgradedZ reinstalledZinstalled_groupZ installed_depZinstalled_weakZerasedZ erased_depZ erased_cleanZ downgradedÚactionÚlibdnfrZTransactionItemAction_OBSOLETEDrªZ getReplacedByr rÁrdZFORWARD_ACTIONSZTransactionItemAction_REMOVEr@r~rgr9Z_moduleContainerZgetInstalledProfilesrer ZgetRemovedProfilesZgetEnabledStreamsZgetSwitchedStreamsZgetDisabledModulesZgetResetModulesZ_historyÚenvZ _installedrÀZ _upgradedZ_removedrär)ZbestÚstrictZ_goalÚactionsZ_skipped_packagesZ_allow_erasingr”Zupgrade_group_objects_upgrader,r3Z isChangedrArhrr4rVr¹ryrzr{rr r rr r )Qr.rrlZforward_actionsZskipped_conflictsZskipped_brokenZ list_bunchZ pkglist_linesrjr rZ ins_group_msgr Zpkglistr ZreplacesÚtsirFZ obsoletedZinstalledProfilesryZprofilesZprofileZremovedProfilesZenabledStreamsÚstreamZswitchedStreamsZdisabledModulesZ resetModulesrZinstall_env_groupräZupgrade_env_groupZremove_env_groupZ install_groupZ upgrade_groupZ remove_groupr~ZrecommendationsZskip_strr¼Z output_widthr3Zn_widZv_widZr_widZs_widZ real_widthZ msg_packageZmsg_archZ msg_versionZmsg_repositoryZmsg_sizerZtotalmsgrÄrr{r¥rrrrvrTrUZobspoZappendedZ summary_dataZmax_msg_actionZ max_msg_countZ max_msg_pkgsZmax_msg_depcountrŒZdepcountZmsg_pkgsZlen_msg_actionZ len_msg_countZ len_msg_pkgsZlen_msg_depcountZ msg_deppkgsZ action_msgr$r_r%Úlist_transactionës8ÿÿÿ  ÿ     ñ   (  (  ,             $ÿ    þ   ÿÿÿ ÿ ùúùúù  üüú ÿ    ýÿþýýÿÿ÷        ÿ  ý  þ ÿ zOutput.list_transactionc sº‡fdd„}|sdSg}g}| d |¡¡|D]}| t|ƒ¡q0dD]}|||ƒ}|rHq`qH|stˆjjd g}|r¶|dt|ƒ…} | d ˆ t| |ƒ¡¡¡|t|ƒd…}qt|S)NcsÚt|ƒ|krgSˆjj|dd}|dkr0gSdg|}d}|D]\}t|ƒ||krŠt|ƒ||}||krvgS||8}t|ƒ||<|d7}|t|ƒ;}qBtt|ƒƒD](}||||7<||d9<q¬|S)zb Work out how many columns we can use to display stuff, in the post trans output. rrbrra)rr,r3rc)ÚmsgsÚnumr#Zcol_lensrnrvror_r$r%Ú _fits_in_colsJs(   z+Output._pto_callback.._fits_in_colsrz{}:)ééérr�rNrbrbz {})rgÚformatr•r,r3rr4r!) r.r Ztsisr*rr(r%r)rIZ current_msgsr$r_r%Ú _pto_callbackGs&  zOutput._pto_callbackcCstj |j||j¡S)z{ Return a human-readable summary of the transaction. Packages in sections are arranged to columns. )rr¨Z_post_transaction_outputr*r/)r.rr$r$r%Úpost_transaction_outputyszOutput.post_transaction_outputcCs@d}|jjdkr6tjjjtjd�}tjjjtjd�|_|tƒfS)z_Set up the progress callbacks and various output bars based on debug level. Nrb)Úfo) r)Z debuglevelrr+r-ZMultiFileProgressMeterÚsysÚstdoutÚDepSolveProgressCallBack)r.Ú progressbarr$r$r%Úsetup_progress_callbacks€s  zOutput.setup_progress_callbackscCsz|dkr dS|jj}t d|¡tdt ¡|ƒ}dt||ƒt|ƒt|ƒf}tt dƒ|t |ƒƒ|}t |¡dS)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{®Gáz„?z %5sB/s | %5sB %9s ZTotal) r,r3rýr»r Útimerrr rr)r.Z remote_sizeZdownload_start_timestamprpZdl_timervr$r$r%Údownload_callback_total_cbŒs ýz!Output.download_callback_total_cbcCs‚tƒ}tƒ}d}|D]<}|jtjjtjjfvr0q| |j¡| |j¡|d7}qt |ƒdkrp|d  t |ƒ¡fS|d  t |ƒ¡fS)Nrrú, r) r¿r r!rZTransactionItemAction_UPGRADEDZ TransactionItemAction_DOWNGRADEDrÁÚ action_nameZ action_shortrr”rdr )r.Zhpkgsr$Z actions_shortrŒr~r$r$r%Ú_history_uiactions¡s    zOutput._history_uiactionsc st|tƒr‡‡fdd„|DƒS|dus.|dvrftdƒ}tdƒd|}ˆdur^t|ƒˆkr^|}t|ƒSdd„}ztt t|ƒ¡}|t|jƒd d ƒ}t|j ƒ}d ||f}ˆdurÞt|ƒˆkrÞd ||ƒ|f}t|ƒˆkrÞd |}|WSt �yþt|ƒYS0dS)Ncsg|]}ˆ |ˆ¡‘qSr$©r¬)r:Úu©Úlimitr.r$r%r;µr<z+Output._pwd_ui_username..)lÿÿiÿÿÿzZSystemr2cWs|j|Ž}|sdS|dS)zf Split gives us a [0] for everything _but_ '', this function returns '' in that case. rr)rQ)ÚtextÚargsr[r$r$r%Ú _safe_split_0Às z.Output._pwd_ui_username.._safe_split_0ú;rbz%s <%s>z %s ... <%s>z<%s>) rOr rrr ÚpwdÚgetpwuidr©Úpw_gecosÚpw_namer×) r.r±r@ZloginidryrCÚuserÚfullnameZ user_namer$r?r%r¬³s*    zOutput._pwd_ui_usernamec Csr|j |¡}|jjdkr"ddg}nb|jjdkr6dg}nN|jjdksFJ‚tƒ}d}d}|D]*}|d7}|jdurv|d7}| |j¡qXd}t|ƒdkrÜt d ƒ} |j j } | durºt j j  d¡} | durÆd } | d krÖ| d nd } n t d ƒ} d } t|tt dƒddƒt| | | ƒtt dƒddƒtt dƒddƒtt dƒddƒfƒd| dddddd} td| ƒd}|du�rxt|ƒ}|D]ð}t|ƒdk�rœ|j�p˜d} n| |jd ¡} t| ƒ} t dt |j¡¡} | | ¡¡\}}t| | | ƒ} t|ddƒ}d}}|jdu�rd}}n"|j�r d}}n|j�r0d }}|j�r.Z InstalledZErasedÚUpgradedÚ Downgraded)rFrÚorÄz Not installedZOlderZNewercSsg|] }t|ƒ‘qSr$)r)r:rr$r$r%r;yr<ÚmaxlenFrTc sìd|}|rˆ}nˆ}|d}ˆj ¡ ¡j|jd� ¡} | sH|d}nBˆj | d¡} | rŠ| | ¡} | dkrpn| dkr‚|d}n|d}|ržˆ  d¡\} } nˆ  d ¡\} } t ||d ƒ}d }|rÊ|  ¡}t d || || |t |ƒ|fƒdS) Nr2rF)ryrrrprÄrKrLrqrú%s%s%s%s %-*s %s)r`rÌrÍZfiltermryÚrunr^ÚpackageZcomparerVr rƒr}r•)r~Ú prefix_lenÚ was_installedrSÚ pkg_max_lenZ show_reporsZ _pkg_statesÚstateZipkgsZinst_pkgÚresrTrUZui_repo)Ú_pkg_states_availableÚ_pkg_states_installedr.r$r%Ú _simple_pkg}s4     ÿz+Output._historyInfoCmd.._simple_pkgrzTransaction ID :z%u..%uraz%czBegin time :zBegin rpmdb :z**i,z (%u seconds)iPFz (%u minutes)é<i€—z (%u hours)iz (%u days)i€QzEnd time :zEnd rpmdb :zUser :zReturn-Code :ZAbortedZSuccessz Failures:r:cSsg|] }t|ƒ‘qSr$rrr$r$r%r;Ör<zFailure:zReleasever :zCommand Line :cs>ˆjtjjkrd}nˆjtjjkr(d}nd}ttdƒ|ƒdS)NZPersistZ TransientZUnknownzPersistence :)Ú persistencer!rZTransactionPersistence_PERSISTZ TransactionPersistence_TRANSIENTr}r)r~Zpersistence_str)rTr$r%Úprint_persistenceïs z1Output._historyInfoCmd..print_persistencezComment :zTransaction performed with:r�)rvrwzPackages Altered:zScriptlet output:z%4dzErrors:)FFrT)#rVrOr©rr r rÀr_rr}r£rZr8rXrYZbeg_rpmdb_versionr\Z end_timestamprir]rur¿rÁr[Úallr”Z releaseverrUr~ÚcommentZperformed_withr•ÚhistoryInfoCmdPkgsAlteredÚoutputrþ)r.rTrlrVryrqr|r_ZbegtZbegtmZendtZendtmroÚseenrFZcodesrUrr~r�Z perf_withZmax_lenZwith_pkgZstr_lenZt_outr)ÚlineZt_errr$)rzr{rTr.r%rkosè   ÿ  ÿ ÿ ÿ)            &                 zOutput._historyInfoCmdrú Dep-InstallÚ ObsoletedÚ ObsoletingÚEraseÚ Reinstallrrorrn) z True-Installrr†r‡rˆr‰rŠrroZUpdateZUpdatedc sð|j}d}d}| ¡}|D]@‰| ˆjˆj¡}|t|ƒkrBt|ƒ}ttˆƒƒ}||kr|}q|D]Љd} ˆjtjj krzd} d} |rœt ‡fdd„|Dƒƒrœd} |  | ¡\} } | ˆjˆj¡}t t |ƒ|ƒ}td| | || |tˆƒˆ ¡fƒq`d S) 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 rr³z ** rLcsg|]}ˆ |¡‘qSr$)rð)r:Úpatrr$r%r;Or<z4Output.historyInfoCmdPkgsAltered..rKrrN)Ú_history_state2uistaterÞr@r;rr•rxr!rZTransactionItemState_DONErùrVr r r}rƒ) r.rTrlZ all_uistatesrqrwrÞZuistateZpkg_lenrsrSrTrUr$rr%r‚/s4    þz Output.historyInfoCmdPkgsAltered)NrNr)rr)FrFN)FrFN)r1)F)N)NN)NNN)N)F)N)N)F)9Ú__name__Ú __module__Ú __qualname__Ú__doc__rÒÚreÚcompilerïr/r8rJrVrYÚ staticmethodr]Úpropertyr^r`rArqrrr4r�r„r†r‡rŽr‘r²rºrÂrÊrÑrÔrÖrØrærèrúrûrrrr'r/r0r6r9r<r¬rdr¿rmrkrrŒr‚r$r$r$r%r'Csš     ÿ   /ÿ ÿ   V $ÿ O -  'ÿ d / ^2  " MM 5ö r'c@s(eZdZdZdd„Zdd„Zdd„ZdS) r4zGProvides text output callback functions for Dependency Solver callback.cCs°d}|dkrtdƒ}n||dkr(tdƒ}nj|dkr:tdƒ}nX|dkrLtd ƒ}nF|d kr^td ƒ}n4|d krptd ƒ}n"|dkr‚tdƒ}n|dkr’tdƒ}|r¬t ||j|j|j¡dS)aÕPrint information about a package being added to the transaction set. :param pkgtup: tuple containing the package name, arch, version, and repository :param mode: a short string indicating why the package is being added to the transaction set. Valid current values for *mode* are:: i = the package will be installed u = the package will be an update e = the package will be erased r = the package will be reinstalled d = the package will be a downgrade o = the package will be obsoleting another package ud = the package will be updated od = the package will be obsoleted NrFz'---> Package %s.%s %s will be installedr>z(---> Package %s.%s %s will be an upgraderz$---> Package %s.%s %s will be erasedr z)---> Package %s.%s %s will be reinstalledrmz)---> Package %s.%s %s will be a downgraderpz(---> Package %s.%s %s will be obsoletingZudz&---> Package %s.%s %s will be upgradedZodz'---> Package %s.%s %s will be obsoleted)rrýÚdebugryrzr{)r.r~Úmoderƒr$r$r%Ú pkg_added]s&       z"DepSolveProgressCallBack.pkg_addedcCst tdƒ¡dS)zRPerform setup at the beginning of the dependency solving process. z"--> Starting dependency resolutionN©rýr•rr_r$r$r%Ústart†szDepSolveProgressCallBack.startcCst tdƒ¡dS)zAOutput a message stating that dependency resolution has finished.z"--> Finished dependency resolutionNr˜r_r$r$r%rwŒszDepSolveProgressCallBack.endN)r�rŽr�r�r—r™rwr$r$r$r%r4Zs)r4c@seZdZdd„Zdd„ZdS)Ú CliKeyImportcCs||_||_dSr()r*rƒ)r.r*rƒr$r$r%r/’szCliKeyImport.__init__cCsbdd„}tdƒ||ƒ|tj |¡| dd¡f}t d|¡|jjj rJdS|jjj rXdS|j   ¡S) NcSs$tjjr dnd}|dd… d|¡S)NÚ0ó0iøÿÿÿr+)rZpycompZPY3Úrjust)râZrjr$r$r%Úshort_id˜sz'CliKeyImport._confirm..short_idzLImporting GPG key 0x%s: Userid : "%s" Fingerprint: %s From : %szfile://rr0TF) rrZcryptoZ_printable_fingerprintrPrýrfr*r)Z assumeyesZassumenorƒrÊ)r.râZuseridZ fingerprintr®Z timestampržrvr$r$r%Ú_confirm–s  þü   zCliKeyImport._confirmN)r�rŽr�r/rŸr$r$r$r%rš‘sršcsNeZdZdZedd„ƒZ‡fdd„Zdd„Zdd „Zd d „Z ddd„Z ‡Z S)ÚCliTransactionDisplayz1A YUM specific callback class for RPM operations.cCs tjj ¡Sr()rr+r,Ú _term_widthr_r$r$r%r¯r<zCliTransactionDisplay.cs0tt|ƒ ¡d|_d|_d|_d|_d|_dS)NrTr1é)Úsuperr r/ÚlastmsgÚ lastpackagerƒÚmarkÚmarksr_©Ú __class__r$r%r/±s zCliTransactionDisplay.__init__c Csjtjj |¡}|durdS| ¡}t|ƒ} ||_|dkr>d} n|tdƒ|} | ||||| || |¡dS)aåOutput 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.TransactionDisplay.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 Nréd) rrÚACTIONSr@Ú_max_action_widthr r¥rÚ _out_progress) r.rtr Úti_doneÚti_totalÚts_doneÚts_totalZ action_strÚwid1ÚpkgnameÚpercentr$r$r%r-»s ÿzCliTransactionDisplay.progresscCsDt|dƒs:d}tjj ¡D]}t|ƒ}||kr|}q||_|j}|S)NÚ_max_action_wid_cacher)Úhasattrrrr«rÀr rµ)r.r²rGZwid_valr$r$r%r¬Ûs z'CliTransactionDisplay._max_action_widthc Cs”|jr�tj ¡s||kr�|j|||tj ¡||d�\} }} t|ƒ}| t|||ƒt|| | ƒf} | |jkr�tj   d| tj¡| |_||kr�t dƒdS)N)r-r³r²Z write_flushr2) rƒr2r3ÚisattyÚ_makefmtr r r¤rr¨Ú_terminal_messengerr}) r.r®r¯r°r±r´Zprocessr³r²rcÚwid2rvr$r$r%r­æs þ   ÿ z#CliTransactionDisplay._out_progressTNécCsštt|ƒƒ}d||f}d|d|d} | ||f} |durFd} nt|ƒ} d|d} | d|d7} | d7} | d7} | d7} |j} | | kr”| } | | 8} | | dkr°| d} |j| | }d||f} d| d }| |d}|rü|d krüd | }|}n”|�rD|d k�r*||jt||d ƒf}nd}d|d| }| }nL|d k�r\d| }|}n4|d k�rx||j|f}nd}d|d| }| }|||fS)Nr´ú%zs/%Úsr¢rbrz[%-zs]rªz %s: %s rgY@rz %s: %s r2z %s: %s z %s: %s )rr•r rpr¦r©)r.r´r°r±r-r³r²ÚlrZfmt_donerbZpnlZoverheadrpr§Zfmt_barZfull_pnlrcrºZbarr$r$r%r¸õsP            zCliTransactionDisplay._makefmt)TNr») r�rŽr�r�r”rpr/r-r¬r­r¸Ú __classcell__r$r$r¨r%r ¬s    ÿr c CsŒd}tj ¡sdS|dkr d}n|dkr6t|ƒ|}nd}tjj ¡}|durZ||krZd}d||f}|t|ƒd8}|dkr‚d}|dur¾|d8}|dkržd}|t ||ƒ}d|||f}n€||krÜd t |||ƒ|f}nb|d 8}|dkrðd}|d} | t |ƒk�rt |ƒ} || 8}|t ||ƒ}d t || | ƒ|||f}||k�rZtj   d |tj¡||k�rvtj   d d tj¡tj j dtjd�dS)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 rRNrr7z %d/%drrbz [%-*s]%sz %s%sr�z %s: [%-*s]%sÚwriter‹Úflush)r)r2r3r·r£rr+r,r¡rr©r r r¨r¹) rZÚtotalryr¦r´rprwZhashbarrƒZnwidr$r$r%r5+sN    ÿ  r5)N)sb   (    %7