;ò ÃrzFc'@sdkZeidƒZeaddfddfddfddfddfd dfd dfd dfd dfd dfddfddfddfddfddfddfddfddfddfddfddfddfddfddfddfddfddfd dfd!dfd"dfd#dfd$dfd%dfd&dfd'dfd(dfd)dfd*dfg&ad+„Zd,„Zd-„Zd.„Z d/„Z d0„Z d1„Z d2„Z d3„Zd4„Zd5„Zd6„Zed7jo eƒndS(8Ns^[ -~]*$i~iiŸii¯iÆiÇi×iÝioi‚i‰iûi_ii+iai± iê i(#i*#i +i>0i?0i–0iš0iµMiÿMi£×iÿøijúiþi#þikþiÿþi`ÿiÜÿiæÿiÿ×iýÿiýÿcCsV|djp |djodSnx)tD]!\}}||jo|Sq)q)WdSdS(s5Return the screen column width for unicode ordinal o.iiiiN(soswidthssnumswid(soswidsnum((sJ/mnt/gmirror/ports/devel/py-urwid/work/urwid-0.9.8.1/urwid/old_str_util.pys get_widthJs   c Cs½t||ƒ}|d@ o||dfSntdƒ|df}t|ƒ}||}|djo|Sn|d@djojt||dƒ}|d@djo|Sn|d@d>|d @B}|djo|Sn||dfSn|d jo|Sn|d @djo£t||dƒ}|d@djo|Snt||dƒ}|d@djo|Sn|d @d >|d @d>B|d @B}|djo|Sn||d fSn|djo|Sn|d@d joÜt||dƒ}|d@djo|Snt||dƒ}|d@djo|Snt||dƒ}|d@djo|Sn|d@d>|d @d >B|d @d>B|d @B}|djo|Sn||dfSn|SdS(s>Return (ordinal at pos, next position) for UTF-8 encoded text.i€is?iiàiÀiii?iiðii iiiøiiiN( sordstextspossb1serrorslensltsb2sosb3sb4( stextspossosb3sb4sltsb1sb2serror((sJ/mnt/gmirror/ports/devel/py-urwid/work/urwid-0.9.8.1/urwid/old_str_util.pys decode_oneTs^      "  . cCsštdƒ|df}|}xw|djoit||ƒd@djo't||ƒ\}}||dfSn|d8}||djo|SqqWdS(s€ 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.s?iiiÀi€iN(sordsposserrorspstexts decode_onesosnext(stextspossosnextspserror((sJ/mnt/gmirror/ports/devel/py-urwid/work/urwid-0.9.8.1/urwid/old_str_util.pysdecode_one_right…s  cCs'|dddfjpt‚|adS(Nsutf8snarrowswide(sencsAssertionErrors_byte_encoding(senc((sJ/mnt/gmirror/ports/devel/py-urwid/work/urwid-0.9.8.1/urwid/old_str_util.pysset_byte_encoding“scCstSdS(N(s_byte_encoding(((sJ/mnt/gmirror/ports/devel/py-urwid/work/urwid-0.9.8.1/urwid/old_str_util.pysget_byte_encoding˜sc Cs¤||jpt||f ‚t|ƒtdƒjo tdj}t|ƒtdƒjp|oª|}d} d}x‡||joy|ot ||ƒ\}}nt ||ƒ}|d}t |ƒ}|| |jo|| fSn|}| |7} qxW|| fSnt|ƒtdƒjp t| ‚||}||jo|||fSntdjo+t|||ƒdjo|d8}q’n|||fSdS( sä 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. Returns (position, actual_col). ssutf8uiiswideiN(s start_offssend_offssAssertionErrorstypestexts_byte_encodingsutfssisscsns decode_onesosords get_widthswspref_colswithin_double_byte( stexts start_offssend_offsspref_colsutfssisosnswssc((sJ/mnt/gmirror/ports/devel/py-urwid/work/urwid-0.9.8.1/urwid/old_str_util.pys calc_text_pos›s6%    $   c Cs||jpt||f ‚t|ƒtdƒjo tdj}t|ƒtdƒjp|oti|ƒ o…|}d}d}xh||joZ|ot ||ƒ\}}nt||ƒ}|d}t|ƒ}|}||7}q‰W|Sn||SdS(sK Return the screen column width of text between start_offs and end_offs. ssutf8uiiN(s start_offssend_offssAssertionErrorstypestexts_byte_encodingsutfss SAFE_ASCII_REsmatchsisscsns decode_onesosords get_widthsw( stexts start_offssend_offssutfssosnsiswssc((sJ/mnt/gmirror/ports/devel/py-urwid/work/urwid-0.9.8.1/urwid/old_str_util.pys calc_width¿s$%1   cCsÂt|ƒtdƒjo$t||ƒ}t|ƒdjSnt|ƒtdƒjpt‚tdjo)t||ƒ\}}t|ƒdjSntdjot |||ƒdjSnt SdS(s6 Test if the character at offs within text is wide. uissutf8swideiN( stypestextsordsoffssos get_widthsAssertionErrors_byte_encodings decode_onesnswithin_double_bytesFalse(stextsoffssosn((sJ/mnt/gmirror/ports/devel/py-urwid/work/urwid-0.9.8.1/urwid/old_str_util.pys is_wide_charÖs   cCsç||jpt‚t|ƒtdƒjo |dSnt|ƒtdƒjpt‚tdjo?|d}x*t||ƒd@djo|d8}qsW|Sntdjot|||dƒdjo |dSn|dSd S( s9 Return the position of the character before end_offs. uissutf8iÀi€swideiN( s start_offssend_offssAssertionErrorstypestexts_byte_encodingsosordswithin_double_byte(stexts start_offssend_offsso((sJ/mnt/gmirror/ports/devel/py-urwid/work/urwid-0.9.8.1/urwid/old_str_util.pysmove_prev_charås     cCsð||jpt‚t|ƒtdƒjo |dSnt|ƒtdƒjpt‚tdjoL|d}x7||jot||ƒd@djo|d7}qsW|Sntdjot|||ƒdjo |dSn|dSd S( s: Return the position of the character after start_offs. uissutf8iÀi€swideiN( s start_offssend_offssAssertionErrorstypestexts_byte_encodingsosordswithin_double_byte(stexts start_offssend_offsso((sJ/mnt/gmirror/ports/devel/py-urwid/work/urwid-0.9.8.1/urwid/old_str_util.pysmove_next_char÷s    ( cCst||ƒ}|djo |djoa||jodSnt||dƒdjo)t|||dƒdjodSqƒndSn|djodSn|d}x8||jo*t||ƒdjoPn|d8}q­W||d@odSndSdS( sMReturn whether pos is within a double-byte encoded character. str -- 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 og a dbe char i@iiiiii€N(sordsstrspossvs line_startswithin_double_bytesi(sstrs line_startspossisv((sJ/mnt/gmirror/ports/devel/py-urwid/work/urwid-0.9.8.1/urwid/old_str_util.pyswithin_double_byte s(      c Cs¤dk}g} t}x[|iiƒD]J} | d djoq%n| iƒ} | iddƒ\}}|iddƒ\}}|iddƒd}d|jo|idƒd}nt |d ƒ}|d d d fjo d}n$|d dfjo d}nd}|tjo| id|fƒ|}n||jo||f| dsWsFiiÿÿÿÿs widths = [s s,s](ssyssoutsNoneslastsstdins readlinesslinesstripssplitshexsrestswidsword1sintsnumslsappendso( swidslastshexslsrestssyssnumsword1soslinesout((sJ/mnt/gmirror/ports/devel/py-urwid/work/urwid-0.9.8.1/urwid/old_str_util.pysprocess_east_asian_width.s>          s__main__(srescompiles SAFE_ASCII_REsNones_byte_encodingswidthss get_widths decode_onesdecode_one_rightsset_byte_encodingsget_byte_encodings calc_text_poss calc_widths is_wide_charsmove_prev_charsmove_next_charswithin_double_bytesprocess_east_asian_widths__name__(s calc_text_possmove_next_charsmove_prev_chars is_wide_charsget_byte_encodingsdecode_one_rightswithin_double_bytesres calc_widthsprocess_east_asian_widthsset_byte_encodings get_widths SAFE_ASCII_REs decode_one((sJ/mnt/gmirror/ports/devel/py-urwid/work/urwid-0.9.8.1/urwid/old_str_util.pys?s$ ÿ]+ 1    $     % %