3
5ýVl ã @ s d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlmZ eej ƒG dd „ d e
ƒƒZeej ƒG d
d„ deƒƒZG dd
„ d
eƒZ
G dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZdS )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__)Ú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 dj | jƒS )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 Ú 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
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&