Repository URL to install this package:
Version:
4.0.109 ▾
|
ó ãEYc @ sÇ d d l Z d d l Z d d l Z d d l Z d d l Z y e j Z Wn e k rb e Z n Xd Z e Z d d d Z d Z d d d d d Z d Z e d Z d Z d Z d S( iÿÿÿÿNt builtinst __builtin__t __builtins__t exceptionsc C s^ t s d S| d k r t } n | d k rA t j | d | n t j | d | d | d S( s Warns about some type of deprecation that has been (or will be) made. This helper function makes it easier to interact with the warnings module by standardizing the arguments that the warning function receives so that it is easier to use. This should be used to emit warnings to users (users can easily turn these warnings off/on, see https://docs.python.org/2/library/warnings.html as they see fit so that the messages do not fill up the users logs with warnings that they do not wish to see in production) about functions, methods, attributes or other code that is deprecated and will be removed in a future release (this is done using these warnings to avoid breaking existing users of those functions, methods, code; which a library should avoid doing by always giving at *least* N + 1 release for users to address the deprecation warnings). Nt categoryt stacklevel( t _enabledt Nonet DeprecationWarningt warningst warn( t messageR R ( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/debtcollector/_utils.pyt deprecation% s c C s3 y t | j f SWn t k r. t | j f SXd S( N( t Truet __qualname__t AttributeErrort Falset __name__( t obj( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/debtcollector/_utils.pyt get_qualified_name@ s c C s | g } | r# | j d | n | rY | d k rE | j d qY | j d | n | ro | j | n | r | j d | n d j | S( sD Helper to generate a common message 'style' for deprecation helpers.s in version '%s't ?s( and will be removed in a future versions$ and will be removed in version '%s's : %st ( t appendt join( t prefixt postfixR t versiont removal_versiont message_components( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/debtcollector/_utils.pyt generate_messageH s c C sW t j r t j Sg } x0 t j D]% } t | | r | j | q q Wt | Sd S( s: Helper to fix/workaround https://bugs.python.org/issue3445N( t sixt PY3t functoolst WRAPPER_ASSIGNMENTSt hasattrR t tuple( t decoratort assignedt attr_name( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/debtcollector/_utils.pyt get_assigned\ s c C s t | t j s! t | } n y | j t k } Wn t k rG n X| rU | j S| r~ t | d r~ d | j | j f S| j Sd S( sÛ Get class name for object. If object is a type, fully qualified name of the type is returned. Else, fully qualified name of the type of the object is returned. For builtin types, just name is returned. t __module__s %s.%sN( t isinstanceR t class_typest typeR( t _BUILTIN_MODULESR R R" ( R t fully_qualifiedt built_in( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/debtcollector/_utils.pyt get_class_nameh s c C s= t j | s d Sy t j | SWn t k r8 d SXd S( s; Gets the ``self`` object attached to this method (or none).N( t inspectt ismethodR R t get_method_selfR ( t method( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/debtcollector/_utils.pyR2 s c C sª t | } | d k r t | t j r3 | } n t | } y | j | j f } Wqqt k r | j | j | j f } qqXní t j | s¢ t j | ry | j | j f } Wqqt k rt | d rû | j } | j | j | j f } q| j | j f } qqXn] t | } | t k r5| } n y | j | j f } Wn# t k rp| j | j f } n X| d | d } } | sd j | Sd j | Sd S( se Generate a name from callable. Tries to do the best to guess fully qualified callable name. t im_classi i t .N( R2 R R) R R* R+ R( R R R R0 R1 t isfunctionR" R4 t _TYPE_TYPER ( t functiont method_selfR4 t partst modt rest( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/debtcollector/_utils.pyt get_callable_name s: ( s builtinss __builtin__s __builtins__s exceptions( R R0 t typesR R t TypeTypeR7 R R+ R, R R R R R R R' R/ R2 R= ( ( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/debtcollector/_utils.pyt <module> s$