o
    Vh
                     @  sx   d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm	Z	 er2d dl
mZ d dlmZ G d	d
 d
e	ZdS )    )annotations)TYPE_CHECKING)ClassVar)argument)option)InitCommand)Argument)Optionc                
   @  s   e Zd ZU dZdZeddgZded< eddd	d
dedddddedddedddedddddgdd e	j
D Z
ded< dddZdS )
NewCommandnewz'Creates a new Python project at <path>.pathz"The path to create the project at.zClassVar[list[Argument]]	argumentsinteractiveiz9Allow interactive specification of project configuration.T)flagnameNzSet the resulting package name.Fsrcz[Use the src layout for the project. <warning>Deprecated</>: This is the default option now.flatz$Use the flat layout for the project.readmez.Specify the readme file format. Default is md.c                 C  s   g | ]	}|j d v r|qS )>   dev-dependencyauthorpythonlicense
dependencydescription)r   ).0o r   o/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/poetry/console/commands/new.py
<listcomp>-   s    zNewCommand.<listcomp>zClassVar[list[Option]]optionsreturnintc                 C  s   ddl m} | jjdr| d || d}| s$| 	|}|
 r7t|dr7td| d| d	rA| d
 | j|| d| drOdnd	| dpVddS )Nr   )Pathprojectz<warning>--project only makes sense with existing projects, and will be ignored. You should consider the option --path instead.</warning>r   *zDestination <fg=yellow>z</> exists and is not emptyr   zSThe <c1>--src</> option is now the default and will be removed in a future version.r   r   standardr   md)project_pathallow_interactivelayout_namereadme_format)pathlibr#   ioinputr   
line_errorr   is_absolutecwdjoinpathexistslistglobRuntimeError_init_pyproject)selfr#   r   r   r   r   handle<   s,   

zNewCommand.handle)r!   r"   )__name__
__module____qualname__r   r   r   r   __annotations__r   r   r    r9   r   r   r   r   r
      s<   
 
$r
   N)
__future__r   typingr   r   cleo.helpersr   r   poetry.console.commands.initr   cleo.io.inputs.argumentr   cleo.io.inputs.optionr	   r
   r   r   r   r   <module>   s    