????

Your IP : 3.137.211.1


Current Path : /usr/lib/python3.6/site-packages/libpasteurize/fixes/__pycache__/
Upload File :
Current File : //usr/lib/python3.6/site-packages/libpasteurize/fixes/__pycache__/feature_base.cpython-36.opt-1.pyc

3

�c��@s0dZdZdZGdd�de�ZGdd�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 eZdZdZdd�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)
    cCs||_||_||_dS)N)�name�_pattern�version)�selfr�PATTERNr�r�"/usr/lib/python3.6/feature_base.py�__init__szFeature.__init__cCst|j|jfS)zS
        Format the above text with the name and minimum version required.
        )�message_unformattedrr)rrrr�message_textszFeature.message_textN)�__name__�
__module__�__qualname__�__doc__r	rrrrrrsrc@s0eZdZdZiZdd�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.
    cCstdd�t|�D��|_dS)zS
        Called every time we care about the mapping of names to features.
        cSsg|]}|j|f�qSr)r)�.0�frrr�
<listcomp>*sz+Features.update_mapping.<locals>.<listcomp>N)�dict�iter�mapping)rrrr�update_mapping&szFeatures.update_mappingcCs |j�djdd�t|�D��S)z{
        Uses the mapping of names to features to return a PATTERN suitable
        for using the lib2to3 patcomp.
        z |
cSsg|]}t|j|jf�qSr)�pattern_unformattedrr)rrrrrr3sz$Features.PATTERN.<locals>.<listcomp>)r�joinr)rrrrr,szFeatures.PATTERNcCs
|j|S)zH
        Implement a simple mapping to get patterns from names.
        )r)r�keyrrr�__getitem__5szFeatures.__getitem__N)	rr
rrrr�propertyrrrrrrrs
	rN)rrr
�objectr�setrrrrr�<module>s