| Server IP : 173.249.148.11 / Your IP : 216.73.216.179 Web Server : Apache/2.4.68 (AlmaLinux) System : Linux developmentwebsite.ca 4.18.0-553.168.1.el8_10.x86_64 #1 SMP Thu Sep 24 18:05:46 UTC 2026 x86_64 User : devinter ( 1006) PHP Version : 8.3.35 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /snap/core/current/usr/lib/python3/dist-packages/pyudev/__pycache__/ |
Upload File : |
��P� � @ sj d Z d d l m Z m Z m Z m Z d d l Z d d l Z Gd d � d e j � Z e j
e � d S)a�
pyudev.pygtk
============
Glib integration.
:class:`GUDevMonitorObserver` integrates device monitoring into the Glib
mainloop by turing device events into Glib signals.
:mod:`glib` and :mod:`gobject` from PyGObject_ must be available when
importing this module. PyGtk is not required.
.. _PyGObject: http://www.pygtk.org/
.. moduleauthor:: Sebastian Wiesner <lunaryorn@gmail.com>
.. versionadded:: 0.7
� )�print_function�division�unicode_literals�absolute_importNc @ s$ e Z d Z d Z d d d d d d d d i Z e d
� e j e j e j e j
f f e d � e j e j e j
f f e d � e j e j e j
f f e d � e j e j e j
f f e d � e j e j e j
f f i Z d d � Z e
d
d � � Z e j d d � � Z d d � Z d S)�GUDevMonitorObservera�
An observer for device events integrating into the :mod:`glib` mainloop.
This class inherits :class:`~gobject.GObject` to turn device events into
glib signals.
>>> from pyudev import Context, Monitor
>>> from pyudev.glib import GUDevMonitorObserver
>>> context = Context()
>>> monitor = Monitor.from_netlink(context)
>>> monitor.filter_by(subsystem='input')
>>> observer = GUDevMonitorObserver(monitor)
>>> def device_connected(observer, device):
... print('{0!r} added'.format(device))
>>> observer.connect('device-added', device_connected)
>>> monitor.start()
This class is a child of :class:`gobject.GObject`.
�addzdevice-added�removezdevice-removedZchangezdevice-changedZmovezdevice-movedzdevice-eventc C s/ t j j | � | | _ d | _ d | _ d S)NT)�gobject�GObject�__init__�monitor�event_source�enabled)�selfr � r �-/usr/lib/python3/dist-packages/pyudev/glib.pyr Z s zGUDevMonitorObserver.__init__c C s
| j d k S)z�
Whether this observer is enabled or not.
If ``True`` (the default), this observer is enabled, and emits events.
Otherwise it is disabled and does not emit any events.
.. versionadded:: 0.14
N)r
)r r r r r ` s
zGUDevMonitorObserver.enabledc C sc | r9 | j d k r9 t j | j t j | j � | _ n&