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KO}ӽmSşذqsOy?\[,d@'73'j%kOe`1.g2"e =YIzS2|zŐƄa\U,dP;jhhhaxǶ?КZ՚.q SE+XrbOu%\GتX(H,N^~]JyEZQKceTQ]VGYqnah;y$cQahT&QPZ*iZ8UQQM.qo/T\7X"u?Mttl2Xq(IoW{R^ ux*SYJ! 4S.Jy~ BROS[V|žKNɛP(L6V^|cR7i7nZW1Fd@ Ara{詑|(T*dN]Ko?s=@ |_EvF]׍kR)eBJc" MUUbY6`~V޴dJKß&~'d3i WWWWWW
Current Directory: /usr/share/yum-cli
Viewing File: /usr/share/yum-cli/output.pyc
� � v_c@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z m Z ddl ZddlmZddlmZddlmZmZmZddlZddlmZmZdd lTdd lmZmZmZdd lm Z dd l!m"Z"ddl#Zddl$Zdd lm%Z%m&Z&m'Z'ddl(Z(ye)dd�dks�t*�Wnd�Z+d�Z)nXd�Z,de fd��YZ-de fd��YZ.dfd��YZ/dfd��YZ0dfd��YZ1dfd��YZ2e3d�Z4d e fd!��YZ5e3d"�Z6e7d#kr�e8ej9�d$ko�ej9d$d%krGd&GHd'GHd&GHe0�Z:x�d(d)d*d$d+d,d-d.d/d0d1d2d3d4dd5d6d7d8d-d9d-d:d-d;fD]8Z;e:j<e;�Z=d<e;e=d=d>e8e=�e=fGHqWne8ej9�d$kolej9d$d?krId&GHd@GHd&GHx4e>d(dA�D]#Z;e6e;d0dB�ej?d*�q�Wd&GHdCGHd&GHx<e>d(dA�D]+Z;e6e;d0dDdEdF�ej?d*�q�Wd&GHdGGHd&GHx1e>d(dA�D] Z;e6e;d0�ej?d*�q"Wne8ej9�d$kotej9d$d?dHfkrVe5�Z@eAe@_BdBe@jCdI<dJe@jCdK<d&GHdLGHd&GHx@e>d(dA�D]/Z;e@jDdMdIe;d0e;d0�ej?d*�q�Wd&GHdNGHd&GHxLe>d(dA�D];Z;e@jDdOdPdQdRdKe;d0e;d0�ej?d*�qWne8ej9�d$ko�ej9d$d?dSdHdTfkr�ejEjF�ne8ej9�d$ko�ej9d$d?dSfkrud&GHdUGHd&GHx:e>d(dA�D])Z;e6e;d0edV��ej?d*�q�Wd&GHd&GHdWGHd&GHxBe>d(dA�D]1Z;e6e;d0edVdFdR��ej?d*�q8Wd&GHne8ej9�d$ko�ej9d$d?dSdHdTfkr�e5�Z@eAe@_BedV�e@jCdI<e@jCdIdFdRe@jCdK<d&GHdXGHd&GHx@e>d(dA�D]/Z;e@jDdMdIe;d0e;d0�ej?d*�q Wd&GHdYGHd&GHxLe>d(dA�D];Z;e@jDdOdPdQdRdKe;d0e;d0�ej?d*�q[Wd&GHnndS(Zs"Handle actual output from the cli.i����N(tproxy(t TextMetertTextMultiFileMeter(t URLGrabError(tprco_tuple_to_string(tto_strtto_utf8t to_unicode(t checkSignalst formatRequire(t*(t logginglevelst_tP_(tRPMBaseCallback(tpackagesNewestByNameArch(t utf8_widthtutf8_width_filltutf8_text_filliicGs*x#|D]}||kr|}qqW|S(N((txtargsty((s/usr/share/yum-cli/output.pytmin8s  cGs*x#|D]}||kr|}qqW|S(N((RRR((s/usr/share/yum-cli/output.pytmax<s  cCsIttjd�sdStjj�}|dkr5dS|dkrEdS|S(s= Simple terminal width, limit to 20 chars. and make 0 == 80. tterminal_width_cachediPii(thasattrt urlgrabbertprogressR(tret((s/usr/share/yum-cli/output.pyt _term_widthAs  t YumTextMetercBseZdZdd�ZRS(s,A class to display text progress bar output.cCst�tj|||�dS(s Update the status of the text progress bar :param amount_read: the amount of data, in bytes, that has been read :param now: the current time in seconds since the epoch. If *now* is not given, the output of :func:`time.time()` will be used. N(RRtupdate(tselft amount_readtnow((s/usr/share/yum-cli/output.pyRPsN(t__name__t __module__t__doc__tNoneR(((s/usr/share/yum-cli/output.pyRMstYumTextMultiFileMetercBseZd�ZRS(cCst�tj|||�dS(N(RRt update_meter(R tmeterR"((s/usr/share/yum-cli/output.pyR(\s(R#R$R((((s/usr/share/yum-cli/output.pyR'[stYumTermcBs�eZdZeZeejd�r6ed��Z nidd6dd6dd6Z id d 6d d 6d d6dd6dd6dd6dd6dd6Z id d 6d d6d d6dd6dd 6dd6dd6dd6Z idd6dd6dd6dd6d d6d!d6Z id"d 6d#d6d$d6d%d6d&d 6d'd6d(d6d)d6Zid*d 6d+d6d,d6d-d6d.d 6d/d6d0d6d1d6Zd2�Zd=d3d4�Zd=d3d5�Zd6�Zd=ed7�Zd8�Zd9�Zd:�Zd;�Zd<�ZRS(>s>A class to provide some terminal "UI" helpers based on curses.RcCst�S(N(R(R ((s/usr/share/yum-cli/output.pyt<lambda>mstsmult underlinetrevtreversetsgr0tnormalitblackitblueitgreenitcyanitreditmagentaityellowitwhitestboldstblinkttdimsss(BsssssssssssssssscCs(|j|_|j|_|j|_dS(N(t_YumTerm__ansi_forced_MODEtMODEt_YumTerm__ansi_forced_FG_COLORtFG_COLORt_YumTerm__ansi_forced_BG_COLORtBG_COLOR(R ((s/usr/share/yum-cli/output.pyt __forced_init�s  tautoc Cs�t|_ttjd�s'd|_nd|_|dkrJ|j�dSidd6dd6dd 6dd 6dd 6dd 6|_idd 6dd6dd6dd6dd6dd6dd6dd6|_ idd 6dd6dd6dd6dd6dd6dd6dd6|_ |dkrt |_dS|dks*t �yddl }Wnt |_dSX|s`tj}n|j�syt |_dSy|jd|j��Wnt |_dSX|j|_ttjd�s�|jd�|_n|jd�|_xR|jD]G}|}||jkr!|j|}n|j|�p3d|j|<q�W|jd�}|r�x?|jj�D]+\}}|j||�p�d|j |<qfWn|jd�}|r�x?|jj�D]+\}}|j||�p�d|j |<q�Wn|jd�} | rFx?|jj�D]+\}}|j| |�p5d|j |<qWn|jd�} | r�x?|jj�D]+\}}|j| |�p�d|j |<qkWndS(sReinitializes the :class:`YumTerm`. :param term_stream: the terminal stream that the :class:`YumTerm` should be initialized to use. If *term_stream* is not given, :attr:`sys.stdout` is used. :param color: when to colorize output. Valid values are 'always', 'auto', and 'never'. 'always' will use ANSI codes to always colorize output, 'auto' will decide whether do colorize depending on the terminal, and 'never' will never colorize. RiPitalwaysNR<R:R;R=R/R-R1R2R3R4R5R6R7R8R9tneverREi����tfdtcolstlinestsetftsetaftsetbtsetab(tTruet_YumTerm__enabledRRRtcolumnsRJt_YumTerm__forced_initR?RARCtFalsetAssertionErrortcursestsyststdouttisattyt setuptermtfilenottigetstrt _ctigetstrttigetnumt_YumTerm__cap_namest _tigetstrt_YumTerm__colorstitemsttparmt_YumTerm__ansi_colors( R t term_streamtcolorRUtcap_nametmodetset_fgtvalt set_fg_ansitset_bgt set_bg_ansi((s/usr/share/yum-cli/output.pytreinit�s�                 &&&cCs|j||�dS(N(Rm(R RdRe((s/usr/share/yum-cli/output.pyt__init__scCs(|j|�pd}tjdd|�S(NR<s \$<\d+>[/*]?(R\tretsub(R Rftcap((s/usr/share/yum-cli/output.pyR_sc s�|js |S|stj}n��fd�}xM|D]E}||�} |rhtj| tj�} ntj| ||�}q8W|S(s)Search the string *haystack* for all occurrences of any string in the list *needles*. Prefix each occurrence with *beg*, and postfix each occurrence with *end*, then return the modified string. For example:: >>> yt = YumTerm() >>> yt.sub('spam and eggs', 'x', 'z', ['and']) 'spam xandz eggs' This is particularly useful for emphasizing certain words in output: for example, calling :func:`sub` with *beg* = MODE['bold'] and *end* = MODE['normal'] will return a string that when printed to the terminal will appear to be *haystack* with each occurrence of the strings in *needles* in bold face. Note, however, that the :func:`sub_mode`, :func:`sub_bold`, :func:`sub_fg`, and :func:`sub_bg` methods provide convenient ways to access this same emphasizing functionality. :param haystack: the string to be modified :param beg: the string to be prefixed onto matches :param end: the string to be postfixed onto matches :param needles: a list of strings to add the prefixes and postfixes to :param escape: a function that accepts a string and returns the same string with problematic characters escaped. By default, :func:`re.escape` is used. :param ignore_case: whether case should be ignored when searching for matches :return: *haystack* with *beg* prefixing, and *end* postfixing, occurrences of the strings in *needles* cs�|j��S(N(tgroup(tmatch(tbegtend(s/usr/share/yum-cli/output.pyR+Js(RPRotescapettemplatetIRp( R thaystackRtRutneedlesRvt ignore_casetrendertneedletpat((RtRus/usr/share/yum-cli/output.pyRp$s    cKs |j|||jd||�S(sOSearch the string *haystack* for all occurrences of any string in the list *needles*. Prefix each occurrence with *beg*, and postfix each occurrence with self.MODE['normal'], then return the modified string. If *beg* is an ANSI escape code, such as given by self.MODE['bold'], this method will return *haystack* with the formatting given by the code only applied to the strings in *needles*. :param haystack: the string to be modified :param beg: the string to be prefixed onto matches :param end: the string to be postfixed onto matches :param needles: a list of strings to add the prefixes and postfixes to :return: *haystack* with *beg* prefixing, and self.MODE['normal'] postfixing, occurrences of the strings in *needles* R1(RpR?(R RyRtRztkwds((s/usr/share/yum-cli/output.pytsub_normQscKs|j||j|||�S(sTSearch the string *haystack* for all occurrences of any string in the list *needles*. Prefix each occurrence with self.MODE[*mode*], and postfix each occurrence with self.MODE['normal'], then return the modified string. This will return a string that when printed to the terminal will appear to be *haystack* with each occurrence of the strings in *needles* in the given *mode*. :param haystack: the string to be modified :param mode: the mode to set the matches to be in. Valid values are given by self.MODE.keys(). :param needles: a list of strings to add the prefixes and postfixes to :return: *haystack* with self.MODE[*mode*] prefixing, and self.MODE['normal'] postfixing, occurrences of the strings in *needles* (R�R?(R RyRgRzR((s/usr/share/yum-cli/output.pytsub_modedscKs|j|d||�S(s�Search the string *haystack* for all occurrences of any string in the list *needles*. Prefix each occurrence with self.MODE['bold'], and postfix each occurrence with self.MODE['normal'], then return the modified string. This will return a string that when printed to the terminal will appear to be *haystack* with each occurrence of the strings in *needles* in bold face. :param haystack: the string to be modified :param needles: a list of strings to add the prefixes and postfixes to :return: *haystack* with self.MODE['bold'] prefixing, and self.MODE['normal'] postfixing, occurrences of the strings in *needles* R:(R�(R RyRzR((s/usr/share/yum-cli/output.pytsub_boldxscKs|j||j|||�S(scSearch the string *haystack* for all occurrences of any string in the list *needles*. Prefix each occurrence with self.FG_COLOR[*color*], and postfix each occurrence with self.MODE['normal'], then return the modified string. This will return a string that when printed to the terminal will appear to be *haystack* with each occurrence of the strings in *needles* in the given color. :param haystack: the string to be modified :param color: the color to set the matches to be in. Valid values are given by self.FG_COLOR.keys(). :param needles: a list of strings to add the prefixes and postfixes to :return: *haystack* with self.FG_COLOR[*color*] prefixing, and self.MODE['normal'] postfixing, occurrences of the strings in *needles* (R�RA(R RyReRzR((s/usr/share/yum-cli/output.pytsub_fg�scKs|j||j|||�S(s�Search the string *haystack* for all occurrences of any string in the list *needles*. Prefix each occurrence with self.BG_COLOR[*color*], and postfix each occurrence with self.MODE['normal'], then return the modified string. This will return a string that when printed to the terminal will appear to be *haystack* with each occurrence of the strings in *needles* highlighted in the given background color. :param haystack: the string to be modified :param color: the background color to set the matches to be in. Valid values are given by self.BG_COLOR.keys(). :param needles: a list of strings to add the prefixes and postfixes to :return: *haystack* with self.BG_COLOR[*color*] prefixing, and self.MODE['normal'] postfixing, occurrences of the strings in *needles* (R�RC(R RyReRzR((s/usr/share/yum-cli/output.pytsub_bg�sN(R#R$R%RORPRRRtpropertyRQR^R`RcR>R@RBRRR&RmRnR_RSRpR�R�R�R�R�(((s/usr/share/yum-cli/output.pyR*`sz        o -    t YumOutputcBsLeZdZd�Zd�Zd�Zd�ZdMd�Zd�Z d�Z e d��Z dMd dMd d �Z e d ��Zd �Zdded�Zed edMd�Zed edMd�Zd�Zdd�Zd�Zed�ZdMdMd�ZidMid�Zed�id�Zd�Zd�ZddMd�ZddMdMd�Z d �Z!d!�Z"d"�Z#d d#d$�Z$e d d%��Z%dMdMdMd&�Z&dMd'�Z'ed(�Z(d)�Z)d*�Z*d+�Z+d,�Z,d-�Z-d.�Z.d/�Z/d0�Z0d1�Z1dMd2�Z2e d3��Z3d4�Z4d5�Z5d6�Z6d7�Z7d8�Z8d9�Z9d:�Z:gd;�Z;i ed<�d=6ed<�d<6ed>�d>6ed?�d?6ed@�d@6edA�dA6edB�dB6edC�dC6edD�dD6edE�dE6edF�dF6Z<gdG�Z=dH�Z>dI�Z?dJ�Z@dK�ZAe dL��ZBRS(Ns+Main output class for the yum command line.cCs�tjd�|_tjd�|_ttd�rQtjd�jd�|_n dg|_t �|_ d|_ d�t j�D�|_dS(Nsyum.clisyum.verbose.clit expandMacros %_i18ndomainst:s redhat-distcSsi|]\}}t|�qS((RS(t.0tktv((s/usr/share/yum-cli/output.pys <dictcomp>�s (tloggingt getLoggertloggertverbose_loggerRtrpmR�tsplitt i18ndomainsR*ttermR&t_last_interrupttERRORS_TO_KBASE_ARTICLESt iteritemstreported_error_msgs(R ((s/usr/share/yum-cli/output.pyRn�s   c Cs�td�td�td�td�td�td�td�td�td �td �td �td �g }tjtj��}|ttjd |��dtjd|�}|S(s�Return a string representing the current time in the form:: Mon dd hh:mm:ss :return: a string representing the current time tJantFebtMartAprtMaytJuntJultAugtSeptOcttNovtDecs%mis %d %T (R ttimet localtimetinttstrftime(R tmonthsR"R((s/usr/share/yum-cli/output.pyt printtime�s 6<cCs�|jjd|j|j�t|d�r`|jr`|jjdkr`|jjtd��dS|jjtd��|j|�|j�dS(s�Perform failure output for failovers from urlgrabber :param errobj: :class:`urlgrabber.grabber.CallbackObject` containing information about the error :raises: *errobj*.exception s%s: %stretry_no_cacheis'Trying again, now avoiding proxy cache.NsTrying other mirror.( R�terrorturlt exceptionRR�terrnoR tsuggestKBaseArticle(R terrobj((s/usr/share/yum-cli/output.pyt failureReport�s cCs�d}t|jd�r9|jjtkr9|jj}n3t|jd�rl|jjtkrl|jj}n|svdS|j|s�|jjt|�t |j|<ndS(NtcodeR�( R&RR�R�R�R�R�R�R�RO(R R�terrcode((s/usr/share/yum-cli/output.pyR��s$$ cCst|||�dS(sEOutput the current status to the terminal using a simple status bar. :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 N(t progressbar(R tcurrentttotaltname((s/usr/share/yum-cli/output.pytsimpleProgressBar�s cCs�d}d}|snQt|t� s1|dkrD|jjd}n"|dkrSnx|jdd�j�D]�}tr{ql|dkr�d}ql||jjkr�||jj|7}ql||jjkr�||jj|7}ql|jd�r"|d|jjkr"||jj|d7}ql|jd�rl|d|jj krl||jj |d7}qlqlW|r|jjd}n||fS( NR<R:R1t,t sfg:isbg:( t isinstancet basestringR�R?treplaceR�RSRAt startswithRC(R t highlightthibegthiendthigh((s/usr/share/yum-cli/output.pyt _highlights4   cKs1|j|�\}}|jj|||||�S(N(R�R�Rp(R RyR�RzRR�R�((s/usr/share/yum-cli/output.pyt_sub_highlightscCsAd}x4|D],}||d|kr+Pn||d7}q W|S(s; Spaces left on the current field will help how many pkgs? ii((R�t data_tupstleftRttup((s/usr/share/yum-cli/output.pyt_calc_columns_spaces_helps"s  iR<cCs�|dkr|jj}nt|�}|}dg|}x1td|�D] }t||j��||<qJW|dkr�dg|d}|jd�n|t|�|dt |�8}|ds�|d7}nx|dkr�d} d} x�t d|�D]y}|j |||||�} | s.q�n| rZ||dkrZ| d| krZq�n| | krlq�n| } |} q�W| r�|| j d�d|| } ||  r�| |dkr�|d8}n|| c| 7<|| 8}q�nd} x1t d|�D] }||sq�n| d7} q�W| rz|| }xDt d|�D]0}||sYqCn||c|7<||8}qCWn|d8}||}x't d|�D]}||c|7<q�W||c|||7<d}q�W|S(s�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.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 iii����iN( R&R�RQtlentrangetsortedRatappendtsumRtxrangeR�tpop(R tdataRQtremainder_columnt total_widthtindentRItpdatatdthelpsRitthelpstdifftoverflowed_columnstnorm((s/usr/share/yum-cli/output.pyt calcColumns,sj    "   &          cCs!|dkrd| fSd|fS(Niu-u((twidth((s/usr/share/yum-cli/output.pyt_fmt_column_align_width�s  cCs�t|�dks*t|�dks*t�t|�dkrU|\}}d}}nt|�dkr�|\}}}|j|�\}}n||||fS(NiiR<(R�RTR�(R tcol_dataRiR�R�R�R�((s/usr/share/yum-cli/output.pyt _col_data�s*  uc Cs�t|�}g}x|d D]}|j|�\}} } } | sa|d7}|j|�qn|j| �\} } ||�} | | kr�|d7}| dkr�|j| || d| | g�q|jd| | | || g�n0|dd|| d7}|j| || g�|| 7}|d7}qW|j|d�\}} } } |j| �\} } t|| d| dkd | d | �}|d |7}|j|�|t|�S( s�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 :param text_width: a function to find the width of the items in the columns. This defaults to utf8 but can be changed to len() if you know it'll be fine :return: a row of data formatted into a string for output i����u%su %s%s%s%s u-R�u%s%s%s iR�tprefixtsuffixu%%s%s(R�R�R�R�textendRttuple(R RQtmsgRut text_widthR�R�R�RiR�R�R�talignt val_width((s/usr/share/yum-cli/output.pyt fmtColumns�s4       $$  c Cs�|dkrd}n|j�}d||j|jf}|ddg}|j} t||| f||�}|j|dt�GHdS( s�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 colums: tuple containing the space allocated for each column of output. The columns are the package name, version, and repository i���i��i�s%s%s.%sR1R�N(i���i��i�(R&tprintVerR�tarcht ui_from_repotzipR�R�( R tpkgt ui_overflowR�R�RQtvertnathi_colstrid((s/usr/share/yum-cli/output.pyt simpleList�s    c Css|dkrd}nd|t|�f}|ddg}|j}t||f||�}|j|dt�GHdS(s(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 colums: tuple containing the space allocated for each column of output. The columns the are the package envra and repository i����i�s%s%sR1R�N(i����i�(R&tstrR�R�R�R�( R R�R�R�R�RQtenvraR�R�((s/usr/share/yum-cli/output.pytsimpleEnvraList�s   c Cs�t|�}t|�}|jj}d|dd}t|d|d|d|�}|jd�dkr�||d kr�t|d|d|dd �}n|S( s�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 R�is: R�tinitial_indenttsubsequent_indents iis ...: (RRR�RQRtcount(R tkeyRitkeylenRItnxtR((s/usr/share/yum-cli/output.pyt fmtKeyValFill s   % t=cCs�t|�}|jjd}t|�}||dkrI|d}}n*|||d}|||t|�}d|||fS(s�Format and return a section header. The format of the header is a line with *name* centred, 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 iis%s %s %s(RR�RQRR�(R R�tfillRItname_lenRtRu((s/usr/share/yum-cli/output.pyt fmtSections  cCsgt|�}t|�dkr]x<|jD].}tj||�}||kr(|}Pq(q(Wnt|�S(s_Get the translated version from specspo and ensure that it's actually encoded in UTF-8.i(RR�R�tgettexttdgettextR(R tsR�tt((s/usr/share/yum-cli/output.pyt_enc3s   cCs|j|�\}}td�|t|j�|fGHtd�t|j�GH|jdkrxtd�t|j�GHntd�t|j�GHtd�t|j�GHtd�|jt |j ��GHtd�t|j j �GH|j d kr d |jkr td �t|jj�GHn|jjtj�r�td �t|j�GHtd �tj|j�GHtd�tj|j�GHt|d�r�td�tj|j�GHn|j d kr�d}d|jkryt|jj�}Wqtk rd}qXntd�|j|�GHd}d|jkrgyt|jj �}Wqgtk rcd}qgXntd�|j|�GHq�n|j!td�|j"|j#��GH|j$r�td�t|j$�GHn|j!td�t|j%��GH|j!td�|j"|j&��GHdGHdS(s�Print information about the given package. :param pkg: the package to print information about :param hightlight: highlighting options for the name of the package sName : %s%s%ssArch : %st0sEpoch : %ssVersion : %ssRelease : %ssSize : %ssRepo : %st installedt from_reposFrom repo : %ssCommitter : %ssCommittime : %ssBuildtime : %st installtimesInstall time: %st installed_bysInstalled by: %st changed_bysChanged by : %ssSummary : sURL : %ssLicense : sDescription : R<N('R�R RR�R�tepochtversiontreleaset format_numbertfloattsizetrepotui_idtrepoidt yumdb_infoR R�t isEnabledForR tDEBUG_3t committerR�tctimet committimet buildtimeRR R&R�R t ValueErrort_pwd_ui_usernameR R�RtsummaryR�tlicenset description(R R�R�R�R�tuid((s/usr/share/yum-cli/output.pyt infoOutput?sL!!    #  #c Cs�|\}}|r%|j|kr%dS|dk r�|jj}|jjdkrj|j�rj|jj}n|j|d|d|�|j|d|dd d|jj �dS|j �}d|j |j f} |j} d || || fGHdS( s�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 :param repoid: a repoid that the new package should belong to NRRQR�R�R�is%s.%ss%-35.35s [%.12s] %.10s %-20.20ss ( RR&tconftcolor_update_remoteRtidtverifyLocalPkgtcolor_update_localR�tcolor_update_installedt compactPrintR�R�( R tuotupt changetypeRQRt changePkgtinstPkgtchit c_compactt i_compacttc_repo((s/usr/share/yum-cli/output.pytupdatesObsoletesListms      c Cs�tjj|j�}|dkr�d}t|�dkrqd}d|GHx&t|�D]} | j| jf} t} | j |kr�|j dd�} n�| |kr�|j dd �} nb| j || �r�|j d d �} n:| j || �r|j d d �} n|j d d �} |dkrH|j | dtd| d|�qU|dkrU|j| d| �qUqUWn|dkr�ddgfSdgfSdS(s�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 :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: (exit_code, [errors]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string tlisttinfoiis%stkernsbold,underlinesnot inR1R�t>R:t<R�R�RQsNo Packages to listN(slistsinfo(tyumtmisctget_running_kernel_pkgtupttsR�R�R�R�RStpkgtuptgettverEQtverLTR�ROR#( R tlstR!t outputTypet highlight_naRQthighlight_modest kern_pkgtupt thingslistedR�R�R�((s/usr/share/yum-cli/output.pytlistPkgs�s6(       sIs this ok [y/N]: cCsPdttd��ttd��f}dttd��ttd��f}t||�}x|D]}|j||�qeWx�tr yt|�}Wn3tk r��n tk r��n d}nXt|�}|j�}t |�dks||kr�Pq�q�W|sd S||kr'dSx"|D]}|||kr.|Sq.Wd S( s�Get a yes or no from the user, and default to No, and maybe more. :param extra: a dict of ui responses to a list of their inputs. :return: the UI response or None for no. At it's simplest this is 'yes' or None uyRtyesuntntnoR<iN( RR tsetRROt raw_inputtUnicodeEncodeErrortUnicodeDecodeErrortlowerR�R&(R tprompttextratyuitnuitauitxuitchoice((s/usr/share/yum-cli/output.pyt userconfirm�s4''         cCs |j�S(N(RW(R tkeydict((s/usr/share/yum-cli/output.pyt_cli_confirm_gpg_key_importsc CsD|jj|�}|jj|�}t|�}i}x*|D]"}d|f||j|jf<q=Wx�|D]�}|j|jf}||kr�|df||j|jf<qj|j||d�rj|||df||j|jf<qjqjWi}xH|j�D]:\}} |p| }|j |jg�j || f�qW|S(s Convert pkg_names to installed pkgs or available pkgs, return value is a dict on pkg.name returning (apkg, ipkg). iN( trpmdbt searchNamestpkgSackRR&R�R�tverGTt itervaluest setdefaultR�( R t pkg_namestipkgstapkgstpkgsR�R�Rtapkgtipkg((s/usr/share/yum-cli/output.pyt_group_names2aipkgss"     + &s cCs�x�|D]�}||krqnx�||D]�\}}|p?|} tt| ��t|�} |rq| d7} nt| j�} xNd| fd| ffD]4\} } || j| d�|| | cd7<q�Wq*WqWdS(NiR�R�i(RR�R�R�R_(R R�R`tpkg_names2pkgsR�t igroup_datatitemRdReR�R�R�R�R�((s/usr/share/yum-cli/output.pyt_calcDataPkgColumns!s    %c sG�fd�}|s_x+t|�D]6}|||�} | dkrIq"nd| |fGHq"Wn�x�t|�D]�}|||�} | dkr�qln||kr�d| |fGHqlnx�t||dd��D]m\} } | r�| r�|jj} n| r |jj} nt} |j| p| dtd| d| d|�q�WqlWdS( Ncs��s |S|�kst�|�ks8�|dkrE|d7}nn�|dkrb|d7}nQ�|dkr�tr|dS|d7}n*�|dks�t�tr�dS|d7}|S( Nt availablet+RR�sblacklisted-installedR�sblacklisted-availablet-(RTRSR&(RiR�(Rh(s/usr/share/yum-cli/output.pyt_get_igrp_data3s     s%s%sR�cSs|dp|dS(Nii((R((s/usr/share/yum-cli/output.pyR+XsR�R�R�RQ(R�R&R$tcolor_list_installed_oldertcolor_list_available_installRSR�RO( R R`tverboseRgR�RQRhRnRitpindentRdReR�((Rhs/usr/share/yum-cli/output.pyt_displayPkgsFromNames0s0     c Cstd�|jGH|jjtj�}trHtd�t|j�GHn|j |�}t �}x.|D]&}||dkrg|j |�qgqgW|j |j �|j t|�}d}|r�|j|�}nVi}xM|jj|�D]9}|j|krg||j<n||jj|�q�W|jrLtd�t|j�GHn|jrjtd�|jGHndtd�|jfdtd �|jfd td �|jfdtd �|jff} d} |rSiid 6id6} x0| D](\} } }|j| ||d|�q�W| d | dg} |j| �} | d | d f} nx�| D]~\} } }| dkr~|}n!| |jjkr�|}nd}t|�dkrZ| GH|j |||d| d|�qZqZW|rtd�GH|j |||d| d|�ndS(s�Output information about the packages in a given group :param group: a Group object to output information about s Group: %ss Group-Id: %sRs Description: %ss Language: %st mandatorys Mandatory Packages:tdefaults Default Packages:toptionals Optional Packages:s Conditional Packages:R�R�RhiiRQs Installed Packages:N(!R tui_nameR�RR RRORtcompsidt_groupInstalledDataRKtaddtdifference_updatetpackagesR4R&RfRZR[R�R�tui_descriptiontlangonlytmandatory_packagestdefault_packagestoptional_packagestconditional_packagesRjR�R$tgroup_package_typesR�Rs(R RrtverbRht igrp_onlytpkg_nametall_pkgsRgRetsectionsRQR�t section_typet section_nameR`t tigroup_data((s/usr/share/yum-cli/output.pytdisplayPkgsInGroupscsp                c s�td�|jGHtd�t|j�GH|j|��t�}x.�D]&}�|dkrI|j|�qIqIW|j|j�|jt |�}|j r�td�t|j �GHn�fd�}td�|j ftd�|j ff}xu|D]m\}}t |�dkr�|GHxGt|�D]6}||d �} | d krQq*nd | |fGHq*Wq�q�W|r�td �GHx$t|�D]}d Gd G|GHq�Wnd S(s�Output information about the groups in a given evgroup :param group: an Environment object to output information about s Environment Group: %ss Environment-Id: %sRs Description: %scs��s |S|�kst�|�ks8�|dkrE|d7}nn�|dkrb|d7}nQ�|dkr�tr|dS|d7}n*�|dks�t�tr�dS|d7}|S( NRkRlRR�sblacklisted-installedR�sblacklisted-availableRm(RTRSR&(RiR�(Rh(s/usr/share/yum-cli/output.pyRn�s     s Mandatory Groups:s Optional Groups:is s%s%ss Installed Groups:s N(R RwRRxt_groupInstalledEnvDataRKRzR{t allgroupsR4R}tgroupstoptionsR�R�R&( R tevgroupR�tgrp_nametall_grpsRnR�R�t grp_namesRr((Rhs/usr/share/yum-cli/output.pytdisplayGrpsInEnvironments�s4     c Cs(|jjtj�}x t|�D]�}td�|j�GHt||�dkrdtd�GHq"nx�t||�D]�}|||}td�t|�GH|s�td�GHquni}x^t t|��D]J}|j |j f}| r�||kr�q�n|||<d|j�GHq�WquWq"WdS(s�Format and output a list of findDeps results :param results: a list of package dependency information as returned by findDeps s package: %sis" No dependencies for this packages dependency: %ss Unsatisfied dependencys provider: %sN( R�RR RR�R R*R�RtreversedR�R�( R tresultsR�R�treqtreqlisttseentpoR�((s/usr/share/yum-cli/output.pyt depListOutput�s&   R�c Cs�ddddddddd g }|r0d }nd }d }d }t|�d}x0||kr�||kr�|d}||}qUWt|�td�ks�t|�td�kr�d} n|dkr�d} nd} | t|p�d �|||fS(sReturn a human-readable metric-like string representation of a number. :param number: the number to be converted to a human-readable form :param SI: If is 0, this function will use the convention that 1 kilobyte = 1024 bytes, otherwise, the convention that 1 kilobyte = 1000 bytes will be used :param space: string that will be placed between the number and the SI prefix :return: a human-readable metric-like string representation of *number* R�R�tMtGtTtPtEtZtYg@�@g�@i�iils%i%s%sgfffff�#@s%.1f%s%ss%.0f%s%s(R�ttypeR( R tnumbertSItspacetsymbolststeptthreshtdeptht max_depthtformat((s/usr/share/yum-cli/output.pyRs0    0   cCstjj||�S(s�Return a human-readable string representation of a number of seconds. The string will show seconds, minutes, and optionally hours. :param seconds: the number of seconds to convert to a human-readable form :param use_hours: If use_hours is 0, the representation will be in minutes and seconds. Otherwise, it will be in hours, minutes, and seconds :return: a human-readable string representation of *seconds* (RRt format_time(tsecondst use_hours((s/usr/share/yum-cli/output.pyR�1s c Cs>|jjdkr^|jjr^|jr^tjj|g|j�\}}}|sW|r^dSn|jjrwd|} nd|j |j f} |j | |j |j ��} |r�|dkr�|jj}n|j| ||dt�} n| GH|dkr|jjtj�}n|sdStd�|jGHt} x�tjj|�D]�} t| �} t|j �| ksHt|j �| kr�qHn| s�td�GHt} nt} tr�n1t|j�| kr�td�} |j | �} n�t|j�| krtd �} t} n�t|j�| kr:td �} t} n�| jd �rmtd �} |j | �} t} nwg}x1|j D]&}|d | kr}|j!|�q}q}W|r�td�} tjj"t#|�d �} n td�} |r|j| ||dt�} n| r(|j | t$| ��GHqH| | GHqHWdGHdS(s�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 RNs%s : s%s.%s : R{sRepo : %ss Matched from:sDescription : sURL : %ssLicense : %st/sFilename : %sisProvides : sOther : s (%RR&R$tquery_install_excludestcmdline_excludesR9R|t parsePackagestshowdupesfromreposR�R�R�RRR&tcolor_search_matchR�ROR�RR RR R�RSR:tuniqueRR!R�R R�tprovidesR�RR�R(R R�tvaluestmatchforRqR�tetmtuR�tdoneRit can_overflowR�tprovstprov((s/usr/share/yum-cli/output.pyt matchcallback@st $      *             cCs|j|||dt�S(sqOutput 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 Rq(R�RO(R R�R�R�((s/usr/share/yum-cli/output.pytmatchcallback_verbose�s c s\d}d}d}t}�fd�}x�|D]�}ywt|j�} || 7}y|j�rl|| 7}nWnnX|s�w.nyt|j�} WnnX|| 7}Wq.t}�jjtd��Pq.Xq.W|sX|r|td��j |��n||kr0|td��j ||��n|rX|td��j |��qXndS(s�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 icsg�jjtjj�r1�jjtj|�n2�jjsJ�jj rc�j j tj|�ndS(N( R�RR9R tINFO_1tlogR$tassumenot assumeyesR�twarn(R(R (s/usr/share/yum-cli/output.pyt _call_log�ss2There was an error calculating total download sizesTotal size: %ssTotal download size: %ssInstalled size: %sN( RSR�RR't installedsizeROR�R�R R( R R|t installonlyttotsizetlocsizetinsizeR�R�R�R((R s/usr/share/yum-cli/output.pytreportDownloadSize�sB      cCs�d}t}xR|D]J}yt|j�}||7}Wqt}|jjtd��PqXqW|s�|jjt j j �r�|jj t j td�|j |��q�|jjs�|jj r�|jjt j td�|j |��q�ndS(smReport the total size of packages being removed. :param packages: a list of package objects is-There was an error calculating installed sizesInstalled size: %sN(RSR�RROR�R�R R�RR9R R�R�RR$R�R�R�(R R|R�R�R�R((s/usr/share/yum-cli/output.pytreportRemoveSize�s&    c/ s��jjtt�g}iid6id6id6}d}g�fd�}�jj}i}�jjdkr9|r9g}x��jjD]�}t|d�r�d|jf}||kr�g||<n||j|�q�t|d �r%d |j f}||krg||<n||j|�q�|j|�q�Wnx�t |d d ��D]�\} } | d krvt d �} n t d�} | | j } || | f} g}x,| D]$}|||||j |j�}q�W|j| |f�qOWx�t d�|ft d��jjft d��jjft d��jjft d��jjft d��jjft d��jjft d��jjfgD]T\} } g}x,| D]$}|||||j |j�}q�W|j| |f�q�Wx�t d��jft d��jj�ft d��jj�fgD]K\} } g}x#| D]}|||||�}qNW|j| |f�q5W|ds�dS|di|d|dig}d|dddg}�j|ddd|d d!�}|\}}}}}|dkst�d"d#�jj�jt d$�| ft d%�| ft d&�| ft d'�| ft d(�|ffd)�d#�jjfg}x)|D]!\} }|r�d*| }nx�|D]�\}}}}}}}|| |f|| f|| f|| f||ff}�j|d)d+�} �j�jj �\}}xOt |�D]A} t d,�}!|!|| j!|| j"| j#�f;}!| |!} qTW|| }q�W|r�|j|�q�q�W|jt d-�d#�jj�t d.�t$�jj�t$�jj�ft d/�t$�jj�t$�jj�ft d0�t$�jj�t$�jj�ft d1�t$�jj�dft d2�t$�jj�dft d�t$�j�dft d�t$�jj��dft d�t$�jj��dff}"d}#d}$d}%d}&x�|"D]�\} }'}(|' rA|( rAqnt%d$d3|'�})t&| �}*t&t'|'��}+t&|)�},|(r�t&t'|(��}-nd}-t(|*|#�}#t(|+|$�}$t(|,|%�}%t(|-|&�}&qWx�|"D]�\} }'}(t%d$d3|'�})|(r�t%d4d5|(�}.|'red6} |j| t)| |#�|$|'t)|)|%�|&|(|.f�q�d7} |j| t)| |#�|$d8t)d8|%�|&|(|.f�q�|'r�d9} |j| t)| |#�|$|'|)f�q�q�Wd8j*|�S(:s]Return a string representation of the transaction in an easy-to-read format. RIR�tricsO|j\}}}}} |j�} |j} t|j�} �j| �} |dkr`d}n|jjdkr��j j }n'|j �r��j j }n �j j }|j||| | | ||f�xidt|�fdt| �fdt| �ffD]4\}}||j|d�|||cd7<q�Wt|t|��}|S(NtnoarchRRIR�R�ii(R=R�R�RRRR&RR&R$R)R'R(R%R�R�R_R(RJR�ta_widR�t obsoletesRItaR�R�R�tevrRtpkgsizeRthiR�(R (s/usr/share/yum-cli/output.pyt _add_line�s$      "@tobjectst_igroup_membertit_ugroup_memberR�R�cSs |djS(Ni(Rw(R((s/usr/share/yum-cli/output.pyR+#ss!Installing for group upgrade "%s"s!Installing for group install "%s"t InstallingtUpdatingtRemovingt Reinstallingt DowngradingsInstalling for dependenciessUpdating for dependenciessRemoving for dependenciessSkipped (dependency problems)s Not installeds Not availableuiiR�s RQR�iu %s %s %s R�tPackagetArchtVersiont RepositorytSizeu u%s: u s replacing %s%s%s.%s %s s Transaction Summary %s tInstalltUpgradetRemovet Reinstallt DowngradetPackagessDependent packagesDependent packagess%s %*d %s (+%*d %s) s%s %*s %s ( %*d %s) R<s %s %*d %s (+ttsInfot makelistsRORR$t group_commandRR�R�R�R�R RwR�R�tupdatedtremovedt reinstalledt downgradedt depinstalledt depupdatedt depremovedtskipped_packagest _not_found_iR�t _not_found_aR�RTR�RQR�R�R)R�R�R�R�R RR�RRtjoin(/R t pkglist_linesR�R�R�t ninstalledt ginstalledttxmbrR�R�tgrpR�tactiontpkglistRJR�RQtn_widtv_widtr_widts_widtoutttotalmsgRIR�R�RRR�R�R�R�tobspotappendedt summary_datatmax_msg_actiont max_msg_countt max_msg_pkgstmax_msg_depcountR�tdepcounttmsg_pkgstlen_msg_actiont len_msg_countt len_msg_pkgstlen_msg_depcountt msg_deppkgs((R s/usr/share/yum-cli/output.pytlistTransaction�s     "    "% "  (  ! &  "#  !'      c sd}�jj��fd�}x�td��jjftd��jjftd��jjftd��jjftd��jjftd��jjftd ��j ftd ��jj ftd ��jj fg D]$\}}g}t |�d kr�|d |7}xL|D]D}|j \}}} } } d||| | | f} |j| �qWx'dD]} ||| �}|rkPqkqkW|s��jjd g}nxY|r|t |� }|d7}|�jt||�dd�7}|t |�}q�Wq�q�W|S(s�Returns a human-readable summary of the results of the transaction. :return: a string containing a human-readable summary of the results of the transaction R<cst|�|krgS�jj|dd}|dkr>gSdg|}d}x|D]w}t|�||kr�t|�||}||kr�gS||8}t|�||<n|d7}|t|�;}qXWx>tt|��D]*}||c||7<||cd9<q�W|S(sb Work out how many columns we can use to display stuff, in the post trans output. iiii����(R�R�RQR�(tmsgstnumR�tcol_lenstcolR�R�(R (s/usr/share/yum-cli/output.pyt _fits_in_cols�s(      tRemovedsDependency Removedt InstalledsDependency InstalledtUpdatedsDependency UpdatedsSkipped (dependency problems)tReplacedtFailedis %s: s%s.%s %s:%s-%siiiiiiis Ruu (iiiiiii(R�R�R R�R�RR�R�R�R�t obsoletedtfailedR�R=R�R�RQR�R�(R RRRRRR�RIR�R�R�R�R�RRIt current_msgs((R s/usr/share/yum-cli/output.pytpostTransactionOutput�s> %    "cCs1|jjdks"tjj� r7d}d}d}n-tdtj�}tdtj�}t�}|j dif}|}|j }t |d�r�||j _ ||j _||j _||j _||j _ n?|jj||�||j_|jj|�|jj|�tt|��}||_dS(s`Set up the progress callbacks and various output bars based on debug level. itfot prerepoconfN((R$t debuglevelRVRWRXR&RR'tCacheProgressCallbackR�tinterrupt_callbackRR'R�tmulti_progressbartcallbacktfailure_callbacktrepostsetProgressBartsetFailureCallbacktsetInterruptCallbacktDepSolveProgressCallBacktweakreft dsCallback(R R�R+R,tfreportR-R*tdscb((s/usr/share/yum-cli/output.pytsetupProgressCallbacks�s,"        cCs|j�dS(s;This function is for API purposes only to protect the typo.N(R7(R ((s/usr/share/yum-cli/output.pytsetupProgessCallbacksscCsy|j}|j}|j}t|d�rQ||j_||j_||j_n$||j_||j_||j_dS(s7Set up callbacks to import and confirm gpg public keys.R'N( RYt getKeyForRepotgetCAKeyForRepoRR't confirm_functgpg_import_functgpgca_import_funcR.(R R;R<R=((s/usr/share/yum-cli/output.pytsetupKeyImportCallbacks s       cCs�d}td�}tj�}|js|jjd}|jjd}td�|||||f}|jjtj|�n||j|kr�t �n||_t dtd���dS( s Handle CTRL-C's during downloads. If a CTRL-C occurs a URLGrabError will be raised to push the download onto the next mirror. If two CTRL-C's occur in quick succession then yum will exit. :param cbobj: :class:`urlgrabber.grabber.CallbackObject` g@ttwoR:R1sZ Current download cancelled, %sinterrupt (ctrl-c) again%s within %s%s%s seconds to exit. isuser interruptN( R R�R�R�R?R�R�R tINFO_2tKeyboardInterruptR(R tcbobjtdelta_exit_chktdelta_exit_strR"R�R�R�((s/usr/share/yum-cli/output.pyR*/s     c CsGt|�dkrdSttjd�s,dStjjd�}|jjtjd|j ��t j �|}|dkr�d}n|j d|j |��}|j d |j ||jd k��}|j d�}|j d |j ||��} dttd�|j �|j ��| |||f} |jjtj| �dS(slOutputs summary information about the download process. :param remote_pkgs: a list of package objects that were downloaded :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 iNt TerminalLineiRmig{�G�z�?s | %5sBs %siPR�is %5sB/ss %s%s%s%s%stTotals (R�RRRRER�R�R R@trestR�RzRR�t_llenRR ( R t remote_pkgst remote_sizetdownload_start_timestampttltdl_timetui_sizetui_timetui_endtui_bsR�((s/usr/share/yum-cli/output.pytdownload_callback_total_cbPs    ( $cCsUt�}d}x||D]t}|j}|dkr:d}n|dkrOd}n|dkrdd}n|dkr|j|�|d 7}qqWt|�d ks�t�t|�d kr<itd �d6td�d6td�d6td�d 6td�d 6td�d6}|djgt|�D]}||^q"�fS|djt|��fS(Nis True-InstallR�s Dep-Installt Obsoletedt ObsoletingtUpdatetEraseR�R�iiRxtOR�tRtDtUs, R<(sInstallRURVs Reinstalls DowngradeRT( RKtstateRzR�RTR R�R�R4(R thpkgstactionsR�thpkgtstt large2smallR((s/usr/share/yum-cli/output.pyt_history_uiactionsls0               0c Csst|�tg�kr;g|D]}|j||�^qS|dksS|d kr�td�}td�d|}|dk r�t|�|kr�|}nt|�Sd�}y�tj|�}||jdd�}d ||j f}|dk rCt|�|krCd ||�|j f}t|�|krCd |j }qCnt|�SWnt k rntt |��SXdS( NI����i���s<unset>tSystemR�cWs!|j|�}|sdS|dS(sf Split gives us a [0] for everything _but_ '', this function returns '' in that case. R<i(R�(ttextRR((s/usr/share/yum-cli/output.pyt _safe_split_0�st;is%s <%s>s %s ... <%s>s<%s>(I����i���( R�RR&R R�Rtpwdtgetpwuidtpw_gecostpw_nametKeyErrorR�( R R"tlimitR�tloginidR�Rdtusertfullname((s/usr/share/yum-cli/output.pyR�s(#     cs��fd�}d|krdS|jdd�\}}||�}|�jkrVdS|dkrfdS||�}|�jkr�dS|dks�|dkr�dS||kr�||}}n||fS(s3 Convert a user "TID" string of 2..4 into: (2, 4). cs�y�|dks|jd�rv�j}|jd�rrt|td��}|dkretd�n||8}n|St|�SWntk r�dSXdS(Ntlastslast-itz(R�ttidR�R�RR&(RRqtoff(told(s/usr/share/yum-cli/output.pytstr2int�s     s..iiN(R&R�Rq(RsRqRttbtidtetid((Rss/usr/share/yum-cli/output.pyt_historyRangeRTIDs�s"     cCs�t�}d}x�t|�D]�}|d|kr`|jjtd|d|df��qn|d}x0t|d|dd�D]}|j|�q�WqW|S(su Convert a list of ranged tid typles into all the tids needed, Eg. [(2,4), (6,8)] == [2, 3, 4, 6, 7, 8]. i����is4Skipping merged transaction %d to %d, as it overlapsi(RKR�R�R�R R�Rz(R trtidsttidstlast_endtmtidR((s/usr/share/yum-cli/output.pyt_historyRangeTIDs�s ( "c CsZ|jj�}|dkr5|jjtd��dSt�}g}|d}t}|r�t}|ddkr�|j d�q�nx�|D]y}yt |�|j |�Wq�t k r|j ||�}|r�|j|j|g��q�n|j|�q�Xq�W|r)|j|jj|��n| rP|rP|jjtd��dS||fS(NsNo transactionsiitalls)Bad transaction IDs, or package(s), given(NN(NN(thistoryRoR&R�tcriticalR RKRSROR�R�RzRRwRR|R�tsearch( R textcmdsRsRytpatstusertidstprintallRqtrtid((s/usr/share/yum-cli/output.pyt_history_list_transactions�s8       c Cs|j|�\}}|d(krA|s4ddgfSddgfSd}|rVd(}n|jj|d|�}d}|jjdkr�ddg}n�|jjd kr�dg}n�|jjd ks�t�t�}d}x[|D]S} | r�||kr�Pn|d7}| jd(kr$|d7}n|j | j �q�Wt |�dkrj||dkrj|j d �nd } t |�dkr�t d �} n t d�} | t t d�dd�t | dd�t t d�dd�t t d�dd�t t d�dd�fGHddGHd} d}x�|D]�} | rB||krBPn|d7}t |�dkrp| jpjd} n|j| j d�} tjdtj| j��} |j| j�\} }t | dd�} t |dd�}d}}| jd(krd}}nX| jrd}}nB| jr1d }}n,| jrGd!}}n| jr]d"}}n| jrod#}n| jr�d$}n| | j| | || fGd%||fGHq%W|jj�}|d(kr�|jd&t�n5|jj d't!�d}|j"|kr|j�nd(S()s)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 isNo accessible history to listisFailed history listiRktusersitcommandsssingle-user-commandstblahs%s | %s | %s | %s | %ss Command lines Login usertIDiis Date and timeis Action(s)itAlterediRmiOs%6u | %s | %-16.16s | %s | %4uR<s%Y-%m-%d %H:%MR�R t#R�R�RR8R7s%s%sR�t main_onlyN(#R�R&R~RsR$thistory_list_viewRTRKtcmdlineRztloginuidR�R RRR�R�R�t beg_timestampRat trans_datat return_codetoutputtrpmdb_problemst trans_skiptaltered_lt_rpmdbtaltered_gt_rpmdbRqRot_rpmdb_warn_checksRSRZt simpleVersionROtend_rpmdbversion(R R�RyR�Rktold_tidsR�tuidstblanksRstfmtR�ttmRtuiactstrmarktlmarktlastdbvtrpmdbv((s/usr/share/yum-cli/output.pythistoryListCmd�s�          "                   - c Cs�t|�dkr,|jjtd��dSg}d}x8|dD],}y�|dksg|jd�r|dkr�t}|jjd|�}|dkr�t d�q�n|j }|jd�r�t |td��}|dkr�t d�n||8}n|j t |��wCnt |�dkr6t d�n|j |�WqCt k rn|jjtd ��dSXqCW|jj|�}|s�|jjtd ��dS|S( NisNo transaction ID giveniRoslast-tcomplete_transactions_onlyRpisBad transaction ID givensNot found given transaction ID(R�R�RR R&R�RSR~RoR�RqR�R�RRs( R R�RyRotextcmdtctoRqRrRs((s/usr/share/yum-cli/output.pyt_history_get_transactions_s@         cCsR|j|�}|dkrdSt|�dkrJ|jjtd��n|dS(Nis#Found more than one transaction ID!i(R�R&R�R�RR (R R�Rs((s/usr/share/yum-cli/output.pyt_history_get_transaction�s  cCs�d�}t�}t�}g}|jj�}|d kr_|jjtd��ddgfSx{|dD]o}|j||�r�|j|j||��qjn+||�d k r�|j||��qjn|j |�qjW|r�|j |jj |��n|j �}|r6t |�}|j |j|��n| r�t|�dkr�|jjdt�}|d k r�|j|j�|j|j�q�n|s�|jjtd��ddgfS|jj�} | d k r�| j} | j} nt} d\} } d }|r%|jd �\} } nx�|jj|�D]o}| d k r�|j| kr�|jjd t�d }| |kr�t|_q�nd } |j| kr�|j| kr�|d kr�tjj|�}qm|j|�n�|d k rm| rd d GHnt} |j|�d }|rm|jd �\} } |j| krj|j| krjtjj|�}qjqmn|j|kr8| r�d d GHnt} |j||�q8q8W|d k r�| r�d d GHn|j|�nd S(sOutput 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 cSs'yt|�SWntk r"dSXdS(N(R�RR&(R((s/usr/share/yum-cli/output.pyRt�s sNo transactionsisFailed history infoiR�s$No transaction ID, or package, giveni����iR�RmiON(i����i����(RKR~RoR&R�RR RwRzR�RR�tcopyR�R|R�RSRqR�R�RsRZR�ROR�R9tYumMergedHistoryTransactiontmerget_historyInfoCmd(R R�RtRytmtidsR�RsRqtutidsR�tlasttidR�tbmtidtemtidtmobjR�((s/usr/share/yum-cli/output.pythistoryInfoCmd�s�                     cCspd|jkr|jS|jj|j�}|se|jj|j�}|sPdSdt|dj�S|djS(sn Given a pkg, find the ipkg.ui_from_repo ... if none, then get an apkg. ... and put a ? in there. R t?s@?i(RR�RZtsearchPkgTupleR=R\R�R(R R^RaRb((s/usr/share/yum-cli/output.pyt_hpkg2from_repo�sc s��j|j�}itd�d6td�d6td�d6td�d6�itd�d6td �d6td �d6td �d6�tg�j��j�D]}t|�^q��}|�d <|�d <ttd t����fd�}t|j �tg�kr8td�Gd|j d |j dfGHntd�G|j GHt j |j �}td�G|GH|j dk r�|jr�td�G|j GdGHq�td�G|j GHn|jdk rt j |j�}|j�} |j| d �r{|j�} d } x`tt| ��D]L} | t| �kr2Pn| | | | krJPn| t| | �d7} qWd| || }n|j|j } | d=kr�td�| } nZ| d?kr�td�| d} n7| dBkr�td�| dC} ntd�| dE} td�G|G| GHn|jdk r`|jrKtd�G|jGdGHq`td�G|jGHnt|�tg�kr�x/|D]}td �G|GHqWntd �G|GHt|j�tg�kr6|j}|d dkrtd!�GdGtd"�GdGH|d}n|r�td!�Gtd#�Gd$j|�GHq�nl|jdkretd!�GdGtd"�GdGHn=|jr�td!�Gtd%�G|jGHntd!�Gtd&�GH|jdk rt|j�tg�kr�x5|jD]}td'�G|GHq�Wqtd'�G|jGHnt|j �tg�kr��jj|j �}td(d)d*g�}t|�j|�}t|�d kr�td+t|��GHq�n|jr�td,�GHtd-�|jD��}nx*|jD]�|�d.d/td0|�q�Wtd1�GH�j||�|jr6td2�GHtd3�|jD��}nx*|jD]�|�d.d0|d4t�q@W|j rztd5�GHnx�|j D]�}d6dF|j!f}�j"||j#�GH|j$r�td7�|j$D��}nx3|j$D](�|�d8d/td9�j%d0|�q�Wq�W|j&rXtd:�GHd }x+|j&D]}|d7}d;|G|GHq4Wn|j'r�td<�GHd }x+|j'D]}|d7}d;|G|GHq|WndS(GNRR�tErasedR�Rtot DowngradedRIs Not installedtOldertNewertmaxlenic sLd|}|r�}n�}|d}�jj�jg�} | j�| s^|d}nh�jd�| D�krznL| d�kr�|d}n/| d�kr�|d}nts�td ��|r��jd �\} } n�jd �\} } t||d �}d } |r*�j ��} nd|| || |�| fGHdS(NR�R�R�css|]}|jVqdS(N(R=(R�Re((s/usr/share/yum-cli/output.pys <genexpr> si����R�iRIs-Impossible, installed not newer and not olderR:R1R�R<s%s%s%s%s %-*s %s( RZR[R�tsortR=RSRTR�RR�( R�t prefix_lent was_installedR�t pkg_max_lent show_repoR�t _pkg_statesR[RaR�R�tui_repo(t_pkg_states_availablet_pkg_states_installedR^R (s/usr/share/yum-cli/output.pyt _simple_pkg s2       sTransaction ID :s%u..%ui����sBegin time :sBegin rpmdb :s**iR�ii<s (%u seconds)s (%u minutes)is (%u hours)s (%u days)sEnd time :sEnd rpmdb :sUser :sReturn-Code :tAborteds Failures:s, sFailure:tSuccesssCommand Line :s config-mains config-repostsaved_txs-Additional non-default information stored: %dsTransaction performed with:css!|]}tt|��VqdS(N(R�R�(R�R^((s/usr/share/yum-cli/output.pys <genexpr>v siR�R�sPackages Altered:sPackages Skipped:css!|]}tt|��VqdS(N(R�R�(R�R^((s/usr/share/yum-cli/output.pys <genexpr>~ sR�sRpmdb Problems:s%s%s: css!|]}tt|��VqdS(N(R�R�(R�R^((s/usr/share/yum-cli/output.pys <genexpr>� siR�sScriptlet output:s%4dsErrors:i,i,iPFi,iPFi��iii�Qs ((RR�R RR�R�RSROR�RqR�RR�tbeg_rpmdbversionR&R�t end_timestampR�R�R�R�R�R�R�R�R~treturn_addon_dataRKt differencet trans_withthistoryInfoCmdPkgsAlteredR�R�tproblemR�RcR|tmainR�terrors(R RsR�R�RR�R�tbegtmtendtmtendtmstbegtmstsofarR�R�tcodesR�t addon_infotdefault_addonst non_defaultR�tprobR�Rtline((R�R�R^R s/usr/share/yum-cli/output.pyR��s�&  *          (               R�s True-Installs Dep-InstallRSRTRVR�R�R�RURcCsed }|j}d}d}xw|jD]l}|j|j|j�}|t|�krdt|�}n|tt|��kr%tt|��}q%q%Wx�|jD]�}d} |js�d} nd} |rtj j |g|�\} } } | s�| rd} qn|j | �\}}|j }|j|j|j�}t ||�}trPn�|d k r�|jdkr�|j|jkr�|jdkr�t|j�d }d|||}n�|d k r|jd kr|j|jkr|jd krt|j�d }d|||}nd }|jdkr6|}nd | ||||||j|�fGHq�Wd S(s/Print information about how packages are altered in a transaction. :param old: the :class:`history.YumHistoryTransaction` to print information about :param pats: a list of patterns. Packages that match a patten in *pats* will be highlighted in the output iR�is ** R1R:RRUiR�R�s%s%s%s%s %-*s %sNs (sUpdateds Downgrade(R&t_history_state2uistateR�R>R[R�R�R�R9R|R�R�tui_nevraRRSR�R�(R RsR�Rot all_uistatesR�R�R^tuistateR�R�RR�R�R�R�tcntln((s/usr/share/yum-cli/output.pyR�� sR   !    ! ! c Cs8|j|�\}}|d$kr.ddgfSd}|ttd�dd�ttd�dd�ttd�d d �ttd �d d �fGHd d GHd}iid6id6id6id6id6id6id6}x|jj|�D]�}|j|jd�}d}tj�} t r n�|j | d&kr<d}n�|j | d)krXd}np|j | d,krtd}nT|j | d0kr�d}n8|j | d4kr�d}n|j | d7kr�d}n||j |g�j |�q�Witd�d6td�d6td�d6td�d6td �d6td!�d6td"�d6} d#} x�d8D]�}||smqWnx�t ||�D]�}| r�| dkr�Pn| d7} g} x&|||D]}| j|j�q�W|j| �\} }| |}|t|dd�t|dd�t|d d �| fGHq~WqWWd$S(9srPrint a summary of transactions in history. :param extcmds: list of extra command line arguments isFailed history infos%s | %s | %s | %ss Login useritTimeis Action(s)iR�iRmiOs%s | %s | %s | %8utdaytweekt fortnighttquarterthalftyearR}ii<iii imsLast days Last weeks Last 2 weekss Last 3 monthss Last 6 monthss Last yearsOver a year agoiNi�i�Qi�i�Qi�: i�i�Qiui�i�Qi�: i��wi�i�Qi�: i��i�i�Qi�3�(R�R�R�R�R�R�sall(R�R&RR R~RsRR�R�RSR�R_R�R�R�R�Ra(R R�RyR�R�R�RsR�tperiodR"t _period2userR�R\R�R�tuperiod((s/usr/share/yum-cli/output.pythistorySummaryCmd� sp          !         cCsEd}t|�dkr:|d}|dkr:d}q:n|dk r�yt|�Wq�tk r�|jjtd��ddgfSXn|dk r�|jjd|g�}nK|jj dt �g}|ddkr�|jjtd��ddgfS|s*|jjtd �|�ddgfS|d}|jj |j �}t|�d kr�td �G|j GHtd �GHx&|jj |j �D]}d |GHq�WdGHddgfSx�|d D]}||kr|j jtjd|�|jj |j |�G|j jtjd�ntd�|GH|j jtjd�q�WdS(s|Print addon information about transaction in history. :param extcmds: list of extra command line arguments iRosBad transaction ID givensFailed history addon-infoRyR�is$No transaction ID, or package, givensNo Transaction %s foundisTransaction ID:s)Available additional history information:s %sR<shistory addon-infos%s:s)%s: No additional data found by this nameN(R&R�R�RR�RR R~RsRoRSR�RqR�R�R R@(R R�RqRst hist_dataR�titemnameRi((s/usr/share/yum-cli/output.pythistoryAddonInfoCmd$ sH             cCs�|jj|�}d }|rH| rH|jjtd��ddgfS|sWd}n|j}d}|ttd�dd�ttd�d d �ttd �d d �fGHd d GHd}d}x�|jj|d|�D]�}|d k r|r|t |j �|krPnd }d} } |j d kr=d} } nX|j rSd} } nB|j rid} } n,|j rd} } n|jr�d} } n|jr�d} n|jr�d} nx�|j D]�} |d kr tjj| g|�\} } }| r | r q�q n|j| j| j�}t|d �}| j}trFn�|d k r�|jdkr�|j| jkr�| jdkr�t | j�d}d|||}n�|d k r|jdkr|j| jkr| jdkrt | j�d}d|||}nd }| jd!kr,| }n|d7}||j||fGd| | fGHq�Wq�W|jj�}|d kr�|jdt�n5|jjdt�d}|j|kr�|j�nd S("s�Print a list of information about transactions from history that involve the given package or packages. :param extcmds: list of extra command line arguments s)Bad transaction IDs, or package(s), givenisFailed history packages-listis %s | %s | %sR�is Action(s)iR�i5RmiOs%6u | %s | %-50siRkR�R R�R�R�RR8R7RRUR�R�s%s%sR�R�N(sUpdateds Downgrade( R~R�R&R�RR R�RRsR�R�R�R�R�R�R�R�R9R|R�R>R[R�RSR�RqRoR�RZR�ROR�(R R�RyRkR�R�RRsRoR�R�R^RR�R�R�R�R�R�R�((s/usr/share/yum-cli/output.pythistoryPackageListCmdU s�     +               !   ! !  + c Cs�|jj|�}d}|rH| rH|jjtd��ddgfS|sWd}n|j}d}x�|jj|d|�D]�}|dk r�|r�|t|j �|kr�Pnx�|j D]�}|dkrt j j |g|�\}} } | r| rq�qn|j |j|j�} |r.dGHntd�G|jGHtj|j�} td �G| GHtd �G|jGHtd �G| GH|jdk r�t|j�}td �Gtjd |t�GHn|jdk r�td�G|jGHn|jdk rtjt|j��} td�G| GHn|jdk rBtd�G|jGHn|jdk rftd�G|jGHn|jdk r�td�G|jGHn|jdk r�td�G|jGHn|jdk r�td�G|jGHn|j dk r tjt|j ��} td�G| GHn|j!dk r/td�G|j!GHn|j"j#dk rYtd�G|j"j#GHn|j"j$dk r�td�G|j"j$GHn|j"j%dk r�td�G|j"j%GHn|j"j&dk r�t|j"j&�} |j'| �}td�G|GHn|j"j(dk r7t|j"j(�} |j'| �}td�G|GHn|d7}q�WqW|jj)�}|dkrw|j*dt+�n5|j,j-dt�d}|j.|kr�|j*�ndS(s�Print information about packages in history transactions. :param extcmds: list of extra command line arguments s)Bad transaction IDs, or package(s), givenisFailed history packages-infoiiRkR<sTransaction ID :sBegin time :sPackage :sState :sSize :s%dsBuild host :sBuild time :sPackager :sVendor :sLicense :sURL :sSource RPM :sCommit Time :sCommitter :sReason :sCommand Line :sFrom repo :sInstalled by :sChanged by :R�R�N(/R~R�R&R�RR R�RsR�R�R9R|R�R>R[RqR�RR�R�RR�tlocaleR�ROt buildhostRtpackagertvendorR R�t sourcerpmRRRtreasont command_lineR R RR RoR�RSRZR�R�(R R�RyRkR�RRsR^RR�R�R�R�R"R�R�R�((s/usr/share/yum-cli/output.pythistoryPackageInfoCmd� s�    + ! ! ccsPxI|D]A}td�}dt|�d}||jdd|�fVqWdS(Ns Error: %sR�is (R RR�(trestringR�R�t prefix2nd((s/usr/share/yum-cli/output.pytpretty_output_restring s  N(CR#R$R%RnR�R�R�R&R�R�R�t staticmethodR�R�R�R�RR�RSR�R�R�RRR#R3RGR RWRYRfRjRsR�R�R�RR�R�R�R�R�RR%R7R8R>R*RRRaRRwR|R�R�R�R�R�R�R�R�R�R�R�R�R�R(((s/usr/share/yum-cli/output.pyR��s�       m 1     .&G)  2 I 9 0 P 4  � F (   !   !%  a $  d  �          < @ 1 [ UR2cBs�eZdZdd�Zd�Zd�Zd�Zd�Zd�Z d�Z d�Z d �Z d �Z d �Zd �Zd �Zd�Zd�ZRS(sQA class to provide text output callback functions for Dependency Solver callback.cCs(tjd�|_d|_||_dS(s8requires yum-cli log and errorlog functions as argumentssyum.verbose.cliiN(R�R�R�tloopstayum(R R((s/usr/share/yum-cli/output.pyRn s c Cs�itd�d6td�d6td�d6td�d6td �d 6td �d 6td �d6td�d6}|\}}}}}||} |jjtjtd�|||||| �dS(s�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 RR�s an updateR�terasedR�R�R�s a downgradeR�t obsoletingR�R�tudR"tods&---> Package %s.%s %s:%s-%s will be %sN(R R�R�R R@( R R=RgtmodedictRIR�R�R�R�tmodeterm((s/usr/share/yum-cli/output.pytpkgAdded s       cCs|jd7_dS(sRPerform setup at the beginning of the dependency solving process. iN(R(R ((s/usr/share/yum-cli/output.pytstart8 scCs |jjtjtd��dS(s?Output a message stating that a transaction check is beginning.s--> Running transaction checkN(R�R�R R@R (R ((s/usr/share/yum-cli/output.pyttscheck> scCsE|jd7_|jjtjtd��|jjd|j�dS(sBOutput a message stating that dependency resolution is restarting.is6--> Restarting Dependency Resolution with new changes.s---> Loop Number: %dN(RR�R�R R@R tdebug(R ((s/usr/share/yum-cli/output.pyt restartLoopB s cCs |jjtjtd��dS(sAOutput a message stating that dependency resolution has finished.s"--> Finished Dependency ResolutionN(R�R�R R@R (R ((s/usr/share/yum-cli/output.pyRuI scCs&|jjtjtd�||�dS(scOutput a message stating that the package *formatted_req* is being processed as a dependency for the package *name*. :param name: the name of the package that *formatted_req* is a dependency of :param formatted_req: a string representing the package that is being processed as a dependency of *name* s---> Processing Dependency: %s for package: %sN(R�R�R R@R (R R�t formatted_req((s/usr/share/yum-cli/output.pytprocReqO s  cCs&|jjtjtd�||�dS(sXOutput a message stating that the package *formatted_req* is being processed as a dependency for the package *po*. :param po: the package object that *formatted_req* is a dependency of :param formatted_req: a string representing the package that is being processed as a dependency of *po* s---> Processing Dependency: %s for package: %sN(R�R�R R@R (R R�R((s/usr/share/yum-cli/output.pyt procReqPo\ s  cCs&|jjtjtd�||�dS(stOutput a message stating that the given package will not be removed. This method is used during leaf-only group remove, leaf-only repo-pkg remove and normal remove commands to indicate that the package will be kept. :param po: the :class:`yum.packages.PackageObject` that will not be removed :param hits: unused s"---> Keeping package: %s due to %sN(R�R�R R@R (R R�tdeppothits((s/usr/share/yum-cli/output.pyt removeReqi s cCs#|jjtjtd�|�dS(s�Output a message stating that there is an unresolved dependency. :param msg: string giving information about the unresolved dependency s--> Unresolved Dependency: %sN(R�R�R R@R (R R�((s/usr/share/yum-cli/output.pyt unresolvedv sc s�|\�}}|j�d||jf}td�|f}t�||�}|td�|f7}�sq|Sd�������fd�}�����fd�} d�t��x/t�jj���D]} || |�}q�Wt�} xQt�j j���D]7} | | |�\} �}| r| j | j �qqWd�x/t�jj | ��D]} || |�}qmWd�x8t�j j | ��D]} | | |�\} �}q�W|S(s>Return an error message stating that a package required to fulfill a dependency is missing. :param reqPo: the package object that has a dependency that cannot be fulfilled :param reqTup: the name, flags, and version of the package needed to fulfil the dependency s%s (%s)s Package: %ss Requires: %sc Ss&td�|||jf}|dd f}t}x@|jd|�D],}t}|td�tjj|�7}qDW|s |j dd�}||kr xk|j D]]}|d}|j dd�}||kr�t}tjj|�}|td�|7}q�q�Wq n|s"|td�7}n|S( s? Add a package to the message, including any provides matches. s %s: %s (%s)R�s %st 0123456789is ~%ss Not foundN(NNN( R R�R&RSt matchingPrcosROR9R:Rt translateR�( RR�tneednameR�tneedtupR�R=t nneednameR�((s/usr/share/yum-cli/output.pyt_msg_pkg� s&$   !c s^|j|j|j|jf}|�ksK|j��rO|j�jkrO|S�j|�td�}�jj |j t �}|r�td�}n|�||��7}itd�d6td�d6td�d6}x|D]w}xn|j D]c\}}||kr q�n|j|j|j|jf}�j|�|�|||��7}q�Wq�W|S( NRR�s Updated Byt updatedbys Downgraded Byt downgradedbys Obsoleted Byt obsoletedby( R�R RRR?R�RzR R�tgetMembersWithStateR=tTS_REMOVE_STATESt relatedto( R�R�tnevrRtrmedtrelmapR�trpkgtrtype(RRoRt seen_pkgstyb(s/usr/share/yum-cli/output.pyt _run_inst_pkg� s(-      "cs�|j|j|j|jf}|�ksK|j��rX|j�jkrXt�|fS�j|�td�}�j j |j t �r�td�}n|�||��7}t ||fS(Nt AvailableR�(R�R RRR?R�RSRzR R�R R=tTS_INSTALL_STATESRO(R�R�R#R(RRoRR(R)(s/usr/share/yum-cli/output.pyt_run_avail_pkg� s-   N( RR�R R R&RKR�RZt getProvidesR\RzR�R[( R treqPotreqTupt needflagst needversiontprob_pkgR�tui_reqR*R-R�tavailable_namesttst((RRoRR(R)s/usr/share/yum-cli/output.pytformat_missing_requires� s6      cCs&|jjtjtd�||�dS(s Print a message stating that two packages in the transaction conflict. :param name: the name of the first package involved in the conflict :param confname: the name of the second package involved in the conflict s(--> Processing Conflict: %s conflicts %sN(R�R�R R@R (R R�tconfname((s/usr/share/yum-cli/output.pyt procConflict� s  cCs&|jjtjtd�||�dS(sPrint a message stating that two packages in the transaction conflict. :param name: the first package object involved in the conflict :param confname: the second package object involved in the conflict s(--> Processing Conflict: %s conflicts %sN(R�R�R R@R (R R�R8((s/usr/share/yum-cli/output.pytprocConflictPo� s  cCs |jjtjtd��dS(sEOutput a message stating that the transaction set is being populated.sC--> Populating transaction set with selected packages. Please wait.N(R�R�R R@R (R ((s/usr/share/yum-cli/output.pyttransactionPopulation scCs#|jjtjtd�|�dS(s�Output a message stating that the header for the given package is being downloaded. :param name: the name of the package s<---> Downloading header for %s to pack into transaction set.N(R�R�R R@R (R R�((s/usr/share/yum-cli/output.pytdownloadHeader sN(R#R$R%R&RnR R R RRuRRRRR7R9R:R;R<(((s/usr/share/yum-cli/output.pyR2 s   "     h R)cBs>eZdZd�Zd�Zd�Zd�Zdd�ZRS(sFA class to handle text output callbacks during metadata cache updates.cCs:tjd�|_tjd�|_tjd�|_dS(Nsyum.clisyum.verbose.clisyum.filelogging.cli(R�R�R�R�t file_logger(R ((s/usr/share/yum-cli/output.pyRn scCs|jj||�dS(s{Output a log message. :param level: the logging level for the message :param message: the message N(R�R�(R tleveltmessage((s/usr/share/yum-cli/output.pyR� scCs|jj||�dS(s�Output an errorlog message. :param level: the logging level for the message :param message: the message N(R�R�(R R>R?((s/usr/share/yum-cli/output.pyterrorlog" scCs|jj||�dS(s�Output a file log message. :param level: the logging level for the message :param message: the message N(R=R�(R R>R?((s/usr/share/yum-cli/output.pytfilelog* scCs�d}t}||}|dkr+t}n=|dkr@t}n(||krUt}n||sht}n|r�t|||�ndS(sGOutput the current status to the terminal using a progress status bar. :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 i�iN(RSROR�(R R�R�R�t num_outputsR�topc((s/usr/share/yum-cli/output.pyR�2 s         N( R#R$R%RnR�R@RAR&R�(((s/usr/share/yum-cli/output.pyR) s     c se|dkr|S|dkr%d}ng��fd�}x?|jjd |�D](}|j|krkqPn||j�qPW�s�|S�jd �}�s�t|�St}t}xA�D]9}|j|�s�t }n|j |j kr�t }q�q�W|rG|j d kr$d |j |j |jfSd |j |j |j |jfSn|rad|j |j fS|S(s� Get more information on a simple pkgname, if we can. We need to search packages that we are dealing with atm. and installed packages (if the transaction isn't complete). R�R�R�R�R�RRcsD�r3�dj|jkr3�dj|�r3dS�j|�dS(Ni(R�R?R�(R�(tmatches(s/usr/share/yum-cli/output.pyt _cond_add[ s/R�iRs%s-%s-%ss %s:%s-%s-%ss%s.%sN(R�R�R�R�R�sodsud(R&R�t matchNaevrtts_stateR�R�R�ROR?RSR�R R�RR( Rtpkgnamet ts_statesRER�tfmatchtshow_vert show_archRs((RDs/usr/share/yum-cli/output.pyt _pkgname_uiN s<       tYumCliRPMCallBackcBsteZdZed��Zdd�Zdd�Zd�Zd�Z d �Z d �Z e dd d �Z d �ZRS(s1A Yum specific callback class for RPM operations.cCst�S(N(R(R((s/usr/share/yum-cli/output.pyR+� scCsbtj|�td�|_d|_tjd�jt j �|_ d|_ d|_ ||_dS(NR<syum.verbose.cliR�i(RRnRtlastmsgR&t lastpackageR�R�RR R@R�tmarktmarksR(R R((s/usr/share/yum-cli/output.pyRn� s    R�RRcCst|j||�S(s�Return more information on a simple pkgname, if possible. :param pkgname: the name of the package to find information about :param ts_states: a tuple containing the states where the package might be found (RMR(R RHRI((s/usr/share/yum-cli/output.pyt pkgname_ui� sc Cs�|j|}|j�}t|�tjkr=t|�} n|j|�} ||_|dkrjd} n|d|} |j||||| || |�dS(s�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.RPMBaseCallback.action.keys()` :param te_current: a number representing the amount of work already done in the current transaction :param te_total: a number representing the total amount of work to be done in the current transaction :param ts_current: the number of the current transaction in transaction set :param ts_total: the total number of transactions in the transaction set ildN( Rt_max_action_widthR�ttypest StringTypesR�RSRPt _out_event( R tpackageRt te_currenttte_totalt ts_currenttts_totaltprocesstwid1RHtpercent((s/usr/share/yum-cli/output.pytevent� s     cCsit|d�s\d}x8|jj�D]'}t|�}||kr%|}q%q%W||_n|j}|S(Nt_max_action_wid_cachei(RRR�RRa(R R^Ritwid_val((s/usr/share/yum-cli/output.pyRT� s     c Cs�|jr�tjj�s$||kr�|j|||dtjj�d|d|�\} }} | t|||�t|| | �f} | |jkr�tjjt| ��tjj �| |_n||kr�dGHq�ndS(NRRHR^R�( R�RVRWRXt_makefmtRROtwriteRtflush( R RYRZR[R\R_R]RHR^R�twid2R�((s/usr/share/yum-cli/output.pyRW� s$   cCs0|r,tjjt|��tjj�ndS(s�Print messages originating from a package script. :param package: unused :param msgs: the messages coming from the script N(RVRWRdRRe(R RXR((s/usr/share/yum-cli/output.pyt scriptout� sicCs�tt|��}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�||jt||d �f}d |d| }| }nK|d kr�d| }|}n,||j|f}d|d| }| }|||fS(Ns%s.%st%ss/%Riiis[%-ss]ids %s: %s gY@s %s: %s R�s %s: %s s %s: %s (R�R�R&RR�RQR�(R R_R[R\RRHR^tlRtfmt_doneR�tpnltoverheadR�RRtfmt_bartfull_pnlR�Rftbar((s/usr/share/yum-cli/output.pyRc� sH             "    c Csw|}t|j�}d}td�}t|j�}tt|�|j��} |jdd|||||| �dS(sC Callback for post transaction when we are in verifyTransaction(). idt VerifyingN( R�R�R R�R�RRRTRW( R tbaseR�R�RYRZR_R]RHR^((s/usr/share/yum-cli/output.pyt verify_txmbr s N(R�sodsudN(R#R$R%R�R�R&RnRSR`RTRWRgRORcRr(((s/usr/share/yum-cli/output.pyRN s "  /c Csd}tjj�sdS|dkr.d}n%|dkrMt|�|}nd}t�}|dkr}||kr}d}nd||f}|t|�d8}|dkr�d}n|dkr |d8}|dkr�d}n|t||�}d|||f}n�||kr6d t|||�|f}n�|d 8}|dkrUd}n|d} | t |�kr�t |�} n|| 8}|t||�}d t|| | �|||f}||kr�tjj |�n||kr�tjj d �ntjj �dS( sIOutput 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�NiRms %d/%diis [%-*s]%ss %s%sis %s: [%-*s]%ss ( RVRWRXRRR&R�R�RRRdRe( R�R�R�RQR_R�RuthashbarR�tnwid((s/usr/share/yum-cli/output.pyR� sL                     t__main__iRR<s5 Doing format_number tests, right column should alignigg�������?g�?g�������?i i g333333&@idgfffff�[@i�iWii'ig+i��i?Biii#s%36s <%s> %s <%5s>R�iRs Doing progress, small nameietabcds Doing progress, big names_%s_s 123456789 is Doing progress, no names rpm-progresstfoos_12345678_.endRos! Doing CB, small proc / small pkgtspkgs Doing CB, big proc / big pkgtlpkgs-=is.ends i18n-progresssi18n-rpm-progresss! Doing progress, i18n: small names 正在安装s Doing progress, i18n: big names' Doing CB, i18n: small proc / small pkgs# Doing CB, i18n: big proc / big pkg(GR%RVR�R�RURRfR�RoR3Rturlgrabber.progressRRRturlgrabber.grabberRtyum.miscRtyum.i18nRRRR9trpmUtils.miscutilsRR t yum.constantsR R R t yum.rpmtransRtyum.packageSackRt yum.packagest yum.historyRRRR�RRTRRRR'R*R�R2R)R&RMRNR�R#R�targvRR�RRR�tsleeptcbROR�RR`R:t setup_locale(((s/usr/share/yum-cli/output.pyt<module>s                 �U���������b�< 1� > ( $*( .    (% .%   (