3
5Vl @ 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 /usr/lib/python3.6/_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.
N)r r r
r 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 j| | d S )N)r __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 )args)r r r r
r > s z"DeviceNotFoundAtPathError.sys_pathc C s dj | 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.
N)r r r
r 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.
N)r r r
r r r r r
r O 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 pagees.
N)r r r
r r r r r
r U 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 j| || d S )N)r r )r subsystemsys_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
dj | 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 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 j| || d S )N)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
dj | 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 Zd ZdZdd ZdS ) DeviceNotFoundInEnvironmentErrorz
A :exc:`DeviceNotFoundError` indicating, that no :class:`Device` could
be constructed from the process environment.
c C s dS )NzNo 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&