
    9*b                         d Z ddl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	 G d de      Z
 G d de      Z G d de      Zy)z
    pyudev.device._errors
    =====================

    Errors raised by Device methods.

    .. moduleauthor:: Sebastian Wiesner <lunaryorn@gmail.com>
    Nc                   (    e Zd ZdZej
                  Zy)DeviceErrorzP
    Any error raised when messing around w/ or trying to discover devices.
    N__name__
__module____qualname____doc__abcABCMeta__metaclass__     0/usr/lib/python3/dist-packages/pyudev/_errors.pyr   r      s     KKMr   r   c                   (    e Zd ZdZej
                  Zy)DeviceNotFoundErrorz
    An exception indicating that no :class:`Device` was found.

    .. versionchanged:: 0.5
       Rename from ``NoSuchDeviceError`` to its current name.
    Nr   r   r   r   r   r   &   s     KKMr   r   c                   ,    e Zd ZdZd Zed        Zd Zy)DeviceNotFoundAtPathErrorzh
    A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was
    found at a given path.
    c                 0    t         j                  | |       y Nr   __init__)selfsys_paths     r   r   z"DeviceNotFoundAtPathError.__init__7   s    $$T84r   c                      | j                   d   S )z<
        The path that caused this error as string.
        r   argsr   s    r   r   z"DeviceNotFoundAtPathError.sys_path:       
 yy|r   c                 8    dj                  | j                        S )NzNo device at {0!r})formatr   r   s    r   __str__z!DeviceNotFoundAtPathError.__str__A   s    #**4==99r   N)r   r   r   r	   r   propertyr   r!   r   r   r   r   r   1   s%    
5  :r   r   c                       e Zd ZdZy)DeviceNotFoundByFileErrorzp
    A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was
    found from the given filename.
    Nr   r   r   r	   r   r   r   r$   r$   E       r   r$   c                       e Zd ZdZy)#DeviceNotFoundByInterfaceIndexErrorzw
    A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was found
    from the given interface index.
    Nr%   r   r   r   r(   r(   L   r&   r   r(   c                       e Zd ZdZy)!DeviceNotFoundByKernelDeviceErrorz
    A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was found
    from the given kernel device string.

    The format of the kernel device string is defined in the
    systemd.journal-fields man pages.
    Nr%   r   r   r   r*   r*   S   s    r   r*   c                   <    e Zd ZdZd Zed        Zed        Zd Zy)DeviceNotFoundByNameErrorzj
    A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was
    found with a given name.
    c                 2    t         j                  | ||       y r   r   )r   	subsystemsys_names      r   r   z"DeviceNotFoundByNameError.__init__c   s    $$T9h?r   c                      | j                   d   S )zA
        The subsystem that caused this error as string.
        r   r   r   s    r   r.   z#DeviceNotFoundByNameError.subsystemf   r   r   c                      | j                   d   S )z@
        The sys name that caused this error as string.
           r   r   s    r   r/   z"DeviceNotFoundByNameError.sys_namem   r   r   c                 $    dj                  |       S )Nz+No device {0.sys_name!r} in {0.subsystem!r}r    r   s    r   r!   z!DeviceNotFoundByNameError.__str__t   s    <CCDIIr   N)	r   r   r   r	   r   r"   r.   r/   r!   r   r   r   r,   r,   ]   s;    
@    Jr   r,   c                   <    e Zd ZdZd Zed        Zed        Zd Zy)DeviceNotFoundByNumberErrorzs
    A :exc:`DeviceNotFoundError` indicating, that no :class:`Device` was found
    for a given device number.
    c                 2    t         j                  | ||       y r   r   )r   typnumbers      r   r   z$DeviceNotFoundByNumberError.__init__~   s    $$T37r   c                      | j                   d   S )zj
        The device type causing this error as string.  Either ``'char'`` or
        ``'block'``.
        r   r   r   s    r   device_typez'DeviceNotFoundByNumberError.device_type   s     yy|r   c                      | j                   d   S )zB
        The device number causing this error as integer.
        r2   r   r   s    r   device_numberz)DeviceNotFoundByNumberError.device_number   r   r   c                 $    dj                  |       S )Nz7No {0.device_type} device with number {0.device_number}r4   r   s    r   r!   z#DeviceNotFoundByNumberError.__str__   s    KRRSWXXr   N)	r   r   r   r	   r   r"   r;   r=   r!   r   r   r   r6   r6   x   s:    
8    Yr   r6   c                       e Zd ZdZd Zy) DeviceNotFoundInEnvironmentErrorz
    A :exc:`DeviceNotFoundError` indicating, that no :class:`Device` could
    be constructed from the process environment.
    c                      y)NzNo device found in environmentr   r   s    r   r!   z(DeviceNotFoundInEnvironmentError.__str__   s    /r   N)r   r   r   r	   r!   r   r   r   r@   r@      s    
0r   r@   c                   "    e Zd ZdZdZddZd Zy)DeviceValueErrorz
    Raised when a parameter has an unacceptable value.

    May also be raised when the parameter has an unacceptable type.
    z+value '%s' for parameter %s is unacceptableNc                 .    || _         || _        || _        y)z
        Initializer.

        :param object value: the value
        :param str param: the parameter
        :param str msg: an explanatory message
        N)_value_param_msg)r   valueparammsgs       r   r   zDeviceValueError.__init__   s     	r   c                     | j                   r5| j                  dz   }|| j                  | j                  | j                   fz  S | j                  | j                  | j                  fz  S )Nz: %s)rG   _FMT_STRrE   rF   )r   fmt_strs     r   r!   zDeviceValueError.__str__   sQ    99mmf,Gdkk4;;		BBB}}T[[999r   r   )r   r   r   r	   rL   r   r!   r   r   r   rC   rC      s     =H:r   rC   )r	   r
   	Exceptionr   r   r   r$   r(   r*   r,   r6   r@   rC   r   r   r   <module>rO      s   "  )   +  : 3 :( 3 *= (; J 3 J6Y"5 Y80': 0:{ :r   