HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python2.7/dist-packages/mercurial/encoding.pyc
ó
ÛXc@@sHddlmZddlZddlZddlZddlZddlmZmZej	Z
ejrqeZ
ngdjƒD]$Ze
eedƒƒjdƒ^q~Zejrîed„eDƒƒeed	ƒed
ƒgƒkst‚n.ed„eDƒƒed	d
gƒkst‚d„Zejp5ejZejsMejZn1er_ejZned
„ejjƒDƒƒZd„Zid„d6d„d6ed6ZyFejdƒZ e síej!ƒpÏdZ eje d„ƒƒZ nWnej"k
r
dZ nXejddƒZ#dZ$de%fd„ƒYZ&d„Z'd„Z(essed„ejjƒDƒƒZnejdd ƒd!kr‘d"p”d#Z)d$„Z*d%„Z+d&„Z,d'e-d(„Z.d)„Z/d*„a0d+„Z1d,„a2d-„Z3d.„Z4d/„Z5d0e6fd1„ƒYZ7gZ8e8j9d2„e:d3ƒDƒƒe8j9d4„e:d3d5ƒDƒƒe8j;d6ƒd7e8d8<d9e8d:<d;e8d<<d=e8d><d?e8d@<dAe8dB<dCe8dD<e8Z<dEe<dF<dGe<dH<e8j9dI„e:dJdKƒDƒƒe-dL„Z=dddddddddddddMdMdNdOgZ>dP„Z?dQ„Z@dR„ZAdS(Si(tabsolute_importNi(terrortpycompatsO200c 200d 200e 200f 202a 202b 202c 202d 202e 206a 206b 206c 206d 206e 206f feffisutf-8cc@s|]}|dVqdS(iN((t.0ti((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pys	<genexpr>!ssâsïcc@s|]}|dVqdS(iN((RR((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pys	<genexpr>#scC@sBd|ksd|kr>x#tD]}|j|dƒ}qWn|S(s­Remove codepoints ignored by HFS+ from s.

    >>> hfsignoreclean(u'.h\u200cg'.encode('utf-8'))
    '.hg'
    >>> hfsignoreclean(u'.h\ufeffg'.encode('utf-8'))
    '.hg'
    sâsït(t_ignoretreplace(tstc((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pythfsignoreclean%s
cc@s3|])\}}|jdƒ|jdƒfVqdS(uutf-8N(tencode(Rtktv((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pys	<genexpr><scC@sxytjWntk
r)tjƒdSXtjtjƒ}tjtjdƒtjtjƒ}tjtj|ƒ|S(sá
    On darwin, getpreferredencoding ignores the locale environment and
    always returns mac-roman. http://bugs.python.org/issue6202 fixes this
    for Python 2.7 and up. This is the same corrected code for earlier
    Python versions.

    However, we can't use a version check for this method, as some distributions
    patch Python to fix this. Instead, we use it as a 'fixer' for the mac-roman
    encoding, as it is unlikely that this encoding is the actually expected.
    iR(tlocaletCODESETtAttributeErrortgetdefaultlocalet	setlocaletLC_CTYPEtnl_langinfo(toldloctresult((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyt_getpreferredencoding?s
cC@sdS(Ntascii((((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyt<lambda>Xst646cC@sdS(NR((((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRYssANSI_X3.4-1968s	mac-romant
HGENCODINGRcC@stS(N(tencoding(((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRastHGENCODINGMODEtstricts
ISO-8859-1tlocalstrcB@s eZdZd„Zd„ZRS(sdThis class allows strings that are unmodified to be
    round-tripped to the local encoding and backcC@stj||ƒ}||_|S(N(tstrt__new__t_utf8(tclstutlR((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyR!js	cC@s
t|jƒS(N(thashR"(tself((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyt__hash__ns(t__name__t
__module__t__doc__R!R((((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRgs	cC@sMyyg|jdƒ}tdkr%|S|jttƒdƒ}||jttƒƒkr\|St||ƒSWn°tk
ryf|jttƒƒ}|jttƒdƒ}||jttƒƒkrÉ|St|jdƒ|ƒSWqtk
r|jddƒ}|jttƒdƒSXnXWn(tk
rH}tj	|ddƒ‚nXdS(sÁ
    Convert a string from internal UTF-8 to local encoding

    All internal strings should be UTF-8 but some repos before the
    implementation of locale support may contain latin1 or possibly
    other character sets. We attempt to decode everything strictly
    using UTF-8, then Latin-1, and failing that, we use UTF-8 and
    replace unknown characters.

    The localstr class is used to cache the known UTF-8 encoding of
    strings next to their local representation to allow lossless
    round-trip conversion back to UTF-8.

    >>> u = 'foo: \xc3\xa4' # utf-8
    >>> l = tolocal(u)
    >>> l
    'foo: ?'
    >>> fromlocal(l)
    'foo: \xc3\xa4'
    >>> u2 = 'foo: \xc3\xa1'
    >>> d = { l: 1, tolocal(u2): 2 }
    >>> len(d) # no collision
    2
    >>> 'foo: ?' in d
    False
    >>> l1 = 'foo: \xe4' # historical latin1 fallback
    >>> l = tolocal(l1)
    >>> l
    'foo: ?'
    >>> fromlocal(l) # magically in utf-8
    'foo: \xc3\xa4'
    sUTF-8ureplacesutf-8Rthints!please check your locale settingsN(
tdecodeRRt_sysstrRtUnicodeDecodeErrortfallbackencodingtLookupErrorRtAbort(RR$trR((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyttolocalqs*"

cC@sÃt|tƒr|jSy/|jttƒttƒƒ}|jdƒSWnwtk
r—}|t	d|j
dƒ|j
d!}tjd||fƒ‚n(t
k
r¾}tj|ddƒ‚nXdS(sŒ
    Convert a string from the local character encoding to UTF-8

    We attempt to decode strings using the encoding mode set by
    HGENCODINGMODE, which defaults to 'strict'. In this mode, unknown
    characters will cause an error message. Other modes include
    'replace', which replaces unknown characters with a special
    Unicode character, and 'ignore', which drops the character.
    sutf-8ii
sdecoding near '%s': %s!R,s!please check your locale settingsN(t
isinstanceRR"R-R.RtencodingmodeRR/tmaxtstartRR2R1(RR$tinsttsubR((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyt	fromlocal¯s$cc@s?|]5\}}t|jdƒƒt|jdƒƒfVqdS(uutf-8N(R4R(RRR
((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pys	<genexpr>ÊstHGENCODINGAMBIGUOUStnarrowtwidetWFAtWFcC@st|jttƒdƒƒS(sCFind the column width of a string for display in the local encodingureplace(t	ucolwidthR-R.R(R((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pytcolwidthÑscC@s]ttddƒ}|dk	rStg|D]$}||ƒtkrFdpId^q(ƒSt|ƒS(s5Find the column width of a Unicode string for displayteast_asian_widthiiN(tgetattrtunicodedatatNonetsumR>tlen(tdteawR	((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRAÕs5cC@sKxDt||t|ƒƒD])}|||!}t|ƒ|kr|SqWdS(sOUse colwidth to find a c-column substring of s starting at byte
    index startN(txrangeRHRB(RR8R	txtt((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pytgetcolsÜs 
Rc@sqy|jttƒƒ‰Wnqtk
rŒt|ƒ|kr?|S|tˆƒ8}|dkrmˆ|tˆƒ S|r€ˆ||S|| ˆSXtˆƒ|kr£|S|tˆƒ8}|dkrш|tˆƒ S|rø‡fd†}‡fd†}n‡fd†}‡fd†}xTtdtˆƒƒD]=}||ƒ}t|ƒ|kr,||jttƒƒƒSq,WˆS(sTrim string 's' to at most 'width' columns (including 'ellipsis').

    If 'leftside' is True, left side of string 's' is trimmed.
    'ellipsis' is always placed at trimmed side.

    >>> ellipsis = '+++'
    >>> from . import encoding
    >>> encoding.encoding = 'utf-8'
    >>> t= '1234567890'
    >>> print trim(t, 12, ellipsis=ellipsis)
    1234567890
    >>> print trim(t, 10, ellipsis=ellipsis)
    1234567890
    >>> print trim(t, 8, ellipsis=ellipsis)
    12345+++
    >>> print trim(t, 8, ellipsis=ellipsis, leftside=True)
    +++67890
    >>> print trim(t, 8)
    12345678
    >>> print trim(t, 8, leftside=True)
    34567890
    >>> print trim(t, 3, ellipsis=ellipsis)
    +++
    >>> print trim(t, 1, ellipsis=ellipsis)
    +
    >>> u = u'\u3042\u3044\u3046\u3048\u304a' # 2 x 5 = 10 columns
    >>> t = u.encode(encoding.encoding)
    >>> print trim(t, 12, ellipsis=ellipsis)
    ã‚ã„ã†ãˆãŠ
    >>> print trim(t, 10, ellipsis=ellipsis)
    ã‚ã„ã†ãˆãŠ
    >>> print trim(t, 8, ellipsis=ellipsis)
    ã‚ã„+++
    >>> print trim(t, 8, ellipsis=ellipsis, leftside=True)
    +++ãˆãŠ
    >>> print trim(t, 5)
    ã‚ã„
    >>> print trim(t, 5, leftside=True)
    ãˆãŠ
    >>> print trim(t, 4, ellipsis=ellipsis)
    +++
    >>> print trim(t, 4, ellipsis=ellipsis, leftside=True)
    +++
    >>> t = '"3DUfwˆ™ª' # invalid byte sequence
    >>> print trim(t, 12, ellipsis=ellipsis)
    "3DUfwˆ™ª
    >>> print trim(t, 10, ellipsis=ellipsis)
    "3DUfwˆ™ª
    >>> print trim(t, 8, ellipsis=ellipsis)
    "3DU+++
    >>> print trim(t, 8, ellipsis=ellipsis, leftside=True)
    +++fwˆ™ª
    >>> print trim(t, 8)
    "3DUfwˆ
    >>> print trim(t, 8, leftside=True)
    3DUfwˆ™ª
    >>> print trim(t, 3, ellipsis=ellipsis)
    +++
    >>> print trim(t, 1, ellipsis=ellipsis)
    +
    ic@sˆ|S(N((R(R$(s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyR6sc@sˆ|S(N((R(tellipsis(s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyR7sc@s	ˆ| S(N((R(R$(s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyR9sc@s|ˆS(N((R(RO(s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyR:si(R-R.RR/RHRARKR(RtwidthROtleftsidetuslicetconcatRtusub((ROR$s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyttrimäs4>


cC@s|jdƒ|jƒS(shconvert a string to lowercase if ASCII

    Raises UnicodeDecodeError if non-ASCII characters are found.R(R-tlower(R((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyt_asciilowerAs
cC@s2ddlm}t|dtƒ}|a||ƒS(Ni(tparserst
asciilower(RRXRDRWRY(RRXtimpl((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRYHscC@s|jdƒ|jƒS(shconvert a string to uppercase if ASCII

    Raises UnicodeDecodeError if non-ASCII characters are found.R(R-tupper(R((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyt_asciiupperQs
cC@s2ddlm}t|dtƒ}|a||ƒS(Ni(RXt
asciiupper(RRXRDR\R](RRXRZ((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyR]XscC@sÝyt|ƒSWntk
r!nXyut|tƒrI|jjdƒ}n|jttƒttƒƒ}|j	ƒ}||krƒ|S|j
ttƒƒSWn?tk
r±|j	ƒStk
rØ}t
j|ddƒ‚nXdS(s9best-effort encoding-aware case-folding of local string ssutf-8R,s!please check your locale settingsN(RYR/R5RR"R-R.RR6RVRtUnicodeErrorR1RR2(RR$tluR((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRVas 


cC@s-yt|ƒSWntk
r(t|ƒSXdS(s9best-effort encoding-aware case-folding of local string sN(R]R/t
upperfallback(R((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyR[vs
cC@s»yut|tƒr'|jjdƒ}n|jttƒttƒƒ}|jƒ}||kra|S|jttƒƒSWn?t	k
r|jƒSt
k
r¶}tj|ddƒ‚nXdS(Nsutf-8R,s!please check your locale settings(
R5RR"R-R.RR6R[RR^R1RR2(RR$tuuR((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyR`}s

t
normcasespecscB@s eZdZdZdZdZRS(sxwhat a platform's normcase does to ASCII strings

    This is specified per platform, and should be consistent with what normcase
    on that platform actually does.

    lower: normcase lowercases ASCII strings
    upper: normcase uppercases ASCII strings
    other: the fallback function should always be called

    This should be kept in sync with normcase_spec in util.h.iÿÿÿÿii(R)R*R+RVR[tother(((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRbs
cc@s|]}d|VqdS(s\u%04xN((RRL((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pys	<genexpr>si cc@s|]}t|ƒVqdS(N(tchr(RRL((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pys	<genexpr>žsis\u007fs\ti	s\ni
s\"i"s\\i\s\bis\fis\ri
s\u003ci<s\u003ei>cc@s|]}t|ƒVqdS(N(Rd(RRL((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pys	<genexpr>ªsi€ic@sª|rt‰nt‰t|ƒ}y'dj‡fd†t|ƒDƒƒSWntk
r[nXtjd|jdƒjdƒƒ}|j	dƒdj‡fd†|DƒƒS(s›returns a string suitable for JSON

    JSON is problematic for us because it doesn't support non-Unicode
    bytes. To deal with this, we take the following approach:

    - localstr objects are converted back to UTF-8
    - valid UTF-8/ASCII strings are passed as-is
    - other strings are converted to UTF-8b surrogate encoding
    - apply JSON-specified string escaping

    (escapes are doubled in these tests)

    >>> jsonescape('this is a test')
    'this is a test'
    >>> jsonescape('escape characters: \0 \x0b \x7f')
    'escape characters: \\u0000 \\u000b \\u007f'
    >>> jsonescape('escape characters: \t \n \r \" \\')
    'escape characters: \\t \\n \\r \\" \\\\'
    >>> jsonescape('a weird byte: \xdd')
    'a weird byte: \xed\xb3\x9d'
    >>> jsonescape('utf-8: caf\xc3\xa9')
    'utf-8: caf\xc3\xa9'
    >>> jsonescape('')
    ''

    If paranoid, non-ascii and common troublesome characters are also escaped.
    This is suitable for web output.

    >>> jsonescape('escape boundary: \x7e \x7f \xc2\x80', paranoid=True)
    'escape boundary: ~ \\u007f \\u0080'
    >>> jsonescape('a weird byte: \xdd', paranoid=True)
    'a weird byte: \\udcdd'
    >>> jsonescape('utf-8: caf\xc3\xa9', paranoid=True)
    'utf-8: caf\\u00e9'
    >>> jsonescape('non-BMP: \xf0\x9d\x84\x9e', paranoid=True)
    'non-BMP: \\ud834\\udd1e'
    >>> jsonescape('<foo@example.org>', paranoid=True)
    '\\u003cfoo@example.org\\u003e'
    Rc3@s|]}ˆ|VqdS(N((RRL(tjm(s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pys	<genexpr>ÜstHsutf-8sutf-16ic3@s/|]%}|dkrˆ|nd|VqdS(i€s\u%04xN((RRL(Re(s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pys	<genexpr>âs(
t_paranoidjsonmapt_jsonmapttoutf8btjoint	bytearrayt
IndexErrortarrayR-Rtpop(Rtparanoidtu8charstu16codes((Res6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyt
jsonescape¬s)	'
$
iiicC@sHtt||ƒd?}|s&||S||||!}|jdƒ|S(s¨get the next full utf-8 character in the given string, starting at pos

    Raises a UnicodeError if the given location does not start a valid
    utf-8 character.
    isutf-8(t_utf8lentordR-(RtposR%R	((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pytgetutf8charæs
cC@s7d|krNt|tƒr"|jSy|jdƒ|SWqNtk
rJqNXnd}d}t|ƒ}xÊ||kr2yot||ƒ}d|koždknrÓtdt||ƒƒj	dƒ}|d7}n|t|ƒ7}Wn>tk
r$tdt||ƒƒj	dƒ}|d7}nX||7}qiW|S(	s÷convert a local, possibly-binary string into UTF-8b

    This is intended as a generic method to preserve data when working
    with schemes like JSON and XML that have no provision for
    arbitrary byte strings. As Mercurial often doesn't know
    what encoding data is in, we use so-called UTF-8b.

    If a string is already valid UTF-8 (or ASCII), it passes unmodified.
    Otherwise, unsupported bytes are mapped to UTF-16 surrogate range,
    uDC00-uDCFF.

    Principles of operation:

    - ASCII and UTF-8 data successfully round-trips and is understood
      by Unicode-oriented clients
    - filenames and file contents in arbitrary other encodings can have
      be round-tripped or recovered by clueful clients
    - local strings that have a cached known UTF-8 encoding (aka
      localstr) get sent as UTF-8 so Unicode-oriented clients get the
      Unicode data they want
    - because we must preserve UTF-8 bytestring in places such as
      filenames, metadata can't be roundtripped without help

    (Note: "UTF-8b" often refers to decoding a mix of valid UTF-8 and
    arbitrary bytes into an internal Unicode format that can be
    re-encoded back into the original. Here we are exposing the
    internal surrogate encoding as a UTF-8 string.)
    sísutf-8Risí°€sí³¿iÜi(
R5RR"R-R/RHRvtunichrRtR(RR3RuR%R	((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRi÷s.

#

#cC@s¦d|kr|Sd}d}t|ƒ}xw||kr¡t||ƒ}|t|ƒ7}d|komdknr”tt|jdƒƒd@ƒ}n||7}q+W|S(sRGiven a UTF-8b string, return a local, possibly-binary string.

    return the original binary string. This
    is a round-trip process for strings like filenames, but metadata
    that's was passed through tolocal will remain in UTF-8.

    >>> roundtrip = lambda x: fromutf8b(toutf8b(x)) == x
    >>> m = "\xc3\xa9\x99abcd"
    >>> toutf8b(m)
    '\xc3\xa9\xed\xb2\x99abcd'
    >>> roundtrip(m)
    True
    >>> roundtrip("\xc2\xc2\x80")
    True
    >>> roundtrip("\xef\xbf\xbd")
    True
    >>> roundtrip("\xef\xef\xbf\xbd")
    True
    >>> roundtrip("\xf1\x80\x80\x80\x80")
    True
    síRisí°€sí³¿sutf-8iÿ(RHRvRdRtR-(RR3RuR%R	((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyt	fromutf8b0s"(Bt
__future__RRmRtosRERRRtsysstrR.tispy3RdRwtsplitRLtintRRtsetRttAssertionErrorR
tsupports_bytes_environt_nativeenvirontenvirontenvironbtdicttitemsRt_encodingfixerstgetRtgetpreferredencodingtErrorR6R0R RR4R;R>RBRARNtFalseRURWRYR\R]RVR[R`tobjectRbRhtextendtrangetappendRgRrRsRvRiRx(((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyt<module>s–			4	=.				




	>					]									 









 86		9