Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 �Wã@s\dZddlmZddlmZddlmZddlmZddlZddlmZGdd „d e ƒZ dS) z• pyudev._os.poll =============== Operating system interface for pyudev. .. moduleauthor:: Sebastian Wiesner é)Úabsolute_import)Údivision)Úprint_function)Úunicode_literalsN)Úeintr_retry_callc@sPeZdZdZejejdœZedd„ƒZ e dd„ƒZ dd„Z dd d „Z d d „Zd S)ÚPollzwA poll object. This object essentially provides a more convenient interface around :class:`select.poll`. )ÚrÚwcCs ||@dkS)Nr©)ÚeventsÚeventr r ú/usr/lib/python3.6/poll.pyÚ _has_event1szPoll._has_eventcGsNttjƒ}x:|D]2\}}|jj|ƒ}|s6tdj|ƒƒ‚|j||ƒqW||ƒS)aGListen 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. zUnknown event type: {0!r})rÚselectÚpollÚ_EVENT_TO_MASKÚgetÚ ValueErrorÚformatÚregister)Úclsr ÚnotifierÚfdr Úmaskr r r Ú for_events5s  zPoll.for_eventscCs ||_dS)z›Create a poll object for the given ``notifier``. ``notifier`` is the :class:`select.poll` object wrapped by the new poll object. N)Ú _notifier)Úselfrr r r Ú__init__Gsz Poll.__init__NcCst|jt|jj|ƒƒƒS)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). )ÚlistÚ _parse_eventsrrr)rZtimeoutr r r rPsz Poll.pollccs˜x’|D]Š\}}|j|tjƒr,tdj|ƒƒ‚n|j|tjƒrHtdj|ƒƒ‚|j|tjƒr`|dfV|j|tjƒrx|dfV|j|tjƒr|dfVqWdS)z˜Parse ``events``. ``events`` is a list of events as returned by :meth:`select.poll.poll()`. Yield all parsed events. zFile descriptor not open: {0!r}zError while polling fd: {0!r}rr ÚhN) rrZPOLLNVALÚIOErrorrZPOLLERRÚPOLLINÚPOLLOUTZPOLLHUP)rr rZ event_maskr r r rcs   zPoll._parse_events)N)Ú__name__Ú __module__Ú __qualname__Ú__doc__rr"r#rÚ staticmethodrÚ classmethodrrrrr r r r r&s    r) r'Z __future__rrrrrZ pyudev._utilrÚobjectrr r r r Ús