<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
5Vl                 @   s   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlmZ eej	G dd	 d	e
Zeej	G d
d deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZdS )z
    pyudev.device._errors
    =====================

    Errors raised by Device methods.

    .. moduleauthor:: Sebastian Wiesner <lunaryorn@gmail.com>
    )absolute_import)division)print_function)unicode_literalsN)add_metaclassc               @   s   e Zd ZdZdS )DeviceErrorzP
    Any error raised when messing around w/ or trying to discover devices.
    N)__name__
__module____qualname____doc__ r   r   /usr/lib/python3.6/_errors.pyr   $   s   r   c               @   s   e Zd ZdZdS )DeviceNotFoundErrorz
    An exception indicating that no :class:`Device` was found.

    .. versionchanged:: 0.5
       Rename from ``NoSuchDeviceError`` to its current name.
    N)r   r	   r
   r   r   r   r   r   r   +   s   r   c               @   s,   e Zd ZdZdd Zedd Zdd ZdS )	DeviceNotFoundAtPathErrorzh
    A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was
    found at a given path.
    c             C   s   t j| | d S )N)r   __init__)selfsys_pathr   r   r   r   ;   s    z"DeviceNotFoundAtPathError.__init__c             C   s
   | j d S )z<
        The path that caused this error as string.
        r   )args)r   r   r   r   r   >   s    z"DeviceNotFoundAtPathError.sys_pathc             C   s   dj | jS )NzNo device at {0!r})formatr   )r   r   r   r   __str__E   s    z!DeviceNotFoundAtPathError.__str__N)r   r	   r
   r   r   propertyr   r   r   r   r   r   r   5   s   r   c               @   s   e Zd ZdZdS )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   I   s   r   c               @   s   e Zd ZdZdS )#DeviceNotFoundByInterfaceIndexErrorzw
    A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was found
    from the given interface index.
    N)r   r	   r
   r   r   r   r   r   r   O   s   r   c               @   s   e Zd ZdZdS )!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 pagees.
    N)r   r	   r
   r   r   r   r   r   r   U   s   r   c               @   s8   e Zd ZdZdd Zedd Zedd Zdd	 Zd
S )DeviceNotFoundByNameErrorzj
    A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was
    found with a given name.
    c             C   s   t j| || d S )N)r   r   )r   	subsystemsys_namer   r   r   r   e   s    z"DeviceNotFoundByNameError.__init__c             C   s
   | j d S )zA
        The subsystem that caused this error as string.
        r   )r   )r   r   r   r   r   h   s    z#DeviceNotFoundByNameError.subsystemc             C   s
   | j d S )z@
        The sys name that caused this error as string.
           )r   )r   r   r   r   r   o   s    z"DeviceNotFoundByNameError.sys_namec             C   s
   dj | S )Nz+No device {0.sys_name!r} in {0.subsystem!r})r   )r   r   r   r   r   v   s    z!DeviceNotFoundByNameError.__str__N)	r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   _   s
   r   c               @   s8   e Zd ZdZdd Zedd Zedd Zdd	 Zd
S )DeviceNotFoundByNumberErrorzs
    A :exc:`DeviceNotFoundError` indicating, that no :class:`Device` was found
    for a given device number.
    c             C   s   t j| || d S )N)r   r   )r   typZnumberr   r   r   r      s    z$DeviceNotFoundByNumberError.__init__c             C   s
   | j d S )zj
        The device type causing this error as string.  Either ``'char'`` or
        ``'block'``.
        r   )r   )r   r   r   r   device_type   s    z'DeviceNotFoundByNumberError.device_typec             C   s
   | j d S )zB
        The device number causing this error as integer.
        r   )r   )r   r   r   r   device_number   s    z)DeviceNotFoundByNumberError.device_numberc             C   s
   dj | S )Nz7No {0.device_type} device with number {0.device_number})r   )r   r   r   r   r      s    z#DeviceNotFoundByNumberError.__str__N)	r   r	   r
   r   r   r   r    r!   r   r   r   r   r   r   z   s
   r   c               @   s   e Zd ZdZdd ZdS ) DeviceNotFoundInEnvironmentErrorz
    A :exc:`DeviceNotFoundError` indicating, that no :class:`Device` could
    be constructed from the process environment.
    c             C   s   dS )NzNo device found in environmentr   )r   r   r   r   r      s    z(DeviceNotFoundInEnvironmentError.__str__N)r   r	   r
   r   r   r   r   r   r   r"      s   r"   c               @   s&   e Zd ZdZdZdddZdd ZdS )	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             C   s   || _ || _|| _dS )z Initializer.

            :param object value: the value
            :param str param: the parameter
            :param str msg: an explanatory message
        N)_value_param_msg)r   valueZparammsgr   r   r   r      s    zDeviceValueError.__init__c             C   s:   | j r$| jd }|| j| j| j f S | j| j| jf S d S )Nz: %s)r&   _FMT_STRr$   r%   )r   Zfmt_strr   r   r   r      s    
zDeviceValueError.__str__)N)r   r	   r
   r   r)   r   r   r   r   r   r   r#      s   
r#   )r   Z
__future__r   r   r   r   abcZsixr   ABCMeta	Exceptionr   r   r   r   r   r   r   r   r"   r#   r   r   r   r   <module>   s$   	

