-=[ Mr. Bumblebee ]=-
_Indonesia_

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

ó
î:ïNc@@s‹dZddlmZddlZddlmZdefd„ƒYZd„Zd„Z	d	„Z
ejZeekr‡e
d
ƒ‚ndS(s<Lazily compiled regex objects.

This module defines a class which creates proxy objects for regex
compilation.  This allows overriding re.compile() to return lazily compiled
objects.  

We do this rather than just providing a new interface so that it will also
be used by existing Python modules that create regexs.
i(tabsolute_importN(terrorst	LazyRegexc
B@seZdZddddddddd	d
g
Zddd
geZdid„Zd„Zd„Zd„Zd„Z	d„Z
RS(sDA proxy around a real regex, which won't be compiled until accessed.t__copy__t__deepcopy__tfindalltfinditertmatchtscannertsearchtsplittsubtsubnt_real_regext_regex_argst
_regex_kwargscC@sd|_||_||_dS(sÁCreate a new proxy object, passing in the args to pass to re.compile

        :param args: The `*args` to pass to re.compile
        :param kwargs: The `**kwargs` to pass to re.compile
        N(tNoneR
RR(tselftargstkwargs((s5/usr/lib/python2.7/dist-packages/bzrlib/lazy_regex.pyt__init__2s		cC@sO|j|j|jŽ|_x-|jD]"}t||t|j|ƒƒq%WdS(s$Actually compile the requested regexN(t_real_re_compileRRR
t_regex_attributes_to_copytsetattrtgetattr(Rtattr((s5/usr/lib/python2.7/dist-packages/bzrlib/lazy_regex.pyt_compile_and_collapse<scO@sSyt||ŽSWn;tjk
rN}tjd|ddt|ƒƒ‚nXdS(s%Thunk over to the original re.compilet"is" N(RtreterrorRtInvalidPatterntstr(RRRte((s5/usr/lib/python2.7/dist-packages/bzrlib/lazy_regex.pyRCscC@si|jd6|jd6S(s&Return the state to use when pickling.RR(RR(R((s5/usr/lib/python2.7/dist-packages/bzrlib/lazy_regex.pyt__getstate__Ls
cC@s5d|_t|d|dƒt|d|dƒdS(sRestore from a pickled state.RRRRN(RR
R(Rtdict((s5/usr/lib/python2.7/dist-packages/bzrlib/lazy_regex.pyt__setstate__Ss	cC@s,|jdkr|jƒnt|j|ƒS(srReturn a member from the proxied regex object.

        If the regex hasn't been compiled yet, compile it
        N(R
RRR(RR((s5/usr/lib/python2.7/dist-packages/bzrlib/lazy_regex.pyt__getattr__Ys
((t__name__t
__module__t__doc__Rt	__slots__RRRR!R#R$(((s5/usr/lib/python2.7/dist-packages/bzrlib/lazy_regex.pyR"s
					cO@s
t||ƒS(sjCreate a proxy object which will compile the regex on demand.

    :return: a LazyRegex proxy object.
    (R(RR((s5/usr/lib/python2.7/dist-packages/bzrlib/lazy_regex.pytlazy_compileescC@s
tt_dS(s¹Make lazy_compile the default compile mode for regex compilation.

    This overrides re.compile with lazy_compile. To restore the original
    functionality, call reset_compile().
    N(R)Rtcompile(((s5/usr/lib/python2.7/dist-packages/bzrlib/lazy_regex.pytinstall_lazy_compilemscC@s
tt_dS(sRestore the original function to re.compile().

    It is safe to call reset_compile() multiple times, it will always
    restore re.compile() to the value that existed at import time.
    Though the first call will reset back to the original (it doesn't
    track nesting level)
    N(RRR*(((s5/usr/lib/python2.7/dist-packages/bzrlib/lazy_regex.pyt
reset_compilevss_re.compile has already been overridden as lazy_compile, but this would cause infinite recursion(R't
__future__RRtbzrlibRtobjectRR)R+R,R*RtAssertionError(((s5/usr/lib/python2.7/dist-packages/bzrlib/lazy_regex.pyt<module>sC					

Copyright © 2017 || Recoded By Mr.Bumblebee