[c@sFdZdZdZddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dddddddddddddddddddddddddddddddfZdZdZdZdZddZ de dddZ dZ dZ ddddZdZdddZddZdddZdZdZdZyuddkZeidde ZeiZeiZddkZeieijoeidde ie_nWneZeZnXedjo(ddkZdZ d GHxei!d D]Z"e e"qBWd GHxHei!d D]9Z"yee"Z"Wne#j o qinXe e"qiWe$ei!d jod GHe ei!d ei!d dGHy+eei!d e%eei!d Z"Wn e#j oei&dnXe e"qBndS(cCs t|S(sD Dummy Translation wrapper, just returning the same string. (t to_unicode(tstr((s,/usr/lib/python2.6/site-packages/yum/i18n.pyt dummy_wrapperscCs|djo|S|SdS(s] Dummy Plural Translation wrapper, just returning the singular or plural string. iN((tstr1tstr2tn((s,/usr/lib/python2.6/site-packages/yum/i18n.pytdummyP_wrappers cCsd}t|d}|||djp|||djotSxj||jo\||d}|||djo|d}qH|||djo|d}qHtSqHWtS(s9 auxiliary function for binary search in interval table. iii(tlentFalsetTrue(tucsttabletmintmaxtmid((s,/usr/lib/python2.6/site-packages/yum/i18n.pyt__utf8_bisearchBs*  iioiiiiiiiiiiiiiiiiiKi^ipiiiiiiiii0iJiiiii i i< iA iH iM iQ iT ib ic i i i i i i i i i i< iA iB iG iH iK iM ip iq i i i i i i i i i i i i< i? iA iC iM iV i i i i> i@ iF iH iJ iM iU iV i i i i i i i iA iC iM i i i i i1i4i:iGiNiiiiiiiiii5i7i9iqi~iiiiiiiiii-i0i2i6i7i9iXiYi`ii_iii2i4iRiSirisiiiiiiiii i ii i"i'i(i2i9i;iiiii4i6i:i<iBikisiiiii i i* i. i` ic ij io i i i*0i/0i0i0ii i%i&iiii i#iiii i i i i i i8 i: i? igiiisiiiiiiBiDii iiicCs|djodS|djp|djo|djodSt|todSd|djo|djp|d jp|d jp|d jo|d jo |d jp|djo |djp|djo |djp|djo |djp|djo |djpe|djo |djpK|djo |djp1|djo |djp|djo |djS(s+ Get the textual width of a ucs character. ii iiiiii_i)#i*#i.iϤi?0iiiiiii0ioii`iiiiii(Rt __combining(R ((s,/usr/lib/python2.6/site-packages/yum/i18n.pyt__utf8_ucp_widths( '   ccs&xt|D]}t|Vq WdS(N(tto_utf8tord(tmsgtbyte((s,/usr/lib/python2.6/site-packages/yum/i18n.pyt__utf8_iter_intss ccst|}xp|D]h}|djo|dfVq|d@djoW|i}|d@djp|d@djo dVdS|d@d>|d @BdfVq|d @djo|i}|i}|d@djpx|d@djpg|djo|d@djpI|d jo|d@d jp+|d jo(|djo|d@djo dVdS|d@d>|d @d>B|d @BdfVq|d@d jo|i}|i}|i}|d@djpg|d@djpV|d@djpE|d jo|d @djp'|djo |djp |djo dVdS|d@d>|d @d>B|d @d>B|d @BdfVqdVdSqWdS(Niiiiiiiii?iiiiiiiii iiiiii(Ni(Ni(Ni(Ni(RtnexttNone(Rtuitertbyte0tbyte1tbyte2tbyte3((s,/usr/lib/python2.6/site-packages/yum/i18n.pyt__utf8_iter_ucssN     "    7cCsRd}xEt|D]7\}}|djo||7}q|t|7}qW|S(s) Get the textual width of a utf8 string. iN(RRR(RtretR tbytes((s,/usr/lib/python2.6/site-packages/yum/i18n.pyt utf8_widths  cCs|djpt||jot||fSd}t|t}d}t|}x~t|D]p\}}|djo |}n t|}|dj o |||jo|| }Pn||7}||7}qeW|ot|}n||fS(s Return the textual width of a utf8 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 utf-8 sequences. Eg. "%.*s" % (10, msg) <= becomes => "%s" % (utf8_width_chop(msg, 10)) iN(RR!t isinstancetunicodeRRRR(RtchopRtpassed_unicodet msg_bytesR R twidth((s,/usr/lib/python2.6/site-packages/yum/i18n.pytutf8_width_chops&        tc Cs|}t||\}}||jo.|p|odi|||g}qnPd||}|odi||||g}ndi||||g}t|to t|S|S(s Expand a utf8 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 utf-8 sequences. prefix and suffix should be used for "invisible" bytes, like highlighting. Eg. "%-*.*s" % (10, 20, msg) <= becomes => "%s" % (utf8_width_fill(msg, 10, 20)). "%20.10s" % (msg) <= becomes => "%s" % (utf8_width_fill(msg, 20, 10, left=False)). "%s%.10s%s" % (prefix, msg, suffix) <= becomes => "%s" % (utf8_width_fill(msg, 0, 10, prefix=prefix, suffix=suffix)). R)t (R(tjoinR"R#R( RtfillR$tlefttprefixtsuffixt passed_msgR'textra((s,/usr/lib/python2.6/site-packages/yum/i18n.pytutf8_width_fills   cCs3x,t|D]\}}|djotSq WtS(s. Return True/False is the text is valid utf8. N(RRRR (RR R ((s,/usr/lib/python2.6/site-packages/yum/i18n.pyt utf8_valid$s    cGsjd}x|D]}|t|7}q W||jotSd}x|D]}|t|7}qFW||jS(s{ Minor speed hack, we often want to know "does X fit in Y". It takes "a while" to work out a utf8_width() (see above), and we know that a utf8 character is always <= byte. So given: assert bytes >= characters characters <= width? ...we can change to: bytes <= width or characters <= width ...and bytes are much faster. i(RR R!(R'targsRtarg((s,/usr/lib/python2.6/site-packages/yum/i18n.pyt_utf8_width_le+s iFcst|t}fdt|}t|}t|id}t|idd id}g}|}t}d} d} x#|D]} | id} | | } } | \} } t}|o| o t}n|o| t| jo t}n|o0| o(| djo| | jo t}q>n|o&|i |id|}t}n| t| jo d} n|o| i d} | } nt ||| o$t}|i || |}qnt}| id}|} | }| o| djo | }nxw|D]o}t || | oAt | t |jo(|i | id|d|} n| |7} | d7} q&W| idd}qW|o|i |idn|ot t|S|S( sl Works like we want textwrap.wrap() to work, uses utf-8 data and doesn't screw up lists/blocks/etc. c sd}d}x*|D]"}|djoPn|d7}qW|d jo |dfSt||dd}|djoM||t|}|dp|d}|o||d|fSn|dfS(NitXR*it-t*t.toss•s‣s∘(R8R9R:R;s(R8R9R:R;s•s‣s∘(R(R(tlinetcountRtlist_chrtnxt(t_indent_at_beg(s,/usr/lib/python2.6/site-packages/yum/i18n.pyR@Vs"    s s R*iiiR)s (R"R#RtrstriptreplacetsplitRR RtappendtlstripR6R!tmapR(ttextR'tinitial_indenttsubsequent_indentR%tlinesRtindentt wrap_lasttcsabt cspc_indentR<tlsabt lspc_indenttforce_nltwordstspcstword((R@s,/usr/lib/python2.6/site-packages/yum/i18n.pytutf8_text_wrapCst  !        cOsdit|||S(sl Works like we want textwrap.fill() to work, uses utf-8 data and doesn't screw up lists/blocks/etc. s (R+RU(RGR4tkwargs((s,/usr/lib/python2.6/site-packages/yum/i18n.pytutf8_text_fillssutf-8RBcCs>t|to*t|tpt|||}q:n|S(s convert a 'str' to 'unicode' (R"t basestringR#(tobjtencodingterrors((s,/usr/lib/python2.6/site-packages/yum/i18n.pyRscCs*t|to|id|}n|S(s2convert 'unicode' to an encoded utf-8 byte string sutf-8(R"R#tencode(RYR[((s,/usr/lib/python2.6/site-packages/yum/i18n.pyRscCs/yt|||SWntj o|SXdS(s. Don't ask don't tell, only use when you must N(RtUnicodeEncodeError(RYRZR[((s,/usr/lib/python2.6/site-packages/yum/i18n.pytto_unicode_maybescCs$t|tpt|}n|S(s1 Convert something to a string, if it isn't one. (R"RXR(RY((s,/usr/lib/python2.6/site-packages/yum/i18n.pytto_strscCsWt|tt|tjo||jotSnt|t|jotStS(sP convert between unicode and not and compare them, w/o warning or being annoying(R"R#R RR(tatb((s,/usr/lib/python2.6/site-packages/yum/i18n.pytstr_eqs   c CsOyt|iSWnnXyt|SWnnXyt|SWnnXdS(s DIE python DIE! Which one works: to_unicode(e.value); unicode(e); str(e); Call this so you don't have to care. s%(RtvalueR#R(te((s,/usr/lib/python2.6/site-packages/yum/i18n.pyt exception2msgsiNtyumtfallbacktmessagest__main__cCst|}dG|GHdGt|GHt|}dG|GHdGt|GHdGt|GHdGt|GHdGddt|d d d fGHd Gddt|d d d fGHdGddt|d dd fGHdGddt|d dd fGHdGddt|d d d fGHdGddt|d dd fGHdGddt|d dd fGHdGddt|ddd fGHdGddt|ddd fGHdGHdS(NsUTF8 :slen :sUSC :svalid:swidth:s4.8 :s%s%s%sts4.3 :is4.2 :is4.1 :is3.3 :s3.2 :s3.1 :s40.79:i(iOs40.20:iR)(RRRR3R!R2(R5((s,/usr/lib/python2.6/site-packages/yum/i18n.pytouts$    """""""""s ---- Arguments/str ---- is ---- Arguments/gettext ---- is ---- Arguments/str/all ---- s! ---- Arguments/gettext/all ---- i(iio(ii(ii(ii(ii(ii(ii(ii(ii(ii(iKi^(ipip(ii(ii(ii(ii(ii(i0iJ(ii(ii(i i (i< i< (iA iH (iM iM (iQ iT (ib ic (i i (i i (i i (i i (i i (i i (i< i< (iA iB (iG iH (iK iM (ip iq (i i (i i (i i (i i (i i (i i (i i (i< i< (i? i? (iA iC (iM iM (iV iV (i i (i i (i i (i> i@ (iF iH (iJ iM (iU iV (i i (i i (i i (i i (i i (iA iC (iM iM (i i (i i (i i (i1i1(i4i:(iGiN(ii(ii(ii(ii(ii(i5i5(i7i7(i9i9(iqi~(ii(ii(ii(ii(ii(i-i0(i2i2(i6i7(i9i9(iXiY(i`i(i_i_(ii(i2i4(iRiS(iris(ii(ii(ii(ii(ii(i i (ii(i i"(i'i((i2i2(i9i;(ii(ii(i4i4(i6i:(i<i<(iBiB(ikis(ii(ii(i i (i* i. (i` ic (ij io (i i (i*0i/0(i0i0(ii(i i (i%i&(ii(ii(i i#(ii(ii(i i (i i (i i (i8 i: (i? i? (igii(isi(ii(ii(iBiD(ii(i i(ii('RRRRRRRR!RR(R R2R3R6RURWRRR^R_RbRetgettextt translationtttugettextt_t ungettexttP_toptparset__name__tsysRltargvR5tUnicodeDecodeErrorRRFtexit(((s,/usr/lib/python2.6/site-packages/yum/i18n.pyts  +                                                    + %  a        #    +