ok
Direktori : /proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/pyudev/ |
Current File : //proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/pyudev/glib.pyo |
� ��:Oc @` sj d Z d d l m Z m Z m Z m Z d d l Z d d l Z d e j f d � � YZ e j e � d S( 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 ( t print_functiont divisiont unicode_literalst absolute_importNt GUDevMonitorObserverc B` s e Z d Z i d d 6d d 6d d 6d d 6Z i e j e j e j e j f f e d � 6e j e j e j f f e d � 6e j e j e j f f e d � 6e j e j e j f f e d � 6e j e j e j f f e d � 6Z d � Z e d � � Z e j d � � Z d � Z RS( 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`. u device-addedu addu device-removedu removeu device-changedu changeu device-movedu moveu device-eventc C` s/ t j j | � | | _ d | _ t | _ d S( N( t gobjectt GObjectt __init__t monitort Nonet event_sourcet Truet enabled( t selfR ( ( s/ /usr/lib/python2.7/site-packages/pyudev/glib.pyR T s c C` s | j d k 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.pyR Z s c C` sf | r9 | j d k r9 t j | j t j | j � | _ n) | rb | j d k rb t j | j � n d S( N( R R t glibt io_add_watchR t IO_INt _process_udev_eventt source_remove( R t value( ( s/ /usr/lib/python2.7/site-packages/pyudev/glib.pyR f s c C` sd | t j k r` | j j � } | r` | \ } } | j d | | � | j | j | | � q` n t S( Nu device-event( R R R t receive_devicet emitt _action_signal_mapR ( R t sourcet conditiont eventt actiont device( ( s/ /usr/lib/python2.7/site-packages/pyudev/glib.pyR n s ( t __name__t __module__t __doc__R R t SIGNAL_RUN_LASTt TYPE_NONEt TYPE_STRINGt TYPE_PYOBJECTt strt __gsignals__R t propertyR t setterR ( ( ( s/ /usr/lib/python2.7/site-packages/pyudev/glib.pyR , s&