
    @ia                         d Z dZddlmZ  G d de      Z G d de      Z G d d	e      Z G d
 de      Z G d de      Z	 G d de      Z
 G d de      Zy)zD-Bus exceptions.)DBusExceptionMissingErrorHandlerExceptionMissingReplyHandlerExceptionValidationExceptionIntrospectionParserExceptionUnknownMethodExceptionNameExistsException    )is_py3c                   0    e Zd ZdZ	 d Zd Zd Zd Zd Zy)r   Fc                     |j                  dd       }|t        | dd       || _        |r+t        ddj	                  |j                               z        t        j                  | g|  y )Nname_dbus_error_namez1DBusException does not take keyword arguments: %sz, )popgetattrr   	TypeErrorjoinkeys	Exception__init__)selfargskwargsr   s       1/usr/lib/python3/dist-packages/dbus/exceptions.pyr   zDBusException.__init__/   sl    zz&$'wt-?FN$(D!O"ii67 8 84'$'    c                     t        | j                        dkD  rt        | j                        }ndj                  | j                        }| j                  | j                  d|S |S )zReturn a unicode error    : )lenr   unicoder   r   r   ss     r   __unicode__zDBusException.__unicode__8   sV     tyy>A		"A		"A  ,#44a88Hr   c                 j    t         j                  |       }| j                  | j                  d|S |S )zReturn a str errorr   )r   __str__r   r!   s     r   r%   zDBusException.__str__F   s4    d#  ,#44a88Hr   c                     t        | j                        dkD  rt        | j                        }ndj                  | j                        }t	        |t
              r|j                  dd      S |S )Nr   r   zutf-8replace)r   r   strr   
isinstancebytesdecoder!   s     r   get_dbus_messagezDBusException.get_dbus_messageN   sQ    tyy>ADIIA		"Aa88GY//r   c                     | j                   S )N)r   r   s    r   get_dbus_namezDBusException.get_dbus_nameY   s    $$$r   N)	__name__
__module____qualname__include_tracebackr   r#   r%   r,   r/    r   r   r   r   #   s&    (	%r   r   c                       e Zd ZdZd Zy)r   Tc                 0    t         j                  | d       y )Nz^error_handler not defined: if you define a reply_handler you must also define an error_handlerr   r   r.   s    r   r   z%MissingErrorHandlerException.__init__`       t  &F  	Gr   Nr0   r1   r2   r3   r   r4   r   r   r   r   \       Gr   r   c                       e Zd ZdZd Zy)r   Tc                 0    t         j                  | d       y )Nz^reply_handler not defined: if you define an error_handler you must also define a reply_handlerr7   r.   s    r   r   z%MissingReplyHandlerException.__init__g   r8   r   Nr9   r4   r   r   r   r   c   r:   r   r   c                       e Zd ZdZddZy)r   Tc                 6    t         j                  | d|z         y )NzError validating string: %sr7   r   msgs     r   r   zValidationException.__init__n   s    t%B3%FGr   Nr   r9   r4   r   r   r   r   j   s    Hr   r   c                       e Zd ZdZddZy)r   Tc                 6    t         j                  | d|z         y )Nz!Error parsing introspect data: %sr7   r?   s     r   r   z%IntrospectionParserException.__init__u   s    t%H%LMr   NrA   r9   r4   r   r   r   r   q   s    Nr   r   c                       e Zd ZdZdZd Zy)r   Tz(org.freedesktop.DBus.Error.UnknownMethodc                 6    t         j                  | d|z         y )NzUnknown method: %sr7   )r   methods     r   r   zUnknownMethodException.__init__}   s    t%9&%@Ar   N)r0   r1   r2   r3   r   r   r4   r   r   r   r   x   s    ABr   r   c                       e Zd ZdZd Zy)r   Tc                 6    t         j                  | d|z         y )NzBus name already exists: %sr7   )r   r   s     r   r   zNameExistsException.__init__   s    t%B4%GHr   Nr9   r4   r   r   r   r      s    Ir   r   N)__doc____all__dbus._compatr
   r   r   r   r   r   r   r   r   r4   r   r   <module>rL      su    4"
  7%I 7%rG= GG= GH- HN= NB] BI- Ir   