%PDF- %PDF-
| Direktori : /usr/lib/python3/dist-packages/pyudev/__pycache__/ |
| Current File : //usr/lib/python3/dist-packages/pyudev/__pycache__/core.cpython-312.pyc |
�
W �c�3 � � � d Z ddlmZmZ ddlmZ ddlmZ ddlm Z m
Z
mZmZ ddl
mZ G d� de� Z G d � d
e� Zy)z�
pyudev.core
===========
Core types and functions of :mod:`pyudev`.
.. moduleauthor:: Sebastian Wiesner <lunaryorn@gmail.com>
� )�ERROR_CHECKERS�
SIGNATURES)�load_ctypes_library)�DeviceNotFoundAtPathError)�ensure_byte_string�ensure_unicode_string�property_value_to_bytes�udev_list_iterate)�Devicesc � � e Zd ZdZd� Zd� Zed� � Zed� � Zed� � Z ed� � Z
e
j d� � Z
d � Zy
)�Contexta
A device database connection.
This class represents a connection to the udev device database, and is
really *the* central object to access udev. You need an instance of this
class for almost anything else in pyudev.
This class itself gives access to various udev configuration data (e.g.
:attr:`sys_path`, :attr:`device_path`), and provides device enumeration
(:meth:`list_devices()`).
Instances of this class can directly be given as ``udev *`` to functions
wrapped through :mod:`ctypes`.
c �v � t dt t � | _ | j j � | _ y)z'
Create a new context.
zlibudev.so.1N)r r r �_libudev�udev_new�_as_parameter_��selfs �-/usr/lib/python3/dist-packages/pyudev/core.py�__init__zContext.__init__7 s) � � ,�N�J��W��
�"�m�m�4�4�6��� c �T � t | d� r| j j | � y y )Nr )�hasattrr �
udev_unrefr s r �__del__zContext.__del__>