%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/pyudev/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/pyudev/__pycache__/wx.cpython-312.pyc

�

9*�b[���dZddlmZmZddlmZddlZe�\ZZGd�de�Z	e�\Z
Ze�\ZZ
e�\ZZe�\ZZGd�de	�Zy)	a�pyudev.wx
    =========

    Wx integration.

    :class:`MonitorObserver` integrates device monitoring into the wxPython\_
    mainloop by turing device events into wx events.

    :mod:`wx` from wxPython\_ must be available when importing this module.

    .. _wxPython: http://wxpython.org/

    .. moduleauthor::  Tobias Eberle  <tobias.eberle@gmx.de>
    .. versionadded:: 0.14

�)�
EvtHandler�	PostEvent)�NewEventNc�\�eZdZdZd�Zed��Zejd��Zd�Zd�Z	d�Z
y)	�MonitorObservera�
    An observer for device events integrating into the :mod:`wx` mainloop.

    This class inherits :class:`~wx.EvtHandler` to turn device events into
    wx events:

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

    This class is a child of :class:`wx.EvtHandler`.

    .. versionadded:: 0.17
    c�j�tj|�||_d|_|j	�y�N)r�__init__�monitor�_observer_thread�start)�selfrs  �+/usr/lib/python3/dist-packages/pyudev/wx.pyr
zMonitorObserver.__init__As(�����D�!���� $����
�
��c��|jduS)z�
        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�rs r�enabledzMonitorObserver.enabledGs���$�$�D�0�0rc�J�|r|j�y|j�yr	)r
�stop)r�values  rrzMonitorObserver.enabledQs����J�J�L��I�I�Krc��|j�ytj|j|jd��|_|jj�y)z`
        Enable this observer.

        Do nothing, if the observer is already enabled.
        Nzwx-observer-thread)�callback�name)r�pyudevrr�_emit_eventr
rs rr
zMonitorObserver.startXsL��� � �,�� &� 6� 6��L�L�4�#3�#3�:N�!
���	
���#�#�%rc�R�|j�y|jj�y)zb
        Disable this observer.

        Do nothing, if the observer is already disabled.
        N)rrrs rrzMonitorObserver.stopes%��� � �(�����"�"�$rc�0�t|t|���y)N��device)r�DeviceEvent)rrs  rrzMonitorObserver._emit_eventos���$��6�2�3rN)�__name__�
__module__�__qualname__�__doc__r
�propertyr�setterr
rr�rrrr*sG���,��1��1�
�^�^����&�%�4rrc�*�eZdZdZeeeed�Zd�Z	d�Z
y)�WxUDevMonitorObserverz�An observer for device events integrating into the :mod:`wx` mainloop.

    .. deprecated:: 0.17
       Will be removed in 1.0.  Use :class:`MonitorObserver` instead.
    )�add�remove�change�movec�d�tj||�ddl}|jdt�y)Nrz>Will be removed in 1.0. Use pyudev.wx.MonitorObserver instead.)rr
�warnings�warn�DeprecationWarning)rrr/s   rr
zWxUDevMonitorObserver.__init__�s'��� � ��w�/���
�
�O��	
rc��t|t|j|���|jj	|j�}|�t|||���yy)N)�actionrr)rr r3�_action_event_map�get)rr�event_classs   rrz!WxUDevMonitorObserver._emit_event�sK���$��6�=�=��H�I��,�,�0�0����?���"��d�K�v�6�7�#rN)r!r"r#r$�DeviceAddedEvent�DeviceRemovedEvent�DeviceChangedEvent�DeviceMovedEventr4r
rr'rrr)r)ys'��� �$�$� �	��
�8rr))r$�wxrr�wx.lib.neweventrrr �EVT_DEVICE_EVENTrr7�EVT_DEVICE_ADDEDr8�EVT_DEVICE_REMOVEDr9�EVT_DEVICE_CHANGEDr:�EVT_DEVICE_MOVEDr)r'rr�<module>rBsy���$%�$�� (�
���
�F4�j�F4�R&.�Z�"��"�)1��&��&�)1��&��&�%-�Z�"��"�8�O�8r

Zerion Mini Shell 1.0