Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / oslo_log / versionutils.pyc
Size: Mime:
ó
ÿ¢EYc@s{dZddlZddlZddlZddlmZddlZddlmZej	e
ƒZejZe
ƒZejddeddƒgZed	ƒZed
ƒZedƒZedƒZid
d6dd6dd6dd6dd6dd6dd6dd6dd6dd 6d!d"6Zd#„Zd$efd%„ƒYZd&„Zdd'ed(„ZiZd)„Zd*efd+„ƒYZ dS(,s(
Helpers for comparing version strings.
iÿÿÿÿN(tcfg(t_tfatal_deprecationstdefaultthelps1Enables or disables fatal status of deprecations.sg%(what)s is deprecated as of %(as_of)s in favor of %(in_favor_of)s and may be removed in %(remove_in)s.sf%(what)s is deprecated as of %(as_of)s and may be removed in %(remove_in)s. It will not be superseded.sC%(what)s is deprecated as of %(as_of)s in favor of %(in_favor_of)s.sB%(what)s is deprecated as of %(as_of)s. It will not be superseded.tBexartBtFolsomtFtGrizzlytGtHavanatHtIcehousetItJunotJtKilotKtLibertytLtMitakatMtNewtontNtOcatatOcCstjtƒdS(sÁRegister configuration options used by this library.

    .. note: This is optional since the options are also registered
        automatically when the functions in this module are used.

    N(tCONFt
register_optstdeprecated_opts(((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_log/versionutils.pytregister_optionsJst
deprecatedcBskeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dddd
„Zd„ZRS(s’A decorator to mark callables as deprecated.

    This decorator logs a deprecation message when the callable it decorates is
    used. The message will include the release where the callable was
    deprecated, the release where it may be removed and possibly an optional
    replacement. It also logs a message when a deprecated exception is being
    caught in a try-except block, but not when subclasses of that exception
    are being caught.

    Examples:

    1. Specifying the required deprecated release

    >>> @deprecated(as_of=deprecated.ICEHOUSE)
    ... def a(): pass

    2. Specifying a replacement:

    >>> @deprecated(as_of=deprecated.ICEHOUSE, in_favor_of='f()')
    ... def b(): pass

    3. Specifying the release where the functionality may be removed:

    >>> @deprecated(as_of=deprecated.ICEHOUSE, remove_in=+1)
    ... def c(): pass

    4. Specifying the deprecated functionality will not be removed:

    >>> @deprecated(as_of=deprecated.ICEHOUSE, remove_in=None)
    ... def d(): pass

    5. Specifying a replacement, deprecated functionality will not be removed:

    >>> @deprecated(as_of=deprecated.ICEHOUSE, in_favor_of='f()',
    ...             remove_in=None)
    ... def e(): pass

    .. warning::

       The hook used to detect when a deprecated exception is being
       *caught* does not work under Python 3. Deprecated exceptions
       are still logged if they are thrown.

    RRR
RRRRRRRRicCs(||_||_||_||_dS(s¹Initialize decorator

        :param as_of: the release deprecating the callable. Constants
            are define in this class for convenience.
        :param in_favor_of: the replacement for the callable (optional)
        :param remove_in: an integer specifying how many releases to wait
            before removing (default: 2)
        :param what: name of the thing being deprecated (default: the
            callable's name)

        N(tas_oftin_favor_oft	remove_intwhat(tselfR R!R"R#((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_log/versionutils.pyt__init__s			cs0tjtd|jpˆjdd|jd|jd|jƒ‰tj	ˆƒrtt
jˆƒ‡‡fd†ƒ}|Stjˆƒr ˆj
‰tjˆddƒ‡‡fd
†ƒ}|ˆ_
tjˆƒtˆtƒrdtf‡‡fd†ƒY‰t
jˆƒˆƒ‰tjˆƒnˆStd
ƒ‚dS(NR#s()R R!R"csˆƒˆ||ŽS(N((targstkwargs(tfunc_or_clstreport_deprecated(sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_log/versionutils.pytwrapped«stassignedt__name__t__doc__cs-|jtkrˆƒnˆ|||ŽdS(N(t	__class__t_DEPRECATED_EXCEPTIONS(R$R&R'(t	orig_initR)(sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_log/versionutils.pytnew_init·s
t
ExceptionMetacseZ‡‡fd†ZRS(cs,|tkrˆƒntˆ|ƒj|ƒS(N(R/tsupert__subclasscheck__(R$tsubclass(R2R)(sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_log/versionutils.pyR4Ës
(R,t
__module__R4((R2R)(sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_log/versionutils.pyR2Êss5deprecated can be used only with functions or classes(s__name__s__doc__(t	functoolstpartialtdeprecation_warningR#R,R R!R"tinspectt
isfunctiontsixtwrapstisclassR%R/taddt
issubclasst	Exceptionttypet
add_metaclasst	TypeError(R$R(R*R1((R2R(R0R)sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_log/versionutils.pyt__call__¡s(		!	'	
N(R,R6R-tBEXARtFOLSOMtGRIZZLYtHAVANAtICEHOUSEtJUNOtKILOtLIBERTYtMITAKAtNEWTONtOCATAtNoneR%RE(((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_log/versionutils.pyRTs,cCsG|dkrd}ntt|ƒ|ƒ}|tkr?t|S|SdS(Ni(RQtchrtordt	_RELEASES(treleaseR"tnew_release((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_log/versionutils.pyt_get_safe_to_remove_releaseÙs	ic	Cstd|dt|dt||ƒƒ}|rb||d<|dk	rY|dkrYt}q‰t}n'|dk	rƒ|dkrƒt}nt}t|||ƒdS(s‘Warn about the deprecation of a feature.

    :param what: name of the thing being deprecated.
    :param as_of: the release deprecating the callable.
    :param in_favor_of: the replacement for the callable (optional)
    :param remove_in: an integer specifying how many releases to wait
        before removing (default: 2)
    :param logger: the logging object to use for reporting (optional).
    R#R R"R!iN(	tdictRTRWRQt _deprecated_msg_with_alternativet+_deprecated_msg_with_alternative_no_removalt_deprecated_msg_no_alternativet._deprecated_msg_with_no_alternative_no_removaltreport_deprecated_feature(R#R R!R"tloggertdetailstmsg((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_log/versionutils.pyR9æs

			cOsŽtdƒ|}tƒtjrE|j|||Žtd|ƒ‚ntj|tƒƒ}||krjdS|j	|ƒ|j
|||ŽdS(s‹Call this function when a deprecated feature is used.

    If the system is configured for fatal deprecations then the message
    is logged at the 'critical' level and :class:`DeprecatedConfig` will
    be raised.

    Otherwise, the message will be logged (once) at the 'warn' level.

    :raises: :class:`DeprecatedConfig` if the system is configured for
             fatal deprecations.
    sDeprecated: %sR`N(RRRRtcriticaltDeprecatedConfigt_deprecated_messages_sentt
setdefaulttlisttappendtwarning(R^R`R&R'tstdmsgt	sent_args((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_log/versionutils.pyR]
s	
RbcBseZedƒZd„ZRS(s(Fatal call to deprecated config: %(msg)scCs*tt|ƒj|jtd|ƒƒdS(NR`(R3RAR%tmessageRX(R$R`((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_log/versionutils.pyR%-s(R,R6RRjR%(((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_log/versionutils.pyRb*s(!R-R7R:tloggingtoslo_configRR<toslo_log._i18nRt	getLoggerR,tLOGRtsetR/tBoolOpttFalseRRYR[RZR\RTRtobjectRRWRQR9RcR]RARb(((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_log/versionutils.pyt<module>sP						
	
…	
#