-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/bzrlib/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/bzrlib/globbing.pyc

ó
î:ïNc@@s–dZddlmZddlZddlmZmZddlmZm	Z	de
fd„ƒYZeƒZej
dd	ƒej
d
dƒej
dd
ƒej
ddƒej
ddƒej
ddƒd„Zd„Zd„ZeƒZej
ddƒej
ddƒej
dedƒƒej
dedƒƒej
deƒeƒZej
deƒej
deƒej
d dƒej
d!d"ƒej
d#d$ƒej
d%d&ƒej
d'd(ƒej
d)d*ƒeƒZej
deƒej
d!d"ƒej
d#d$ƒej
d'd+ƒej
d)d,ƒd-„Zd.e
fd/„ƒYZd0e
fd1„ƒYZd2efd3„ƒYZejd4ƒZd5„ZdS(6s‹Tools for converting globs to regular expressions.

This module provides functions for converting shell-like globs to regular
expressions.
i(tabsolute_importN(terrorst
lazy_regex(tmuttertwarningtReplacercB@sMeZdZejdƒZdd„Zd„Zd„Z	d„Z
d„ZRS(s+Do a multiple-pattern substitution.

    The patterns and substitutions are combined into one, so the result of
    one replacement is never substituted again. Add the patterns and
    replacements via the add method and then call the object. The patterns
    must not contain capturing groups.
    u\\&cC@sLd|_|r6t|jƒ|_t|jƒ|_ng|_g|_dS(N(tNonet_pattlistt_patst_funs(tselftsource((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyt__init__0s		cC@s-d|_|jj|ƒ|jj|ƒdS(s^Add a pattern and replacement.

        The pattern must not contain capturing groups.
        The replacement might be either a string template in which \& will be
        replaced with the match, or a function that will get the matching text
        as argument. It does not get match object, because capturing is
        forbidden anyway.
        N(RRR	tappendR
(Rtpattfun((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pytadd9s		cC@s3d|_|jj|jƒ|jj|jƒdS(s—Add all patterns from another replacer.

        All patterns and replacements from replacer are appended to the ones
        already defined.
        N(RRR	textendR
(Rtreplacer((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pytadd_replacerFs	cC@s]|jsGtjdjg|jD]}d|^qƒtjƒ|_n|jj|j|ƒS(Nu|u(%s)(	RRtlazy_compiletjoinR	tretUNICODEtsubt_do_sub(Rttexttp((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyt__call__Ps
	&cC@sV|j|jd}t|dƒr6||jdƒƒS|jj|jdƒ|ƒSdS(NiRi(R
t	lastindexthasattrtgroupt_expandR(RtmR((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyRWsN(t__name__t
__module__t__doc__RRR!RR
RRRR(((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyR%s		
	
	u\[:digit:\]u\du\[:space:\]u\su\[:alnum:\]u\wu\[:ascii:\]u\0-\x7fu\[:blank:\]u \tu\[:cntrl:\]u\0-\x1f\x7f-\x9fcC@sB|dd	kr)dt|dd!ƒdSdt|dd!ƒdS(
Niu!u^u[^iiÿÿÿÿu]u[(u!u^(t
_sub_named(R"((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyt
_sub_grouphsc@s‡fd†}|S(Nc@std|ˆfƒˆS(NuA'%s' not allowed within a regular expression. Replacing with '%s'(R(R"(trepl(s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyt_os((R(R)((R(s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyt_invalid_regexnscC@s,t|ƒddkr(tdƒ|d S|S(s±Check trailing backslashes.

    Does a head count on trailing backslashes to ensure there isn't an odd
    one on the end that would escape the brackets we wrap the RE in.
    iiuQRegular expressions cannot end with an odd number of '\'. Dropping the final '\'.iÿÿÿÿ(tlenR(R"((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyt_trailing_backslashes_regexvs
u^RE:uu\((?!\?)u(?:u	\(\?P<.*>u
\(\?P=[^)]*\)u\\+$u^RE:.*u \[\^?\]?(?:[^][]|\[:[^]]+:\])+\]u(?:(?<=/)|^)(?:\.?/)+u\\.u\&u[(){}|^$+.]u\\&u(?:(?<=/)|^)\*\*+/u(?:.*/)?u\*+u[^/]*u\?u[^/]u.*u.cC@st|dƒS(Ni(t
_sub_basename(tpattern((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyt_sub_extensionžstGlobstercB@sžeZdZdddgZiied6dd6d6ied6dd6d6ied6dd6d6Zd	„Zdd
„Z	d„Z
ed„ƒZed
„ƒZ
RS(swA simple wrapper for a set of glob patterns.

    Provides the capability to search the patterns to find a match for
    a given filename (including the full path).

    Patterns are translated to regular expressions to expidite matching.

    The regular expressions for multiple patterns are aggregated into
    a super-regex containing groups of up to 99 patterns.
    The 99 limitation is due to the grouping limit of the Python re module.
    The resulting super-regex and associated patterns are stored as a list of
    (regex,[patterns]) in _regex_patterns.

    For performance reasons the patterns are categorised as extension patterns
    (those that match against a file extension), basename patterns
    (those that match against the basename of the filename),
    and fullpath patterns (those that match against the full path).
    The translations used for extensions and basenames are relatively simpler
    and therefore faster to perform than the fullpath patterns.

    Also, the extension patterns are more likely to find a match and
    so are matched first, then the basename patterns, then the fullpath
    patterns.
    t	extensiontbasenametfullpatht
translators(?:.*/)?(?!.*/)(?:.*\.)tprefixs(?:.*/)?(?!.*/)tcC@s£g|_igd6gd6gd6}x4|D],}t|ƒ}|tj|ƒj|ƒq+Wtj}x8tjD]-}|j||||d||dƒqnWdS(NR1R2R3R4R5(t_regex_patternstnormalize_patternR0tidentifyRtpattern_infot
pattern_typest
_add_patterns(Rtpatternst
pattern_listsRtpitt((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyR
Ðs	

	cC@s„x}|rg|d D]}d||ƒ^q}d|dj|ƒf}|jjtj|tjƒ|d fƒ|d}qWdS(Nics(%s)s	%s(?:%s)$t|(RR7RRRRR(RR=R4R5Rt
grouped_rulestjoined_rule((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyR<ßs	'	c	C@sÞyBx;|jD]0\}}|j|ƒ}|r
||jdSq
WWn•tjk
rÙ}td|jƒd|_d}xH|jD]=\}}x.|D]&}tj|ƒs“|d|7}q“q“Wq€W|j|7_|‚nXdS(sSearches for a pattern that matches the given filename.

        :return A matching pattern or None if there is no matching pattern.
        is#Invalid pattern found in regex: %s.s6File ~/.bazaar/ignore or .bzrignore contains error(s).R6s
  %sN(
R7tmatchRRtInvalidPatternRtmsgR0tis_pattern_validR(	RtfilenametregexR=RDtetbad_patternsR)R((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyRDës 	

cC@s:|jdƒsd|krdS|jdƒr2dSdSdS(sºReturns pattern category.

        :param pattern: normalized pattern.
        Identify if a pattern is fullpath, basename or extension
        and returns the appropriate type.
        uRE:u/R3u*.R1R2N(t
startswith(R.((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyR9s
cC@syt}tjtj|ƒd}d||ƒ}y&tj|tjƒ}|jdƒWnt	j
k
rt}t}nX|S(s¼Returns True if pattern is valid.

        :param pattern: Normalized pattern.
        is_pattern_valid() assumes pattern to be normalized.
        see: globbing.normalize_pattern
        R4s(%s)R6(tTrueR0R:R9RRRRtsearchRREtFalse(R.tresultR4ttpatterntre_objRJ((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyRGs
(R#R$R%R;R/R-t
_sub_fullpathR:R
R<RDtstaticmethodR9RG(((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyR0¢s"		tExceptionGlobstercB@s eZdZd„Zd„ZRS(sÁA Globster that supports exception patterns.
    
    Exceptions are ignore patterns prefixed with '!'.  Exception
    patterns take precedence over regular patterns and cause a 
    matching filename to return None from the match() function.  
    Patterns using a '!!' prefix are highest precedence, and act 
    as regular ignores. '!!' patterns are useful to establish ignores
    that apply under paths specified by '!' exception patterns.
    cC@s¥gggg}xm|D]e}|jdƒrC|dj|dƒq|jdƒrj|dj|dƒq|dj|ƒqWg|D]}t|ƒ^q†|_dS(Nu!!iu!ii(RLRR0t_ignores(RR=tignoresRti((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyR
1s
cC@sV|jdj|ƒ}|r$d|S|jdj|ƒr>dS|jdj|ƒSdS(sSearches for a pattern that matches the given filename.

        :return A matching pattern or None if there is no matching pattern.
        is!!%siiN(RVRDR(RRHt
double_neg((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyRD<s(R#R$R%R
RD(((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyRU&s		t_OrderedGlobstercB@seZdZd„ZRS(s$A Globster that keeps pattern order.cC@seg|_xU|D]M}t|ƒ}tj|ƒ}|j|gtj|dtj|dƒqWdS(sIConstructor.

        :param patterns: sequence of glob patterns
        R4R5N(R7R8R0R9R<R:(RR=RR@((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyR
Ls	
(R#R$R%R
(((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyRZIss[\\/]+cC@s[|jdƒp|jdƒs3tjd|ƒ}nt|ƒdkrW|jdƒ}n|S(s…Converts backslashes in path patterns to forward slashes.

    Doesn't normalize regular expressions - they may contain escapes.
    sRE:s!RE:t/i(RLt_slashesRR+trstrip(R.((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyR8[s
(R%t
__future__RRtbzrlibRRtbzrlib.traceRRtobjectRR&RR'R*R,t_sub_reRSR-R/R0RURZRR\R8(((s3/usr/lib/python2.7/dist-packages/bzrlib/globbing.pyt<module>sT:				
				„#

Copyright © 2017 || Recoded By Mr.Bumblebee