:Oc@`sdZddlmZmZmZmZddlmZmZddl m Z ddl m Z e \Z Ze \ZZe \ZZe \ZZe \ZZdefdYZdS( 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 .. versionadded:: 0.14 i(tprint_functiontdivisiontunicode_literalstabsolute_import(t EvtHandlert PostEvent(tNewEvent(tMonitorObservertWxUDevMonitorObservercB`sueZdZied6ed6ed6ed6ZdZe dZ e j dZ dZ d 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|_|jdS(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(R R (R((s-/usr/lib/python2.7/site-packages/pyudev/wx.pytenabledIscC`s!|r|jn |jdS(N(R tstop(Rtvalue((s-/usr/lib/python2.7/site-packages/pyudev/wx.pyRSs cC`sB|jdk rdSt|j|jdd|_|jjdS(u` Enable this observer. Do nothing, if the observer is already enabled. Ntnameuwx-observer-thread(R R RR t _emit_eventsR (R((s-/usr/lib/python2.7/site-packages/pyudev/wx.pyR Zs cC`s$|jdkrdS|jjdS(ub Disable this observer. Do nothing, if the observer is already disabled. N(R R R(R((s-/usr/lib/python2.7/site-packages/pyudev/wx.pyRfscC`sCt|td|d||j|}t||d|dS(Ntactiontdevice(Rt DeviceEventt_action_event_map(RRRt event_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.pyts"