/usr/lib/python2.6/site-packages/oslo_utils
Edit: /usr/lib/python2.6/site-packages/oslo_utils/excutils.pyc (8818B)
Ñò
zDVc @ s° d Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k l Z d d k l
Z
d e f d „ ƒ YZ d „ Z
d e f d „ ƒ YZ d
„ Z d S( s
Exception related utilities.
iÿÿÿÿN( t _LE( t
reflectiont CausedByExceptionc B sG e Z d Z d d „ Z d „ Z d „ Z d „ Z d d e d „ Z RS( sç Base class for exceptions which have associated causes.
NOTE(harlowja): in later versions of python we can likely remove the need
to have a ``cause`` here as PY3+ have implemented :pep:`3134` which
handles chaining in a much more elegant manner.
:param message: the exception message, typically some string that is
useful for consumers to view when debugging or analyzing
failures.
:param cause: the cause of the exception being raised, when provided this
should itself be an exception instance, this is useful for
creating a chain of exceptions for versions of python where
this is not yet implemented/supported natively.
c C s# t t | ƒ i | ƒ | | _ d S( N( t superR t __init__t cause( t selft messageR ( ( s7 /tmp/pip-build-lt8jXN/oslo.utils/oslo_utils/excutils.pyR / s c C s | i ƒ i d ƒ S( Nt utf8( t pformatt encode( R ( ( s7 /tmp/pip-build-lt8jXN/oslo.utils/oslo_utils/excutils.pyt __bytes__3 s c C s
| i ƒ S( N( R ( R ( ( s7 /tmp/pip-build-lt8jXN/oslo.utils/oslo_utils/excutils.pyt __str__6 s c C s | i d S( Ni ( t args( R ( ( s7 /tmp/pip-build-lt8jXN/oslo.utils/oslo_utils/excutils.pyt _get_message9 s i t c C s | d j o t d | ƒ ‚ n t i ƒ } | o- | i t i | d t ƒƒ | i d ƒ n | i | i ƒ ƒ | } | i } g } xm| d j o_| | j oR| i
| ƒ | i t i ƒ t
| t ƒ oQ | i | | ƒ | i t i | d t ƒƒ | i d ƒ | i | i ƒ ƒ n t i t | ƒ | ƒ } x„ t | ƒ D]v \ } }
| i | | ƒ |
i d ƒ o |
d d !}
n | i |
ƒ | d t | ƒ j o | i t i ƒ qIqIWt
| t ƒ p Pn | | 7} t | d d ƒ } qŒ W| i ƒ S(
s9 Pretty formats a caused exception + any connected causes.i sE Provided 'indent' must be greater than or equal to zero instead of %st fully_qualifieds : s
iÿÿÿÿi R N( t
ValueErrort sixt StringIOt writeR t get_class_namet FalseR R t Nonet appendt ost linesept
isinstanceR t tracebackt format_exception_onlyt typet enumeratet endswitht lent getattrt getvalue( R t indentt indent_textt show_root_classt buft
active_indentt next_upt seent linest it line( ( s7 /tmp/pip-build-lt8jXN/oslo.utils/oslo_utils/excutils.pyR ? sF
N(
t __name__t
__module__t __doc__R R R R R R R ( ( ( s7 /tmp/pip-build-lt8jXN/oslo.utils/oslo_utils/excutils.pyR s c O s{ d | j oE t i ƒ \ } } } z | d j o | | d