grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026a 8g+^[ã@sdZddlmZddlmZddlmZddlmZddlZddlmZeej ƒGdd „d e ƒƒZ eej ƒGd d „d e ƒƒZ Gd d „d e ƒZ Gdd„de ƒZGdd„de ƒZGdd„de ƒZGdd„de ƒZGdd„de ƒZGdd„de ƒZGdd„de ƒZdS)zš pyudev.device._errors ===================== Errors raised by Device methods. .. moduleauthor:: Sebastian Wiesner é)Úabsolute_import)Údivision)Úprint_function)Úunicode_literalsN)Ú add_metaclassc@seZdZdZdS)Ú 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$src@seZdZdZdS)ÚDeviceNotFoundErrorzŸ An exception indicating that no :class:`Device` was found. .. versionchanged:: 0.5 Rename from ``NoSuchDeviceError`` to its current name. Nrr r r rr+src@s,eZdZdZdd„Zedd„ƒZdd„ZdS) ÚDeviceNotFoundAtPathErrorzh A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was found at a given path. cCst ||¡dS©N©rÚ__init__)ÚselfÚsys_pathr r rr;sz"DeviceNotFoundAtPathError.__init__cCs |jdS)z< The path that caused this error as string. r©Úargs©rr r rr>sz"DeviceNotFoundAtPathError.sys_pathcCs d |j¡S)NzNo device at {0!r})Úformatrrr r rÚ__str__Esz!DeviceNotFoundAtPathError.__str__N)r r r r rÚpropertyrrr r r rr5s  rc@seZdZdZdS)ÚDeviceNotFoundByFileErrorzp A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was found from the given filename. Nrr r r rrIsrc@seZdZdZdS)Ú#DeviceNotFoundByInterfaceIndexErrorzw A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was found from the given interface index. Nrr r r rrPsrc@seZdZdZdS)Ú!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. Nrr r r rrWsrc@s8eZdZdZdd„Zedd„ƒZedd„ƒZdd „Zd S) ÚDeviceNotFoundByNameErrorzj A :exc:`DeviceNotFoundError` indicating that no :class:`Device` was found with a given name. cCst |||¡dSrr)rÚ subsystemÚsys_namer r rrgsz"DeviceNotFoundByNameError.__init__cCs |jdS)zA The subsystem that caused this error as string. rrrr r rr jsz#DeviceNotFoundByNameError.subsystemcCs |jdS)z@ The sys name that caused this error as string. érrr r rr!qsz"DeviceNotFoundByNameError.sys_namecCs d |¡S)Nz+No device {0.sys_name!r} in {0.subsystem!r}©rrr r rrxsz!DeviceNotFoundByNameError.__str__N) r r r r rrr r!rr r r rras  rc@s8eZdZdZdd„Zedd„ƒZedd„ƒZdd „Zd S) ÚDeviceNotFoundByNumberErrorzs A :exc:`DeviceNotFoundError` indicating, that no :class:`Device` was found for a given device number. cCst |||¡dSrr)rÚtypZnumberr r rr‚sz$DeviceNotFoundByNumberError.__init__cCs |jdS)zj The device type causing this error as string. Either ``'char'`` or ``'block'``. rrrr r rÚ device_type…sz'DeviceNotFoundByNumberError.device_typecCs |jdS)zB The device number causing this error as integer. r"rrr r rÚ device_number�sz)DeviceNotFoundByNumberError.device_numbercCs d |¡S)Nz7No {0.device_type} device with number {0.device_number}r#rr r rr”sÿz#DeviceNotFoundByNumberError.__str__N) r r r r rrr&r'rr r r rr$|s  r$c@seZdZdZdd„ZdS)Ú DeviceNotFoundInEnvironmentErrorz� A :exc:`DeviceNotFoundError` indicating, that no :class:`Device` could be constructed from the process environment. cCsdS)NzNo device found in environmentr rr r rrŸsz(DeviceNotFoundInEnvironmentError.__str__N)r r r r rr r r rr(™sr(c@s&eZdZdZdZddd„Zdd„ZdS) Ú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 unacceptableNcCs||_||_||_dS)z¡ Initializer. :param object value: the value :param str param: the parameter :param str msg: an explanatory message N)Ú_valueÚ_paramÚ_msg)rÚvalueZparamÚmsgr r rr¬szDeviceValueError.__init__cCs6|jr$|jd}||j|j|jfS|j|j|jfS)Nz: %s)r,Ú_FMT_STRr*r+)rZfmt_strr r rr¸s zDeviceValueError.__str__)N)r r r r r/rrr r r rr)£s r))r Z __future__rrrrÚabcZsixrÚABCMetaÚ Exceptionrrrrrrrr$r(r)r r r rÚs$