
    Fwg                     <    d Z dZdZ G d de      Z G d de      Zy)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                       e Zd ZdZd Zd Zy)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                 .    || _         || _        || _        y )N)name_patternversion)selfr   PATTERNr   s       W/var/www/horilla/myenv/lib/python3.12/site-packages/libpasteurize/fixes/feature_base.py__init__zFeature.__init__   s    	    c                 @    t         | j                  | j                  fz  S )zS
        Format the above text with the name and minimum version required.
        )message_unformattedr   r   )r   s    r
   message_textzFeature.message_text   s     #dii%>>>r   N)__name__
__module____qualname____doc__r   r    r   r
   r   r      s    

?r   r   c                   0    e Zd ZdZi Zd Zed        Zd Zy)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                 t    t        t        |       D cg c]  }|j                  |f c}      | _        yc c}w )zS
        Called every time we care about the mapping of names to features.
        N)dictiterr   mappingr   fs     r
   update_mappingzFeatures.update_mapping&   s*     $t*=Qaffa[=>=s   5c                     | j                          dj                  t        |       D cg c]!  }t        |j                  |j
                  fz  # c}      S c c}w )z{
        Uses the mapping of names to features to return a PATTERN suitable
        for using the lib2to3 patcomp.
        z |
)r   joinr   pattern_unformattedr   r   r   s     r
   r	   zFeatures.PATTERN,   sG     	||QUVZQ[\A0AFFAJJ3GG\]]\s   &Ac                      | j                   |   S )zH
        Implement a simple mapping to get patterns from names.
        )r   )r   keys     r
   __getitem__zFeatures.__getitem__5   s     ||C  r   N)	r   r   r   r   r   r   propertyr	   r#   r   r   r
   r   r      s.     G? ^ ^!r   r   N)r   r    r   objectr   setr   r   r   r
   <module>r'      s2     0 ?f ?"!s !r   