Spade
Mini Shell
| Directory:~$ /lib/python2.7/site-packages/pyudev/ |
| [Home] [System Details] [Kill Me] |
�
��:Oc@`s�dZddlmZmZmZmZddlmZmZddl m
Z
ddlmZe
�\Z
Ze
�\ZZe
�\ZZe
�\ZZe
�\ZZdefd��YZdS( u>
pyudev.wx
=========
Provides :class:`~pyudev.wx.WXUDevMonitorObserver` to integrate a
:class:`~pyudev.Monitor` into a :meth:`wx.App.MainLoop`.
To use this module, :mod:`wx` from wxPython must be available.
.. moduleauthor:: Tobias Eberle <tobias.eberle@gmx.de>
.. versionadded:: 0.14
i(tprint_functiontdivisiontunicode_literalstabsolute_import(t
EvtHandlert PostEvent(tNewEvent(tMonitorObservertWxUDevMonitorObservercB`sueZdZied6ed6ed6ed6Zd�Ze d��Z
e
jd��Z
d�Zd �Z
d
�ZRS(u�
Observe a :class:`~pyudev.Monitor` and post wx events upon device
events:
>>> context = pyudev.Context()
>>> monitor = pyudev.Monitor.from_netlink(context)
>>> monitor.filter_by(subsystem='input')
>>> observer = pyudev.wx.WxUDevMonitorObserver(monitor)
>>> def device_connected(event):
... print('{0!r} added'.format(event.device))
>>> observer.Bind(EVT_DEVICE_ADDED, device_connected)
>>> monitor.start()
This class is a child of :class:`wx.EvtHandler`.
uadduremoveuchangeumovecC`s-tj|�||_d|_|j�dS(N(Rt__init__tmonitortNonet_observer_threadtstart(tselfR
((s-/usr/lib/python2.7/site-packages/pyudev/wx.pyR Cs
cC`s
|jdk S(u�
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.
N(RR(R((s-/usr/lib/python2.7/site-packages/pyudev/wx.pytenabledIscC`s!|r|j�n
|j�dS(N(R
tstop(Rtvalue((s-/usr/lib/python2.7/site-packages/pyudev/wx.pyRSs
cC`sB|jdk rdSt|j|jdd�|_|jj�dS(u`
Enable this observer.
Do nothing, if the observer is already enabled.
Ntnameuwx-observer-thread(RRRR
t_emit_eventsR
(R((s-/usr/lib/python2.7/site-packages/pyudev/wx.pyR
Zs
cC`s$|jdkrdS|jj�dS(ub
Disable this observer.
Do nothing, if the observer is already disabled.
N(RRR(R((s-/usr/lib/python2.7/site-packages/pyudev/wx.pyRfscC`sCt|td|d|��|j|}t||d|��dS(Ntactiontdevice(RtDeviceEventt_action_event_map(RRRtevent_class((s-/usr/lib/python2.7/site-packages/pyudev/wx.pyRps
(t__name__t
__module__t__doc__tDeviceAddedEventtDeviceRemovedEventtDeviceChangedEventtDeviceMovedEventRR tpropertyRtsetterR
RR(((s-/usr/lib/python2.7/site-packages/pyudev/wx.pyR,s
N(Rt
__future__RRRRtwxRRtwx.lib.neweventRtpyudev.monitorRRtEVT_DEVICE_EVENTRtEVT_DEVICE_ADDEDRtEVT_DEVICE_REMOVEDRtEVT_DEVICE_CHANGEDRtEVT_DEVICE_MOVEDR(((s-/usr/lib/python2.7/site-packages/pyudev/wx.pyt<module>s"