-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/mercurial/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/mercurial/encoding.pyc

ó
làÁ\c@s÷ddlZddlZddlZddlZgdjƒD]$Zeeedƒƒjdƒ^q=Z	e
ge	D]Zed^qqƒe
ddgƒks¢t‚d„Z
d	„Zid
„d6d„d
6ed6ZyIejjdƒZesejƒpÿdZejed„ƒƒZnWnejk
r:dZnXejjddƒZdZdefd„ƒYZd„Zd„ZejjddƒdkrŸdp¢dZd„Zd„Zd „Zd!ed"„Z d#„Z!d$„Z"d%„Z#d&„Z$dS('iÿÿÿÿNsO200c 200d 200e 200f 202a 202b 202c 202d 202e 206a 206b 206c 206d 206e 206f feffisutf-8isâsïcCsBd|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.pythfsignorecleans
cCsxytjWntk
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
cCsdS(Ntascii((((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyt<lambda>:st646cCsdS(NR((((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyR;ssANSI_X3.4-1968s	mac-romant
HGENCODINGRcCstS(N(tencoding(((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRCstHGENCODINGMODEtstricts
ISO-8859-1tlocalstrcBs eZdZd„Zd„ZRS(sdThis class allows strings that are unmodified to be
    round-tripped to the local encoding and backcCstj||ƒ}||_|S(N(tstrt__new__t_utf8(tclstutlR((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRLs	cCs
t|jƒS(N(thashR(tself((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyt__hash__Ps(t__name__t
__module__t__doc__RR (((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRIs	cCs)yúy[|jdƒ}tdkr%|S|jtdƒ}||jtƒkrP|St||ƒSWn˜tk
røyT|jtƒ}|jtdƒ}||jtƒkr«|St|jdƒ|ƒSWqùtk
rô|jddƒ}|jtdƒSXnXWn(tk
r$}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-8Rsutf-8thints!please check your locale settingsN(	tdecodeRtencodeRtUnicodeDecodeErrortfallbackencodingtLookupErrorterrortAbort(RRtrtk((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyttolocalSs*"

cCs±t|tƒr|jSy|jttƒjdƒSWnwtk
r…}|td|j	dƒ|j	d!}t
jd||fƒ‚n(tk
r¬}t
j|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
isinstanceRRR%RtencodingmodeR&R'tmaxtstartR*R+R)(RtinsttsubR-((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyt	fromlocals$tHGENCODINGAMBIGUOUStnarrowtwidetWFAtWFcCst|jtdƒƒS(sCFind the column width of a string for display in the local encodingR(t	ucolwidthR%R(R((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pytcolwidth«scCs]ttddƒ}|dk	rStg|D]$}||ƒtkrFdpId^q(ƒSt|ƒS(s5Find the column width of a Unicode string for displayteast_asian_widthiiN(tgetattrtunicodedatatNonetsumR8tlen(tdteawR((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyR;¯s5cCsKxDt||t|ƒƒD])}|||!}t|ƒ|kr|SqWdS(sOUse colwidth to find a c-column substring of s starting at byte
    index startN(txrangeRBR<(RR2Rtxtt((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pytgetcols¶s 
Rcsey|jtƒ‰Wnqtk
r†t|ƒ|kr9|S|tˆƒ8}|dkrgˆ|tˆƒ S|rzˆ||S|| ˆSXtˆƒ|kr|S|tˆƒ8}|dkrˈ|tˆƒ S|rò‡fd†}‡fd†}n‡fd†}‡fd†}xNtdtˆƒƒD]7}||ƒ}t|ƒ|kr&||jtƒƒ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 mercurial 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)
    +
    icsˆ|S(N((ti(R(s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRscsˆ|S(N((R(tellipsis(s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRscs	ˆ| S(N((RI(R(s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRscs|ˆS(N((R(RJ(s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRsi(R%RR'RBR;RER&(RtwidthRJtleftsidetuslicetconcatRItusub((RJRs6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyttrim¾s4>


cCsØy|jdƒ|jƒSWntk
r.nXyct|tƒrV|jjdƒ}n|jttƒ}|jƒ}||kr„|S|jtƒSWn?t	k
r¬|jƒSt
k
rÓ}tj|ddƒ‚nXdS(s9best-effort encoding-aware case-folding of local string sRsutf-8R$s!please check your locale settingsN(
R%tlowerR'R/RRRR0R&tUnicodeErrorR)R*R+(RRtluR-((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRQs"



cCsØy|jdƒ|jƒSWntk
r.nXyct|tƒrV|jjdƒ}n|jttƒ}|jƒ}||kr„|S|jtƒSWn?t	k
r¬|jƒSt
k
rÓ}tj|ddƒ‚nXdS(s9best-effort encoding-aware case-folding of local string sRsutf-8R$s!please check your locale settingsN(
R%tupperR'R/RRRR0R&RRR)R*R+(RRtuuR-((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyRT1s"



cCsÏt|tƒr|jSy|jdƒr,|SWn›tk
rÊ|jddƒjdƒ}d}d}x_|D]W}|||d!|krŸ||7}|d7}qk|tdt|ƒƒjdƒ7}qkW|SXdS(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.)
    sutf-8tignoreRiiiÜN(R/RRR%R'R&tunichrtord(Rts2R,tposR((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyttoutf8bGs



'cCs€d|kr|S|jdƒ}d}xT|D]L}t|ƒd@dkre|tt|ƒd@ƒ7}q,||jdƒ7}q,W|S(stGiven 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.

    >>> m = "\xc3\xa9\x99abcd"
    >>> n = toutf8b(m)
    >>> n
    '\xc3\xa9\xed\xb2\x99abcd'
    >>> fromutf8b(n) == m
    True
    sísutf-8RiÿiÜiÿ(R%RXtchrR&(RRR,R((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyt	fromutf8bxs
(%R*R?RtostsplitRFRWtintR&RtsetRItAssertionErrorRRt_encodingfixerstenvirontgetRtgetpreferredencodingtErrorR0R(RRR.R5R8R<R;RHtFalseRPRQRTR[R](((s6/usr/lib/python2.7/dist-packages/mercurial/encoding.pyt<module>s@$4;	
	




	=				]			1

Copyright © 2017 || Recoded By Mr.Bumblebee