Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/apt/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/apt/deprecation.pyc

ó
WâRc@skdZddlZddlZddlZddlZgZdefd„ƒYZed„Z	d„Z
dS(s¯Classes and functions for deprecating features.

This is used for internal purposes only and not part of the official API. Do
not use it for anything outside the apt package.
iÿÿÿÿNtAttributeDeprecatedBycBs,eZdZd„Zdd„Zd„ZRS(sProperty acting as a proxy for a new attribute.

    When accessed, the property issues a DeprecationWarning and (on get) calls
    attrgetter() for the attribute 'attribute' on the current object or (on
    set) uses setattr to set the value of the wrapped attribute.
    cCs,||_d||_tj|ƒ|_dS(sInitialize the property.s#Deprecated, please use '%s' insteadN(t	attributet__doc__toperatort
attrgettertgetter(tselfR((s3/usr/lib/python2.7/dist-packages/apt/deprecation.pyt__init__*s	
cCsK|dkrt||j|ƒStj|jtddƒ|j|pG|ƒS(s;Issue a  DeprecationWarning and return the requested value.t
stackleveliN(tNonetgetattrRtwarningstwarnRtDeprecationWarningR(Rtobjttype_((s3/usr/lib/python2.7/dist-packages/apt/deprecation.pyt__get__0scCs0tj|jtddƒt||j|ƒdS(s8Issue a  DeprecationWarning and set the requested value.RiN(RRRR
tsetattrR(RRtvalue((s3/usr/lib/python2.7/dist-packages/apt/deprecation.pyt__set__7sN(t__name__t
__module__RRR	RR(((s3/usr/lib/python2.7/dist-packages/apt/deprecation.pyR"s	cs&dˆj‰‡‡‡fd†}|S(sdReturn a function that warns it is deprecated by another function.

    Returns a new function that warns it is deprecated by function 'func',
    then acts as a pass-through wrapper for 'func'.

    This function also converts all keyword argument names from mixedCase to
    lowercase_with_underscores, but only if 'convert_names' is True (default).
    s%Deprecated, please use '%s()' insteadcsktjˆtddƒˆr^x?|jƒD].}|j|ƒ|tjdd|ƒjƒ<q)Wnˆ||ŽS(s%Wrapper around a deprecated function.Ris([A-Z])s_\1(RRR
tkeystpoptretsubtlower(targstkwdstkey(t
convert_namestwarningtfunc(s3/usr/lib/python2.7/dist-packages/apt/deprecation.pytdeprecated_functionHs
/(R(R RR!((RRR s3/usr/lib/python2.7/dist-packages/apt/deprecation.pytfunction_deprecated_by=s	
csWtjs
ˆS‡fd†}ˆj|_ˆj|_ˆj|_|jjˆjƒ|S(s™A function with deprecated arguments.

    Similar to function_deprecated_by() but warns on every deprecated argument
    instead of function calls.
    csrxb|jƒD]T}tjdd|ƒjƒ}||kr
tjd|ƒ|j|ƒ||<q
q
Wˆ||ŽS(s4Wrapper around a function with deprecated arguments.s([A-Z])s_\1sDeprecated parameter %r(RRRRRRR(RRRtnew_key(R (s3/usr/lib/python2.7/dist-packages/apt/deprecation.pyR![s(tapt_pkgt_COMPAT_0_7RRRt__dict__tupdate(R R!((R s3/usr/lib/python2.7/dist-packages/apt/deprecation.pytdeprecated_argsRs	(RRRRR$t__all__tobjectRtTrueR"R((((s3/usr/lib/python2.7/dist-packages/apt/deprecation.pyt<module>s