
    cX                     J    d Z ddlmZ ddlmZ ddlmZ  G d de          ZdS )zA requirement for a service.    )deepcopy)EnvVarRequirement)	is_stringc                   T    e Zd ZdZed             Zed             Zed             ZdS )ServiceRequirementzTAbstract base class for a requirement from the services section of the project file.c                    d}t          |          r|}t          |          }nt          |t                    rR|                    dd          }|*|                    d                    |                     dS t          |          }n*|                    d                    |                     dS t          j        |||          sdS t          |||          S )z)Parse an item from the services: section.N)typer	   z*Service {} doesn't contain a 'type' field.zJService {} should have a service type string or a dictionary as its value.)service_typeenv_varoptions)	r   dict
isinstancegetappendformatr   r   _parse_default)clsvarnameitemproblemsr
   r   s         [lib/python3.11/site-packages/anaconda_project/requirements_registry/requirements/service.py_parsezServiceRequirement._parse   s     T?? 	L---GGd## 		88FD11L  L S ST[ \ \]]]ttnnGGOO\ccdklln n n4 /(KK 	4wPPPP    c                     | j         d         S )zGet service type string.r	   )r   selfs    r   r
   zServiceRequirement.service_type)   s     |F##r   c                 "    t          dg          S )z-Override superclass with our ignore patterns.z
/services/)setr   s    r   ignore_patternsz"ServiceRequirement.ignore_patterns.   s     L>"""r   N)	__name__
__module____qualname____doc__classmethodr   propertyr
   r    r   r   r   r      sl        ^^Q Q [Q, $ $ X$ # # X# # #r   r   N)r#   copyr   2anaconda_project.requirements_registry.requirementr   $anaconda_project.internal.py2_compatr   r   r&   r   r   <module>r*      sx    # "       P P P P P P : : : : : :!# !# !# !# !#* !# !# !# !# !#r   