%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core/17212/usr/lib/python3/dist-packages/pyudev/__pycache__/
Upload File :
Create Path :
Current File : //snap/core/17212/usr/lib/python3/dist-packages/pyudev/__pycache__/glib.cpython-35.pyc



��P��@sjdZddlmZmZmZmZddlZddlZGdd�dej�Z	ej
e	�dS)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$eZdZdZdddddddd	iZed
�ejejej	ej
ffed�ejejej
ffed�ejejej
ffed�ejejej
ffed	�ejejej
ffiZdd�Ze
d
d��Zejdd��Zdd�ZdS)�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`.
    �addzdevice-added�removezdevice-removedZchangezdevice-changedZmovezdevice-movedzdevice-eventcCs/tjj|�||_d|_d|_dS)NT)�gobject�GObject�__init__�monitor�event_source�enabled)�selfr�r�-/usr/lib/python3/dist-packages/pyudev/glib.pyrZs		zGUDevMonitorObserver.__init__cCs
|jdk	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
)rrrrr`s
zGUDevMonitorObserver.enabledcCsc|r9|jdkr9tj|jtj|j�|_n&|r_|jdk	r_tj|j�dS)N)r
�glibZio_add_watchr�IO_IN�_process_udev_eventZ
source_remove)r�valuerrrrls
cCsu|tjkrq|jjdd�}|rq|jd|j|�|jj|j�}|dk	rq|j||�dS)NZtimeoutrzdevice-eventT)rrrZpoll�emit�action�_action_signal_map�get)r�sourceZ	conditionZdevice�signalrrrrtsz(GUDevMonitorObserver._process_udev_eventN)�__name__�
__module__�__qualname__�__doc__r�strr	ZSIGNAL_RUN_LASTZ	TYPE_NONEZTYPE_STRINGZ
TYPE_PYOBJECTZ__gsignals__r�propertyr�setterrrrrrr.s"	r)rZ
__future__rrrrrr	r
rZ
type_registerrrrr�<module>"s
"Q

Zerion Mini Shell 1.0