+
     h  c                   s2    R t ^ RIt^ RIHt  ! R R4      tR# )z
pyudev._os.poll
===============

Operating system interface for pyudev.

.. moduleauthor:: Sebastian Wiesner  <lunaryorn@gmail.com>
N)eintr_retry_callc                   s   a  ] tR t^!t o RtR]P                  R]P                  /t]	R 4       t
]R 4       tR tRR ltR	 tR
tV tR# )PollzkA poll object.

This object essentially provides a more convenient interface around
:class:`select.poll`.

rwc                s    W,          ^ 8g  # )i     )eventsevent   &&4/usr/lib/python3.14/site-packages/pyudev/_os/poll.py
_has_eventZPoll._has_event+   s    ~""    c                s    \        \        P                  4      pV FP  w  r4V P                  P	                  V4      pV'       g   \        R\        V4       24      hVP                  W54       KR  	  V ! V4      # )a  Listen for ``events``.

``events`` is a list of ``(fd, event)`` pairs, where ``fd`` is a file
descriptor or file object and ``event`` either ``'r'`` or ``'w'``.  If
``r``, listen for whether that is ready to be read.  If ``w``, listen
for whether the channel is ready to be written to.

zUnknown event type: )r    selectpoll_EVENT_TO_MASKZgetZ
ValueErrorreprZregister)Zclsr   notifierfdr   Zmasks   &*    r   
for_eventsZPoll.for_events/   sh     $FKK0IB%%))%0D #7U}!EFFb'	  
 8}r
   c                s    Wn         R# )zCreate a poll object for the given ``notifier``.

``notifier`` is the :class:`select.poll` object wrapped by the new poll
object.

N	_notifier)selfr   r   r   __init__ZPoll.__init__A   s	     "r
   Nc                sr    \        V P                  \        V P                  P                  V4      4      4      # )a+  Poll for events.

``timeout`` is an integer specifying how long to wait for events (in
milliseconds).  If omitted, ``None`` or negative, wait until an event
occurs.

Return a list of all events that occurred before ``timeout``, where
each event is a pair ``(fd, event)``. ``fd`` is the integral file
descriptor, and ``event`` a string indicating the event type.  If
``'r'``, there is data to read from ``fd``.  If ``'w'``, ``fd`` is
writable without blocking now.  If ``'h'``, the file descriptor was
hung up (i.e. the remote side of a pipe was closed).

)Zlist_parse_eventsr    r   r   )r   Ztimeoutr   r   r   Z	Poll.pollJ   s,    " D&&'78K8KW'UVWWr
   c              #  s*  "   V EF  w  r#V P                  V\        P                  4      '       d   \        R\	        V4       24      hV P                  V\        P
                  4      '       d   \        R\	        V4       24      hV P                  V\        P                  4      '       d   VR3x  V P                  V\        P                  4      '       d   VR3x  V P                  V\        P                  4      '       g   EK  VR3x  EK
  	  R# 5i)zxParse ``events``.

``events`` is a list of events as returned by
:meth:`select.poll.poll()`.

Yield all parsed events.

zFile descriptor not open: zError while polling fd: r   r   ZhN)	r	   r   ZPOLLNVALZIOErrorr   ZPOLLERRPOLLINPOLLOUTZPOLLHUP)r   r   r   Z
event_masks   &&  r   r   ZPoll._parse_events]   s      %NBz6??;; :48*EFFz6>>:: 8b
CDDz6==99#gz6>>::#gz6>>::#g %s   A+D.<D++D)DDr   )N)Z__name__Z
__module__Z__qualname__Z__firstlineno____doc__r   r   r   r   Zstaticmethodr	   Zclassmethodr   r   r   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r   !   s]      6==#v~~>N# #  ""X& r
   r   )r   r   Zpyudev._utilr    r   r   r
   r   <module>r      s    "  *P Pr
   