
    dfz                     D    d dl Z ddlmZmZ ddlmZ ddlmZmZm	Z	 ddZ
y)	    N   )InvalidParserNotFound)Template   )questionquestion_from_listquestion_from_stringc           	         | j                   }| j                  |d      }| j                  |      st        d|z        i }t	        j
                  | j                  |            }t        |t              st        d      ||d<   |j                         D ][  \  }}t        |t              rt        |      j                  |      }|rt        ||      }|rt        d|dt!        |             |||<   ] |S )z
        Parse given file and copy the content to a dict of dicts.

        Also, the values are rendered with jinja2 template.

    zcookiecutter.jsonzConfig %s does not existsz#root object have to be of type dictcookiecutterzChoice: =)rootjoinpathexistsr   jsonloads	read_text
isinstancedictr   itemsstrr   renderr   printrepr)	source_mediumdry_runinteractivesourceproject_conf	variablessection_dictkeyvals	            f/home/api-vastappli/venv/lib/python3.12/site-packages/make/make_project/parsers/cookiecutter_parser.pyget_varsr%      s     F ))&2EFL-8<GHHI::m55lCDLlD);<< ,In &&(  Sc33-&&y1C3$C*c3S	2S      )T)r   errorsr   r   templater   json_parserr   r	   r
   r%    r&   r$   <module>r+      s     -   K Kr&   