grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026a BjŒj='ã@sÎddlmZmZddlZddlmZmZmZmZe  d¡Z e  edƒ¡Z da gd¢a dd„Zdd „Zd d „Zd d „Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zed krÊeƒdS)!é)ÚdivisionÚprint_functionN)ÚbytesÚBÚord2Ú text_typez^[ -~]*$)&)é~é)éŸr)i¯r )iÆr)iÇr )i×r)iÝr )ior)i‚r )i‰r)iûr )i_é)i+r )iar)i± r )iê r)i(#r )i*#r )i +r )i>0r )i?0r )i–0r )iš0r)iµMr )iÿMr )i£×r )iÿør )ijúr )iþr )i#þr)ikþr )iÿþr )i`ÿr )iÜÿr )iæÿr )iÿ×r )iýÿr )iýÿr cCs6|dks|dkrdStD]\}}||kr|SqdS)z5Return the screen column width for unicode ordinal o.éérr )Úwidths)ÚoÚnumÚwid©rú8/usr/lib64/python3.9/site-packages/urwid/old_str_util.pyÚ get_widthPs   rc Cst||ƒ}|d@s ||dfStdƒ|df}t|ƒ}||}|dkrL|S|d@dkr¤t||dƒ}|d@dkrx|S|d@d>|d @B}|dkr˜|S||dfS|d kr°|S|d @dk�r8t||dƒ}|d@dkrÞ|St||dƒ}|d@dkrþ|S|d @d >|d @d>B|d @B}|dk�r,|S||d fS|dk�rF|S|d@d k�rt||dƒ}|d@dk�rv|St||dƒ}|d@dk�r˜|St||dƒ}|d@dk�rº|S|d@d>|d @d >B|d @d>B|d @B}|dk�rô|S||dfS|S)zH Return (ordinal at pos, next position) for UTF-8 encoded text. é€r ú?r éàéÀééé?ééðr é iééøééi)rÚordÚlen) ÚtextÚposÚb1ÚerrorÚltÚb2rZb3Zb4rrrÚ decode_oneZs\           ,  r+cCst||ƒ|dfS)z7 decode_one implementation for unicode strings r )r#)r%ÚirrrÚdecode_one_uniŽsr-cCshtdƒ|df}|}|dkrdt||ƒd@dkrJt||ƒ\}}||dfS|d8}||dkr|SqdS)z‹ Return (ordinal at pos, next position) for UTF-8 encoded text. pos is assumed to be on the trailing byte of a utf-8 sequence. rr rrrrN)r#rr+)r%r&r(ÚprÚnextrrrÚdecode_one_right”s  r0cCs|adS©N©Ú_byte_encoding)ÚencrrrÚset_byte_encoding¤sr5cCstSr1r2rrrrÚget_byte_encoding©sr6c CsÎt|tƒotdk}t|tƒ }|s&|r†ttg|}|}d}d} ||kr~|||ƒ\} } t| ƒ} | ||krp||fS| }|| 7}q>||fS||}||kr¢|||fStdkrÂt|||ƒdkrÂ|d8}|||fS)a9 Calculate the closest position to the screen column pref_col in text where start_offs is the offset into text assumed to be screen column 0 and end_offs is the end of the range to search. text may be unicode or a byte string in the target _byte_encoding Returns (position, actual_col). Úutf8rr Úwider )Ú isinstancerr3r+r-rÚwithin_double_byte) r%Ú start_offsÚend_offsZpref_colÚutfsÚunisÚdecoder,ÚscÚnrÚwrrrÚ calc_text_pos¬s,      rCc CsŠt|tƒotdk}t|tƒ }|r,t |¡r:|r‚t |¡s‚ttg|}|}d}d}||kr~|||ƒ\} }t| ƒ} |}|| 7}qR|S||S)am Return the screen column width of text between start_offs and end_offs. text may be unicode or a byte string in the target _byte_encoding Some characters are wide (take two columns) and others affect the previous character (take zero columns). Use the widths table above to calculate the screen column width of text[start_offs:end_offs] r7rr ) r9rr3Ú SAFE_ASCII_REÚmatchÚSAFE_ASCII_BYTES_REr+r-r) r%r;r<r=r>r?r,r@rArrBrrrÚ calc_widthÐs$  ÿÿ  rGcCs`t|tƒr"t||ƒ}t|ƒdkStdkrDt||ƒ\}}t|ƒdkStdkr\t|||ƒdkSdS)zƒ Test if the character at offs within text is wide. text may be unicode or a byte string in the target _byte_encoding r r7r8r F)r9rr#rr3r+r:)r%ZoffsrrArrrÚ is_wide_charîs    rHcCspt|tƒr|dStdkrD|d}t||ƒd@dkr@|d8}q"|Stdkrht|||dƒdkrh|dS|dS)z? Return the position of the character before end_offs. r r7rrr8r ©r9rr3rr:©r%r;r<rrrrÚmove_prev_charÿs   ÿÿrKcCstt|tƒr|dStdkrL|d}||krHt||ƒd@dkrH|d7}q"|Stdkrlt|||ƒdkrl|dS|dS)z@ Return the position of the character after start_offs. r r7rrr8r rIrJrrrÚmove_next_chars   ÿÿrLcCs¤t||ƒ}|dkrX|dkrX||kr(dSt||dƒdkrTt|||dƒdkrTdSdS|dkrddS|d}||kr�t||ƒdkr†q�|d8}ql||d@r dSdS)ajReturn whether pos is within a double-byte encoded character. text -- byte string in question line_start -- offset of beginning of line (< pos) pos -- offset in question Return values: 0 -- not within dbe char, or double_byte_encoding == False 1 -- pos is on the 1st half of a dbe char 2 -- pos is on the 2nd half of a dbe char é@érr é�r r)rr:)r%Z line_startr&Úvr,rrrr:#s     r:c Cs"ddl}g}d}|j ¡D]Ð}|dd…dkr0q| ¡}| dd¡\}}| dd¡\}}| dd¡d}d|vr~| d¡d}t|d ƒ}|d vr–d} n|d vr¤d } nd} |durÂ| d| f¡| }|| krØ|| f|d <q| || f¡| }qtdƒ|dd…D]} td| fƒ�qtdƒdS)Nrr ú#ú;z # ú Ú.z..é)Z COMBININGZMODIFIERz )ÚWÚFr éÿÿÿÿz widths = [z %r,ú])ÚsysÚstdinÚ readlinesÚstripÚsplitÚintÚappendÚprint) rZÚoutÚlastÚlineÚhexÚrestrZword1rÚlrrrrÚprocess_east_asian_widthIs8 rhÚ__main__)Z __future__rrÚreZ urwid.compatrrrrÚcompilerDrFr3rrr+r-r0r5r6rCrGrHrKrLr:rhÚ__name__rrrrÚs* + 4$&%