
    yIf                    f    d 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rddlmZ ddZddZdS )z;Everything related to the 'pylint-config generate' command.    )annotations)StringIO)TYPE_CHECKING)utils)get_subparser_help)PyLinterlinterr   returnNonec                8   t          d           t          j                    }|dk    ot          j                    }t          j                    \  }}|dk    r|                     |          }n9t                      }|                     |d           |                                }|rat          |dd          5 }t          ||	           d d d            n# 1 swxY w Y   t          d
|
                                            d S t          |           d S )Nz4Starting interactive pylint configuration generationtoml)minimal)Commands)streamskipsectionswzutf-8)encoding)filezWrote configuration file to )printr   get_and_validate_formatget_minimal_settingget_and_validate_output_file_generate_config_filer   _generate_configgetvalueopenresolve)r	   format_typer   to_fileoutput_file_nameconfig_stringoutput_streamfs           a/var/www/piapp/venv/lib/python3.11/site-packages/pylint/config/_pylint_config/generate_command.pygenerate_interactive_configr%      sb   	
@AAA/11KV#C(A(C(CG % B D DGf44W4EE 

}=QQQ%..00 "C'::: 	)a-a((((	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	)I-=-E-E-G-GIIJJJJJms   <CC!Cintc                z    | j         j        rt          |            dS t          t	          | d                     dS )z Handle 'pylint-config generate'.r   generate    )configinteractiver%   r   r   )r	   s    r$   handle_generate_commandr,   *   sB     }  #F+++q	
VZ
0
01112    N)r	   r   r
   r   )r	   r   r
   r&   )__doc__
__future__r   ior   typingr   pylint.config._pylint_configr   )pylint.config._pylint_config.help_messager   pylint.lint.pylinterr   r%   r,    r-   r$   <module>r6      s   
 B A # " " " " "                   . . . . . . H H H H H H .------   ,     r-   