-=[ Mr. Bumblebee ]=-
_Indonesia_

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

ó
î:ïNc@@sdZddlmZddddddd	d
gZddlZddlmaddlZd
Zd„Zd„Z	d„Z
d„Zd„Zd„Z
d„Zd„Zd„Zdefd„ƒYZdd„Zd„Zd„Zed„Zed„ZdS(sESymbol versioning

The methods here allow for api symbol versioning.
i(tabsolute_importtdeprecated_functiont
deprecated_intdeprecated_listtdeprecated_methodtDEPRECATED_PARAMETERtdeprecated_passedtset_warning_methodtwarnN(RsA deprecated parameter marker.cC@sdtj|ƒS(sGenerate a message that something was deprecated in a release.

    >>> deprecated_in((1, 4, 0))
    '%s was deprecated in version 1.4.0.'
    s!%%s was deprecated in version %s.(tbzrlibt_format_version_tuple(t
version_tuple((s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyR-scC@s
|adS(s‚Set the warning method to be used by this module.

    It should take a message and a warning category as warnings.warn does.
    N(R(tmethod((s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyR7scC@s[t|ddƒdkr1d|j|jf}n"d|jj|jj|jf}||S(soGenerate an automatic deprecation string for a_callable.

    :param a_callable: The callable to substitute into deprecation_version.
    :param deprecation_version: A deprecation format warning string. This should
        have a single %s operator in it. a_callable will be turned into a nice
        python symbol and then substituted into deprecation_version.
    tim_classs%s.%ss%s.%s.%sN(tgetattrtNonet
__module__t__name__R
(t
a_callabletdeprecation_versiontsymbol((s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pytdeprecation_stringFs
		
c@s‡fd†}|S(s=Decorate a function so that use of it will trigger a warning.c@s)‡‡fd†}tˆˆd|ƒ|S(s<This is the function python calls to perform the decoration.c@sIddlm}|jddƒttˆˆƒtddƒˆ||ŽS(sThis is the decorated function.i(ttraceisDeprecated function calledt
stackleveli(R	Rtmutter_callsiteRRtDeprecationWarning(targstkwargsR(tcallableR(s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pytdecorated_functionas

tfunction(t_populate_decorated(RR(R(Rs</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pytfunction_decorator^s((RR ((Rs</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyR[s
c@s‡fd†}|S(sêDecorate a method so that use of it will trigger a warning.

    To deprecate a static or class method, use

        @staticmethod
        @deprecated_function
        def ...

    To deprecate an entire class, decorate __init__.
    c@s)‡‡fd†}tˆˆd|ƒ|S(s<This is the function python calls to perform the decoration.c@s—ddlm}ˆjdkr>d|jj|jjf}n"d|jj|jjˆjf}|jddƒtˆ|tdd	ƒˆ|||ŽS(
sThis is the decorated method.i(Rt__init__s%s.%ss%s.%s.%sisDeprecated method calledRi(R	RRt	__class__RRRR(tselfRRRR(RR(s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pytdecorated_method}s	
R(R(RR$(R(Rs</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pytmethod_decoratorzs((RR%((Rs</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyRnscC@s
|tk	S(s(Return True if parameter_value was used.(R(tparameter_value((s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyR’scC@sß|jr|jjdƒ}ng}t|ƒdkrJ|d||_n‘t|ƒdkrƒ|jdd|d|d|_nXt|dƒ}|j}|dd|7}||d|7}|dd|7}||_dS(Ns
isThis iiÿÿÿÿt (t__doc__tsplittlen(RRtlabeltdecorated_callabletdocstring_linestspacestnew_doc((s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyt_decorate_docstring¥s	'	cC@s8t||||ƒ|j|_|j|_t|_dS(sMPopulate attributes like __name__ and __doc__ on the decorated callable.
    N(R0RRtTruet
is_deprecated(RRR+R,((s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyR¼s
c@s‡fd†}|S(s?Returns a closure that emits a warning and calls the superclassc@s`d|jf}|j|f}|jr=|d|j7}nt|tddƒˆ|||ŽS(Nsaccess to %sR'Ri(t_variable_namet_deprecation_versiont_adviceRR(tdep_dictRRtmsg(twrapped_method(s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pytcbÉs	((R8R9((R8s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyt_dict_deprecation_wrapperÇstDeprecatedDictcB@sweZdZeZd„ZeejƒZeej	ƒZ	eej
ƒZ
eejƒZeejƒZeej
ƒZ
RS(s1A dictionary that complains when read or written.cC@s/||_||_||_tj||ƒdS(sCreate a dict that warns when read or modified.

        :param deprecation_version: string for the warning format to raise,
            typically from deprecated_in()
        :param initial_value: The contents of the dict
        :param variable_name: This allows better warnings to be printed
        :param advice: String of advice on what callers should do instead
            of using this variable.
        N(R4R3R5tdictR!(R#Rt
variable_namet
initial_valuetadvice((s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyR!Øs			(RRR(R1R2R!R:R<t__len__t__getitem__t__setitem__t__delitem__tkeyst__contains__(((s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyR;Ós	c@sZdˆf}||f‰|r1ˆd|7‰ndtf‡‡fd†ƒY}||ƒS(sPCreate a list that warns when modified

    :param deprecation_version: string for the warning format to raise,
        typically from deprecated_in()
    :param initial_value: The contents of the list
    :param variable_name: This allows better warnings to be printed
    :param extra: Extra info to print when printing a warning
    sModifying %sR't_DeprecatedListc@sxeZejˆZeZ‡fd†Z‡fd†Z‡fd†Z‡fd†Z	‡fd†Z
d‡fd†ZRS(c@s#tˆtddƒ||||ŽS(NRi(RR(R#tfuncRR(R7(s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyt_warn_deprecatedsc@sdˆf|jtj|ƒS(Nsappending to %s is deprecated(RHtlisttappend(R#tobj(R=(s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyRJsc@s!dˆf|jtj||ƒS(Nsinserting to %s is deprecated(RHRItinsert(R#tindexRK(R=(s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyRLsc@sdˆf|jtj|ƒS(Nsextending %s is deprecated(RHRItextend(R#titerable(R=(s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyRNsc@sdˆf|jtj|ƒS(Nsremoving from %s is deprecated(RHRItremove(R#tvalue(R=(s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyRPsc@s8dˆf|r$|jtj|ƒS|jtjƒSdS(Nspop'ing from %s is deprecated(RHRItpop(R#RM(R=(s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyRRsN(
RRRIR(R1R2RHRJRLRNRPRRR((R7R=(s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyRFs
(RI(RR=R>textrat
subst_textRF((R7R=s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyRös

!cC@sIxBtjD]7}tt|dƒr
|s:|ddkrAtSq
q
WtS(s®Check if there is already a filter for deprecation warnings.

    :param error_only: Only match an 'error' filter
    :return: True if a filter is found, False otherwise
    iiterror(twarningstfilterst
issubclassRR1tFalse(t
error_onlytfilter((s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyt_check_for_filter*s
c@s‡fd†}|S(sÄBuild and returns a callable removing filter from the warnings.

    :param filter: The filter to remove (can be None).

    :return: A callable that will remove filter from warnings.filters.
    c@sˆrtjjˆƒndS(N(RVRWRP((R[(s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pytcleanup?s((R[R]((R[s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyt_remove_filter_callable8scC@sI|rtdtƒrd}n tjddtƒtjd}t|ƒS(s¼Call this function to suppress all deprecation warnings.

    When this is a final release version, we don't want to annoy users with
    lots of deprecation warnings. We only want the deprecation warnings when
    running a dev or release candidate.

    :param override: If True, always set the ignore, if False, only set the
        ignore if there isn't already a filter.

    :return: A callable to remove the new warnings this added.
    RZtignoretcategoryiN(R\RYRRVtfilterwarningsRRWR^(toverrideR[((s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pytsuppress_deprecation_warningsEs
	
cC@sI|rtdtƒrd}n tjddtƒtjd}t|ƒS(sÝCall this function to activate deprecation warnings.

    When running in a 'final' release we suppress deprecation warnings.
    However, the test suite wants to see them. So when running selftest, we
    re-enable the deprecation warnings.

    Note: warnings that have already been issued under 'ignore' will not be
    reported after this point. The 'warnings' module has already marked them as
    handled, so they don't get issued again.

    :param override: If False, only add a filter if there isn't an error filter
        already. (This slightly differs from suppress_deprecation_warnings, in
        because it always overrides everything but -Werror).

    :return: A callable to remove the new warnings this added.
    RZtdefaultR`iN(R\R1RRVRaRRWR^(RbR[((s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pytactivate_deprecation_warnings[s
	
(R(t
__future__Rt__all__RVRR	RRRRRRRR0RR:R<R;RRR\R^R1RcRe(((s</usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.pyt<module>s8		
				$				$3		


Copyright © 2017 || Recoded By Mr.Bumblebee