�
��:Oc@`sjdZddlmZmZmZmZddlZddlZdejfd��YZ ej
e �dS(u�
pyudev.pygtk
============
Provide :class:`~pyudev.glib.GUDevMonitorObserver` to integrate a
:class:`~pyudev.Monitor` into a :class:`glib.MainLoop`.
To use this module, :mod:`glib` and :mod:`gobject` from PyGObject_ must be
available. PyGtk is not required.
.. _PyGObject: http://www.pygtk.org/
.. moduleauthor:: Sebastian Wiesner <lunaryorn@googlemail.com>
.. versionadded:: 0.7
i(tprint_functiontdivisiontunicode_literalstabsolute_importNtGUDevMonitorObservercB`seZdZidd6dd6dd6dd6Ziejejejejffe d �6ejejejffe d�6ejejejffe d�6ejejejffe d�6ejejejffe d�6Z
d
�Zed��Z
e
jd��Z
d
�ZRS(u
Observe a :class:`~pyudev.Monitor` and emit Glib signals upon device
events:
>>> context = pyudev.Context()
>>> monitor = pyudev.Monitor.from_netlink(context)
>>> monitor.filter_by(subsystem='input')
>>> observer = pyudev.pygtk.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`.
udevice-addeduaddudevice-removeduremoveudevice-changeduchangeudevice-movedumoveudevice-eventcC`s/tjj|�||_d|_t|_dS(N(tgobjecttGObjectt__init__tmonitortNonetevent_sourcetTruetenabled(tselfR((s//usr/lib/python2.7/site-packages/pyudev/glib.pyRTs 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.
.. versionadded:: 0.14
N(R
R (R
((s//usr/lib/python2.7/site-packages/pyudev/glib.pyRZs
cC`sf|r9|jdkr9tj|jtj|j�|_n)|rb|jdk rbtj|j�ndS(N(R
R tglibtio_add_watchRtIO_INt_process_udev_eventt
source_remove(R
tvalue((s//usr/lib/python2.7/site-packages/pyudev/glib.pyRfs
cC`sd|tjkr`|jj�}|r`|\}}|jd||�|j|j||�q`ntS(Nudevice-event(RRRtreceive_devicetemitt_action_signal_mapR(R
tsourcet conditionteventtactiontdevice((s//usr/lib/python2.7/site-packages/pyudev/glib.pyRns(t__name__t
__module__t__doc__RRtSIGNAL_RUN_LASTt TYPE_NONEtTYPE_STRINGt
TYPE_PYOBJECTtstrt__gsignals__RtpropertyRtsetterR(((s//usr/lib/python2.7/site-packages/pyudev/glib.pyR,s& (Rt
__future__RRRRRRRRt
type_register(((s//usr/lib/python2.7/site-packages/pyudev/glib.pyt<module> s
"L |