Sindbad~EG File Manager
3
�uGh � @ sP d Z ddlmZ ddlmZmZ ddlmZmZm Z ddiZ
G dd� de �Zd S )
zCFix UserDict.
Incomplete!
TODO: base this on fix_urllib perhaps?
� )�
fixer_base)�Name�
attr_chain)�
alternates�
build_pattern�
FixImports�UserDict�collectionsc sT e Zd ZdZdZeZdZdd� Z� fdd�Z � fdd�Z
� fd d
�Zdd� Z� Z
S )
�FixUserdictT� c C s dj t| j��S )N�|)�joinr �mapping)�self� r �E/root/tmp/pip-build-gzoz1_uw/future/libfuturize/fixes/fix_UserDict.pyr 5 s zFixUserdict.build_patternc s | j � | _tt| �j� d S )N)r ZPATTERN�superr �compile_pattern)r )� __class__r r r 8 s
zFixUserdict.compile_patternc sH t t| �j� � |�}|rDd|kr@t� fdd�t|d�D ��r@dS |S dS )N�bare_with_attrc 3 s | ]}� |�V qd S )Nr )�.0�obj)�matchr r � <genexpr>F s z$FixUserdict.match.<locals>.<genexpr>�parentF)r r r �anyr )r �node�results)r )r r r ? s zFixUserdict.matchc s t t| �j||� i | _d S )N)r r �
start_tree�replace)r �tree�filename)r r r r K s zFixUserdict.start_treec C s� |j d�}|rl|j}t| j| �}|jt||jd�� d|krH|| j|<