+
     h  c                   sn    R t ^ RIHt  ! R R4      t ! R R]4      tR t ! R R4      t ! R	 R
4      tR# )z
pyudev._qt_base
===============

Base mixin class for Qt4,Qt5 support.

.. moduleauthor::  Sebastian Wiesner  <lunaryorn@gmail.com>
)Devicec                   sj   a  ] tR t^t o RtR t]R 4       t]P                  R 4       tR t	R t
RtV tR# )	MonitorObserverMixinz(
Base mixin for pyqt monitor observers.
c                s    Wn         V! VP                  4       VP                  V 4      V n        V P                  P                  \
        ,          P                  V P                  4       R # N)monitorZfilenoZReadnotifierZ	activatedZintZconnect_process_udev_event)selfr   notifier_class   &&&4/usr/lib/python3.14/site-packages/pyudev/_qt_base.py_setup_notifierZ$MonitorObserverMixin._setup_notifier%   sG    &w~~'79L9LdS$,,T-E-EF    c                s6    V P                   P                  4       # )a!  
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.  This merely
reflects the state of the ``enabled`` property of the underlying
:attr:`notifier`.

.. versionadded:: 0.14
)r   Z	isEnabled)r   s   &r	   enabledMonitorObserverMixin.enabled*   s     }}&&((r   c                <    V P                   P                  V4       R # r   )r   Z
setEnabled)r   Zvalue   &&r	   r   r   8   s      'r   c                sl    V P                   P                  ^ R7      pVe   V P                  V4       R# R# )z
Attempt to receive a single device event from the monitor, process
the event and emit corresponding signals.

Called by ``QSocketNotifier``, if data is available on the udev
monitoring socket.
)ZtimeoutN)r   Zpoll_emit_eventr   devices   & r	   r   Z(MonitorObserverMixin._process_udev_event<   s4     ""1"-V$ r   c                r   r   )deviceEventemitr   r   r	   r   Z MonitorObserverMixin._emit_eventH   s    f%r   )r   r   N)__name__
__module____qualname____firstlineno____doc__r
   Zpropertyr   Zsetterr   r   __static_attributes____classdictcell__Z__classdict__   @r	   r   r      sK     G
 ) ) ^^( (
%& &r   r   c                   s0   a  ] tR t^Lt o RtR tR tRtV tR# )QUDevMonitorObserverMixinz"
Obsolete monitor observer mixin.
c                s    \         P                  WV4       R V P                  RV P                  RV P                  RV P
                  /V n        ^ RIpVP                  R\        4       R# )ZaddZremoveZchangeZmoveNzAWill be removed in 1.0. Use pyudev.pyqt4.MonitorObserver instead.)
r   r
   deviceAddeddeviceRemoveddeviceChangeddeviceMoved_action_signal_mapwarningsZwarnZDeprecationWarning)r   r   r   r$   s   &&& r	   r
   Z)QUDevMonitorObserverMixin._setup_notifierS   s_    ,,TNK4##d((d((D$$	#
 	R	
r   c                s    V P                   P                  VP                  V4       V P                  P	                  VP                  4      pVe   VP                  V4       R # R # r   )r   r   Zactionr#   Zget)r   r   signals   && r	   r   Z%QUDevMonitorObserverMixin._emit_eventc   sM    fmmV4((,,V]];KK r   )r#   N)	r   r   r   r   r   r
   r   r   r   r   r   r	   r   r   L   s     
    r   r   c                s   a a RV V3R llpV# )a  
Generates an initializer to observer the given ``monitor``
(a :class:`~pyudev.Monitor`):

``parent`` is the parent :class:`~PyQt{4,5}.QtCore.QObject` of this
object.  It is passed unchanged to the inherited constructor of
:class:`~PyQt{4,5}.QtCore.QObject`.
c                 sN   < SP                  W4       V P                  VS4       R # r   )__init__r
   )r   r   Zparentqobjectsocket_notifiers   &&&r	   r&   Zmake_init.<locals>.__init__t   s!    &Wo6r   r    )r'   r(   r&   s   ff r	   	make_initr*   j   s    7 7
 Or   c                   s4   a  ] tR t^|t o Rt]R 4       tRtV tR# )MonitorObserverGenerator,
Class to generate a MonitorObserver class.
c           
     s    \        \        R4      V \        3\        R4      \        W4      \        R4      V! \        4      /4      # )a  Generates an observer for device events integrating into the
PyQt{4,5} mainloop.

This class inherits :class:`~PyQt{4,5}.QtCore.QObject` to turn device
events into Qt signals:

>>> from pyudev import Context, Monitor
>>> from pyudev.pyqt4 import MonitorObserver
>>> context = Context()
>>> monitor = Monitor.from_netlink(context)
>>> monitor.filter_by(subsystem='input')
>>> observer = MonitorObserver(monitor)
>>> def device_event(device):
...     print('event {0} on device {1}'.format(device.action, device))
>>> observer.deviceEvent.connect(device_event)
>>> monitor.start()

This class is a child of :class:`~{PySide, PyQt{4,5}}.QtCore.QObject`.

ZMonitorObserverr&   r   )typestrr   r*   r    r'   r%   r(   r   r	   make_monitor_observerZ.MonitorObserverGenerator.make_monitor_observer   sD    , !"*+J7!DM"F6N
 	
r   r)   N	r   r   r   r   r   Zstaticmethodr0   r   r   r   r   r	   r+   r+   |   s      
 
r   r+   c                   s4   a  ] tR t^t o Rt]R 4       tRtV tR# )QUDevMonitorObserverGeneratorr,   c                s>   \        \        R4      V \        3\        R4      \        W4      \        R4      V! \        \        4      \        R4      V! \        4      \        R4      V! \        4      \        R4      V! \        4      \        R4      V! \        4      /4      # )a  Generates an observer for device events integrating into the
PyQt{4,5} mainloop.

This class inherits :class:`~PyQt{4,5}.QtCore.QObject` to turn device
events into Qt signals:

>>> from pyudev import Context, Monitor
>>> from pyudev.pyqt4 import MonitorObserver
>>> context = Context()
>>> monitor = Monitor.from_netlink(context)
>>> monitor.filter_by(subsystem='input')
>>> observer = MonitorObserver(monitor)
>>> def device_event(device):
...     print('event {0} on device {1}'.format(device.action, device))
>>> observer.deviceEvent.connect(device_event)
>>> monitor.start()

This class is a child of :class:`~{PyQt{4,5}, PySide}.QtCore.QObject`.

ZQUDevMonitorObserverr&   r   r   r    r!   r"   )r-   r.   r   r*   r    r/   r   r	   r0   Z3QUDevMonitorObserverGenerator.make_monitor_observer   s    , &'/0J7!DM"F3$7M"F6NO$fVnO$fVnM"F6N
 	
r   r)   Nr1   r   r   r	   r2   r2      s      %
 %
r   r2   N)r   Zpyudev.devicer    r   r   r*   r+   r2   r)   r   r	   <module>r3      sA   " !+& +&\  4  <$$
 $
N-
 -
r   