File: //snap/core22/2111/lib/python3/dist-packages/pyudev/__pycache__/wx.cpython-310.pyc
o
8g+^� � @ s� d Z ddlmZmZmZmZ ddlmZmZ ddl m
Z
ddlZe
� \ZZ
G dd� de�Ze
� \ZZe
� \ZZe
� \ZZe
� \ZZG dd � d e�ZdS )
a� pyudev.wx
=========
Wx integration.
:class:`MonitorObserver` integrates device monitoring into the wxPython\_
mainloop by turing device events into wx events.
:mod:`wx` from wxPython\_ must be available when importing this module.
.. _wxPython: http://wxpython.org/
.. moduleauthor:: Tobias Eberle <tobias.eberle@gmx.de>
.. versionadded:: 0.14
� )�print_function�division�unicode_literals�absolute_import)�
EvtHandler� PostEvent)�NewEventNc @ sJ e Zd ZdZdd� Zedd� �Zejdd� �Zdd� Zd d
� Z dd� Z
d
S )�MonitorObservera�
An observer for device events integrating into the :mod:`wx` mainloop.
This class inherits :class:`~wx.EvtHandler` to turn device events into
wx events:
>>> from pyudev import Context, Monitor
>>> from pyudev.wx import MonitorObserver
>>> context = Context()
>>> monitor = Monitor.from_netlink(context)
>>> monitor.filter_by(subsystem='input')
>>> observer = MonitorObserver(monitor)
>>> def device_event(event):
... print('action {0} on device {1}'.format(event.device.action, event.device))
>>> observer.Bind(EVT_DEVICE_EVENT, device_event)
>>> monitor.start()
This class is a child of :class:`wx.EvtHandler`.
.. versionadded:: 0.17
c C s"