관리-도구
편집 파일: fixer_util.cpython-37.pyc
B �A�[VD � @ s\ d Z ddlmZmZmZmZmZmZ ddlm Z m Z ddlmZ mZ ddlmZ ddlm Z mZmZm Z mZmZ ddlZdd � Zd4d d�Zd5dd �Zd6dd�Zdd� Zdd� Zdd� Zdd� Zd7dd�Ze je je je j e j!fZ"e j#e j$fZ%dd� Z&d8dd�Z'dd� Z(d d!� Z)d"d#� Z*d$d%� Z+d&d'� Z,d(d)� Z-d*d+� Z.d,Z/d-Z0d.d/� Z1d0d1� Z2d9d2d3�Z3dS ):z� Utility functions from 2to3, 3to2 and python-modernize (and some home-grown ones). Licences: 2to3: PSF License v2 3to2: Apache Software License (from 3to2/setup.py) python-modernize licence: BSD (from python-modernize/LICENSE) � )� FromImport�Newline� is_import� find_root�does_tree_import�Comma)�Leaf�Node)�python_symbols�python_grammar)�token)r �Call�Name�symsr �NumberNc s~ d� kr� S � � d�r"� dd� � � fdd�|D �}t|�dkr^tdd �d d� |D �� ��nt|�dkrrtd ��|d S dS )al Examples: >>> canonical_fix_name('fix_wrap_text_literals') 'libfuturize.fixes.fix_wrap_text_literals' >>> canonical_fix_name('wrap_text_literals') 'libfuturize.fixes.fix_wrap_text_literals' >>> canonical_fix_name('wrap_te') ValueError("unknown fixer name") >>> canonical_fix_name('wrap') ValueError("ambiguous fixer name") z.fix_Zfix_� Nc s g | ]}|� d �� ��r|�qS )zfix_{0})�endswith�format)�.0�f)�fix� �G/opt/alt/python37/lib/python3.7/site-packages/libfuturize/fixer_util.py� <listcomp>( s z&canonical_fix_name.<locals>.<listcomp>� zOAmbiguous fixer name. Choose a fully qualified module name instead from these: � c s s | ]}d | V qdS )z Nr )r Zmyfr r r � <genexpr>- s z%canonical_fix_name.<locals>.<genexpr>r z1Unknown fixer. Use --list-fixes or -l for a list.)� startswith�len� ValueError�join)r Zavail_fixes�foundr )r r �canonical_fix_name s r"