/usr/lib/python3.9/site-packages/dnf/__pycache__
NameSizeModeActions
base.cpython-39.opt-1.pyc816190644editdlrm
base.cpython-39.pyc818610644editdlrm
callback.cpython-39.opt-1.pyc37330644editdlrm
callback.cpython-39.pyc37330644editdlrm
comps.cpython-39.opt-1.pyc257750644editdlrm
comps.cpython-39.pyc262880644editdlrm
const.cpython-39.opt-1.pyc14380644editdlrm
const.cpython-39.pyc14380644editdlrm
crypto.cpython-39.opt-1.pyc68910644editdlrm
crypto.cpython-39.pyc68910644editdlrm
dnssec.cpython-39.opt-1.pyc92700644editdlrm
dnssec.cpython-39.pyc92700644editdlrm
drpm.cpython-39.opt-1.pyc53590644editdlrm
drpm.cpython-39.pyc53590644editdlrm
exceptions.cpython-39.opt-1.pyc72630644editdlrm
exceptions.cpython-39.pyc72630644editdlrm
goal.cpython-39.opt-1.pyc2590644editdlrm
goal.cpython-39.pyc2590644editdlrm
history.cpython-39.opt-1.pyc2860644editdlrm
history.cpython-39.pyc2860644editdlrm
i18n.cpython-39.opt-1.pyc96450644editdlrm
i18n.cpython-39.pyc96450644editdlrm
lock.cpython-39.opt-1.pyc41820644editdlrm
lock.cpython-39.pyc41820644editdlrm
logging.cpython-39.opt-1.pyc84460644editdlrm
logging.cpython-39.pyc85100644editdlrm
match_counter.cpython-39.opt-1.pyc41380644editdlrm
match_counter.cpython-39.pyc41380644editdlrm
package.cpython-39.opt-1.pyc102570644editdlrm
package.cpython-39.pyc102570644editdlrm
persistor.cpython-39.opt-1.pyc42410644editdlrm
persistor.cpython-39.pyc42410644editdlrm
plugin.cpython-39.opt-1.pyc90640644editdlrm
plugin.cpython-39.pyc90640644editdlrm
pycomp.cpython-39.opt-1.pyc30160644editdlrm
pycomp.cpython-39.pyc30160644editdlrm
query.cpython-39.opt-1.pyc8680644editdlrm
query.cpython-39.pyc8680644editdlrm
repo.cpython-39.opt-1.pyc224290644editdlrm
repo.cpython-39.pyc224290644editdlrm
repodict.cpython-39.opt-1.pyc56340644editdlrm
repodict.cpython-39.pyc56340644editdlrm
sack.cpython-39.opt-1.pyc22990644editdlrm
sack.cpython-39.pyc22990644editdlrm
selector.cpython-39.opt-1.pyc2670644editdlrm
selector.cpython-39.pyc2670644editdlrm
subject.cpython-39.opt-1.pyc3020644editdlrm
subject.cpython-39.pyc3020644editdlrm
transaction.cpython-39.opt-1.pyc16730644editdlrm
transaction.cpython-39.pyc16730644editdlrm
transaction_sr.cpython-39.opt-1.pyc173450644editdlrm
transaction_sr.cpython-39.pyc173450644editdlrm
util.cpython-39.opt-1.pyc231260644editdlrm
util.cpython-39.pyc231810644editdlrm
__init__.cpython-39.opt-1.pyc5440644editdlrm
__init__.cpython-39.pyc5440644editdlrm
Edit: /usr/lib/python3.9/site-packages/dnf/__pycache__/i18n.cpython-39.pyc (9645B)
a ©!c!0ã@sîddlmZddlmZddlmZddlZddlZddlZddlZddl Z ddl Z Gdd„de ƒZ dd„Z d d „Zd d „Zd d„Zdd„Zdd„Zdd„Zd'dd„Zdd„Zd(dd„Zd)dd„Zd d!„Zd"d#„Zd$d%„Zed&ƒ\ZZeZdS)*é)Úprint_function)Úunicode_literals)ÚunicodeNc@s$eZdZdd„Zdd„Zdd„ZdS)Ú UnicodeStreamcCs||_||_dS©N)ÚstreamÚencoding)Úselfrr©r ú,/usr/lib/python3.9/site-packages/dnf/i18n.pyÚ__init__$szUnicodeStream.__init__cCsžt|tƒs.tjjr | |jd¡n | |jd¡}z|j  |¡WnZt y˜| |jjd¡}t |jdƒrx|jj   |¡n| |jjd¡}|j  |¡Yn0dS)NÚreplaceÚbackslashreplaceÚbufferÚignore) Ú isinstanceÚstrÚdnfÚpycompÚPY3ÚdecoderÚencoderÚwriteÚUnicodeEncodeErrorÚhasattrr)r ÚsZs_bytesr r r r(s  ÿ  zUnicodeStream.writecCs t|j|ƒSr)Úgetattrr)r Únamer r r Ú __getattr__7szUnicodeStream.__getattr__N)Ú__name__Ú __module__Ú __qualname__r rrr r r r r#srcCs0|dur dS| ¡}| d¡s(| d¡r,dSdS)a‘Return true if encoding can express any Unicode character. Even if an encoding can express all accented letters in the given language, we can't generally settle for it in DNF since sometimes we output special characters like the registered trademark symbol (U+00AE) and surprisingly many national non-unicode encodings, including e.g. ASCII and ISO-8859-2, don't contain it. NFzutf-Zutf_T)ÚlowerÚ startswith)rr"r r r Ú_full_ucd_support:s r$cCst d¡}| d¡rdS|S)z= Take the best shot at the current system's string encoding. FZANSIzutf-8)ÚlocaleÚgetpreferredencodingr#)rr r r Ú_guess_encodingKs r'c Cs–ztj tjd¡Wn|tjy�ztj tjd¡dtjd<Wn.tjyptj tjd¡dtjd<Yn0td  tjd¡t j d�Yn0dS)NÚzC.UTF-8ÚLC_ALLÚCz&Failed to set locale, defaulting to {})Úfile) rrÚ setlocaler%r)ÚErrorÚosÚenvironÚprintÚformatÚsysÚstderrr r r r Ú setup_localePsÿr4cCs^tj}| ¡st tjtj¡z |j}Wnty>d}Yn0t|ƒsZt |t ƒƒt_dSdS)z½ Check that stdout is of suitable encoding and handle the situation if not. Returns True if stdout was of suitable encoding already and no changes were needed. NFT) r2ÚstdoutÚisattyÚsignalÚSIGPIPEÚSIG_DFLrÚAttributeErrorr$rr')r5rr r r Ú setup_stdout^s   r;cCst|dd�tj ¡S)z› It uses print instead of passing the prompt to raw_input. raw_input doesn't encode the passed string and the output goes into stderr r()Úend)r0rrZ raw_input)Zucstringr r r Ú ucd_inputrs r=cCs”tjjr:tj |¡r$t|tƒdd�St|tƒr2|St|ƒSt|tjjƒrL|St|dƒrxztj |¡WSt yvYn0tjjt|ƒtƒdd�SdS)zD Like the builtin unicode() but tries to use a reasonable encoding. r)ÚerrorsZ __unicode__N) rrrZ is_py3bytesrr'rrrÚ UnicodeError)Úobjr r r Úucd}s    rAcCst |¡dvrdSdS)N)ÚWÚFéé)Ú unicodedataZeast_asian_width)Zucharr r r Ú_exact_width_char˜srGcCsV|durt|ƒ|fSd}d}|D],}t|ƒ}|||kr<qN||7}||7}q ||fS)a' Return the textual width of a Unicode string, chopping it to a specified value. This is what you want to use instead of %.*s, as it does the "right" thing with regard to different Unicode character width Eg. "%.*s" % (10, msg) <= becomes => "%s" % (chop_str(msg, 10)) Nrr()Ú exact_widthrG)ÚmsgÚchopÚwidthZ chopped_msgÚcharZ char_widthr r r Úchop_strœs   rMcCstdd„|DƒƒS)zQ Calculates width of char at terminal screen (Asian char counts for two) css|]}t|ƒVqdSr)rG)Ú.0Úcr r r Ú ³ózexact_width..)Úsum)rIr r r rH°srHTr(cCsjt||ƒ\}}||kr0|s|rfd |||g¡}n6d||}|rTd ||||g¡}nd ||||g¡}|S)aµ Expand a msg to a specified "width" or chop to same. Expansion can be left or right. This is what you want to use instead of %*.*s, as it does the "right" thing with regard to different Unicode character width. prefix and suffix should be used for "invisible" bytes, like highlighting. Examples: ``"%-*.*s" % (10, 20, msg)`` becomes ``"%s" % (fill_exact_width(msg, 10, 20))``. ``"%20.10s" % (msg)`` becomes ``"%s" % (fill_exact_width(msg, 20, 10, left=False))``. ``"%s%.10s%s" % (pre, msg, suf)`` becomes ``"%s" % (fill_exact_width(msg, 0, 10, prefix=pre, suffix=suf))``. r(ú )rMÚjoin)rIÚfillrJÚleftÚprefixÚsuffixrKZextrar r r Úfill_exact_width¶s rYéFcsćfdd„‰| d¡}| dd¡ d¡}g}|}d}d}d} |D�]`} |  d¡} || } } ˆ| ƒ\}} d} |rv| rvd } |rŠ|t| ƒkrŠd } |r¦| s¦|d kr¦|| kr¦d } | rÂ| | d¡¡|}d}|t| ƒkrÒd } |rä|  d¡} | } t|| ƒ|k�rd}| || ¡|}q@d }|  d¡}|} | }|�s8|d k�r8|}|D]V}|t| |ƒk�r€t| ƒt|ƒk�r€| |  d¡¡|d|} | |7} | d7} �q<|  d¡d}q@|�rº| | d¡¡d |¡S) zq Works like we want textwrap.wrap() to work, uses Unicode strings and doesn't screw up lists/blocks/etc. cs˜d}d}|D]}|dkrq&|d7}q |dvr6|dfSt||d…dƒd}|dvr�ˆ||t|ƒd…ƒ}|dpz|d}|r�||d|fS|dfS)NrÚXrSrE)ú-Ú*Ú.Úoõâ)r\r]r^r_u•u‣u∘)rMÚlen)ÚlineÚcountZbyteZlist_chrZnxt©Ú_indent_at_begr r reÜs z%textwrap_fill.._indent_at_begÚ ú z FrrSTér()Úrstripr ÚsplitraÚappendÚlstriprHrT)ÚtextrKÚinitial_indentÚsubsequent_indentÚlinesÚretÚindentZ wrap_lastZcsabZ cspc_indentrbZlsabZ lspc_indentZforce_nlÚwordsZspcsZwordr rdr Ú textwrap_fillØsh         ÿ  rtcCsHt|ƒ}t|ƒ}||kr|S||kr4||kr0|S|S||kr@|S|SdS)aÐ Automatically selects the short (abbreviated) or long (full) message depending on whether we have enough screen space to display the full message or not. If a caller by mistake passes a long string as msg_short and a short string as a msg_long this function recognizes the mistake and swaps the arguments. This function is especially useful in the i18n context when you cannot predict how long are the translated messages. Limitations: 1. If msg_short is longer than width you will still get an overflow. This function does not abbreviate the string. 2. You are not obliged to provide an actually abbreviated string, it is perfectly correct to pass the same string twice if you don't want any abbreviation. However, if you provide two different strings but having the same width this function is unable to recognize which one is correct and you should assume that it is unpredictable which one is returned. Example: ``select_short_long (10, _("Repo"), _("Repository"))`` will return "Repository" in English but the results in other languages may be different. N)rH)rKZ msg_shortZmsg_longZ width_shortZ width_longr r r Úselect_short_long'srucCs2tƒdd„}tjjj|dd�}t|tj |¡ƒS)z< Easy gettext translations setup based on given domain name cs ‡fdd„S)Ncs tˆ|ŽƒSr)rA)Úw©Zfncr r ÚTrQz2translation..ucd_wrapper..r rwr rwr Ú ucd_wrapperSsz translation..ucd_wrapperT)Úfallback)r4rrÚgettextÚ translationÚmapZ gettext_setup)rryÚtr r r r|Nsr|cCs(t|tdƒ|ƒ}d|vr |S|SdS)Nrhú)Ú_Úchr)ÚcontextÚmessageÚresultr r r ÚpgettextYsr…r)N)NTr(r()rZr(r()Z __future__rrZ dnf.pycomprrr%r.r7r2rFÚobjectrr$r'r4r;r=rArGrMrHrYrtrur|r…r€ZP_ZC_r r r r Ús2      " O'