a
8g+^[ @ s d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlmZ eej G dd d e
Zeej G d
d deZG dd
d
eZ
G dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZdS )z
pyudev.device._errors
=====================
Errors raised by Device methods.
.. moduleauthor:: Sebastian Wiesner
)absolute_import)division)print_function)unicode_literalsN)
add_metaclassc @ s e Zd ZdZdS )DeviceErrorzP
Any error raised when messing around w/ or trying to discover devices.
N__name__
__module____qualname____doc__ r
r
2/usr/lib/python3.9/site-packages/pyudev/_errors.pyr $ s r c @ s e Zd ZdZdS )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 r c @ s, e Zd ZdZdd Zedd Zdd ZdS ) DeviceNotFoundAtPathErrorzh
A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was
found at a given path.
c C s t | | d S Nr __init__)selfsys_pathr
r
r r ; s z"DeviceNotFoundAtPathError.__init__c C s
| j d S )z<
The path that caused this error as string.
r argsr r
r
r r > s z"DeviceNotFoundAtPathError.sys_pathc C s d | jS )NzNo 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 Zd ZdZdS )DeviceNotFoundByFileErrorzp
A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was
found from the given filename.
Nr r
r
r
r r I s r c @ s e Zd ZdZdS )#DeviceNotFoundByInterfaceIndexErrorzw
A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was found
from the given interface index.
Nr r
r
r
r r P s r c @ s e Zd ZdZdS )!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 W s r c @ s8 e Zd ZdZdd Zedd Zedd Zdd Zd
S )DeviceNotFoundByNameErrorzj
A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was
found with a given name.
c C s t | || d S r r )r subsystemsys_namer
r
r r g 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 j 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! q s z"DeviceNotFoundByNameError.sys_namec C s
d | S )Nz+No device {0.sys_name!r} in {0.subsystem!r}r r r
r
r r x s z!DeviceNotFoundByNameError.__str__N) r r
r r r r r r! r r
r
r
r r a s
r c @ s8 e Zd ZdZdd Zedd Zedd Zdd Zd
S )DeviceNotFoundByNumberErrorzs
A :exc:`DeviceNotFoundError` indicating, that no :class:`Device` was found
for a given device number.
c C s t | || d S r r )r typZnumberr
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 | 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&