File: //lib/python2.7/site-packages/leapp/libraries/stdlib/__pycache__/eventloop.cpython-36.pyc
3
�S4b� � @ sr d dl mZ d dlZd dlZd dlZd dlmZ d ZdZdZ dZ
dZdZG d d
� d
e
�Zej� dkrhenejZdS )� )�print_functionN)�defaultdict� � � � � c @ sT e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zdd
� Z dd� Z
edd� �ZdS )�EventLoopKQUEUEi c C s t j� | _i | _d S )N)�selectZkqueue�_kqueue�_fds)�self� r �7/root/tmp_leapp_py3/leapp/libraries/stdlib/eventloop.py�__init__ s
zEventLoopKQUEUE.__init__c C s� g }|t @ r"|jtj|tj|�� |t@ r@|jtj|tj|�� xX|D ]P}y| jj|gd� W qF t k
r� } z|j
t
jt
jfkr�� W Y d d }~X qFX qFW d S )Nr )
�POLL_OUT�appendr
Zkevent�KQ_FILTER_WRITE�POLL_IN�KQ_FILTER_READr �control�OSError�errno�EBADF�ENOENT)r
�fd�mode�flags�events�e�excr r r �_control s
zEventLoopKQUEUE._controlc C s� |dk rd }| j jd tj|�}tdd� �}xt|D ]l}|j}t|� |jtj @ rb|j
dkrbt||<