관리-도구
편집 파일: feature_base.cpython-37.opt-1.pyc
B �A�[� � @ s0 d Z dZdZG dd� de�ZG dd� de�ZdS )z� Base classes for features that are backwards-incompatible. Usage: features = Features() features.add(Feature("py3k_feature", "power< 'py3k' any* >", "2.7")) PATTERN = features.PATTERN z%s=%sz- %s is only supported in Python %s and above.c @ s e Zd ZdZdd� Zdd� ZdS )�Featurez� A feature has a name, a pattern, and a minimum version of Python 2.x required to use the feature (or 3.x if there is no backwards-compatible version of 2.x) c C s || _ || _|| _d S )N)�name�_pattern�version)�selfr �PATTERNr � r �Q/opt/alt/python37/lib/python3.7/site-packages/libpasteurize/fixes/feature_base.py�__init__ s zFeature.__init__c C s t | j| jf S )zS Format the above text with the name and minimum version required. )�message_unformattedr r )r r r r �message_text s zFeature.message_textN)�__name__� __module__�__qualname__�__doc__r r r r r r r s r c @ s0 e Zd ZdZi Zdd� Zedd� �Zdd� ZdS ) �Featuresz� A set of features that generates a pattern for the features it contains. This set will act like a mapping in that we map names to patterns. c C s t dd� t| �D ��| _dS )zS Called every time we care about the mapping of names to features. c S s g | ]}|j |f�qS r )r )�.0�fr r r � <listcomp>* s z+Features.update_mapping.<locals>.<listcomp>N)�dict�iter�mapping)r r r r �update_mapping&