o
    uã¤g‡V  ã                   @   sÆ  d Z ddlZddlZddlZddlZddlmZ dejv Zej	 
ej¡Zej	 
ej¡Zej	 
ej¡Zej	 
ej¡Zdejv rHej	 ejd ¡ZnejrWej	 ej	 ej¡¡Zne ¡ Zdd„ Zeed	dƒZejd
krvdd„ ZeeƒZeeƒZdd„ Zeƒ ZdZ zes…ej!Z W n	 e"y   Y nw dd„ Z#d1dd„Z$dd„ Z%d2dd„Z&dd„ Z'dd„ Z(dZ)dd„ Z*d3dd „Z+e ,d!¡Z-e ,d"¡Z.e ,d#¡Z/d3d$d%„Z0d&d'„ Z1da2d(Z3d)d*„ Z4d+d,„ Z5d-d.„ Z6d/d0„ Z7dS )4a  Provide access to Python's configuration information.  The specific
configuration variables available depend heavily on the platform and
configuration.  The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys().  Additional convenience functions are also
available.

Written by:   Fred L. Drake, Jr.
Email:        <fdrake@acm.org>
é    Né   )ÚDistutilsPlatformErrorÚ__pypy__Ú_PYTHON_PROJECT_BASEc                 C   s,   dD ]}t j t j | d|¡¡r dS qdS )N)ÚSetupzSetup.localÚModulesTF)ÚosÚpathÚisfileÚjoin)ÚdÚfn© r   úa/var/www/html/ecg_monitoring/venv/lib/python3.10/site-packages/setuptools/_distutils/sysconfig.pyÚ_is_python_source_dir,   s
   ÿr   Ú_homeÚntc                 C   s0   | rt j | ¡ t j t j td¡¡¡rtS | S )NÚPCbuild)r   r	   ÚnormcaseÚ
startswithr   ÚPREFIX)r   r   r   r   Ú_fix_pcbuild5   s
   ÿr   c                   C   s   t rtt ƒS ttƒS ©N)Ú	_sys_homer   Úproject_baser   r   r   r   Ú_python_build=   s   r   Ú c                   C   s   dt jdd…  S )z–Return a string containing the major and minor Python version,
    leaving off the patchlevel.  Sample return values could be '1.5'
    or '2.2'.
    z%d.%dNé   )ÚsysÚversion_infor   r   r   r   Úget_python_versionQ   s   r    c                 C   sà   |du r
| rt p	t}tjdkrItrtjdk rtj |d¡S t	r4| r%t
p$tS tj tdƒd¡}tj |¡S tr8dnd}|tƒ  t }tj |d|¡S tjd	krit	rbtj |d¡tjj tj |d
¡ S tj |d¡S tdtj ƒ‚)a¤  Return the directory containing installed Python header files.

    If 'plat_specific' is false (the default), this is the path to the
    non-platform-specific header files, i.e. Python.h and so on;
    otherwise, this is the path to platform-specific header files
    (namely pyconfig.h).

    If 'prefix' is supplied, use it instead of sys.base_prefix or
    sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
    NÚposix©é   é   ÚincludeÚsrcdirÚIncludeÚpypyÚpythonr   ÚPCzFI don't know where Python installs its C header files on platform '%s')ÚBASE_EXEC_PREFIXÚBASE_PREFIXr   ÚnameÚIS_PYPYr   r   r	   r   Úpython_buildr   r   Úget_config_varÚnormpathr    Úbuild_flagsÚpathsepr   )Úplat_specificÚprefixÚincdirÚimplementationÚ
python_dirr   r   r   Úget_python_incY   s0   

ÿÿÿr9   c                 C   s   | r|S t j |d¡S )Núsite-packages)r   r	   r   )Ústandard_libÚ	libpythonÚearly_prefixr5   r   r   r   Ú
_posix_lib…   s   r>   c                 C   sú   t r!tjdk r!|du rt}|rtj |dtjd ¡S tj |d¡S |}|du r6|r0| r-tp.t	}n| r4t
p5t}tjdkr`| s?|rFttddƒ}nd}t rLd	nd
}tj |||tƒ  ¡}t||||ƒS tjdkrv|rntj |d¡S tj |dd¡S tdtj ƒ‚)aS  Return the directory containing the Python library (standard or
    site additions).

    If 'plat_specific' is true, return the directory containing
    platform-specific modules, i.e. any module from a non-pure-Python
    module distribution; otherwise, return the platform-shared library
    directory.  If 'standard_lib' is true, return the directory
    containing standard Python library modules; otherwise, return the
    directory for site-specific modules.

    If 'prefix' is supplied, use it instead of sys.base_prefix or
    sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
    r"   Nz
lib-pythonr   r:   r!   Ú
platlibdirÚlibr(   r)   r   ÚLibz?I don't know where Python installs its library on platform '%s')r.   r   r   r   r   r	   r   Úversionr+   r,   ÚEXEC_PREFIXr-   Úgetattrr    r>   r   )r4   r;   r5   r=   Úlibdirr7   r<   r   r   r   Úget_python_libŒ   s:   

ÿ
ÿÿrF   c              	   C   s  | j dkrtjdkrtdƒsddl}| t¡ dtd< tddd	d
ddddƒ\}}}}}}}}	dtj	v rOtj	d }
dtj	vrM| 
|¡rM|
|t|ƒd…  }|
}dtj	v rYtj	d }dtj	v rctj	d }dtj	v rntj	d }n|d }dtj	v r€|d tj	d  }d	tj	v r—|d tj	d	  }|d tj	d	  }dtj	v r·|d tj	d  }|d tj	d  }|d tj	d  }dtj	v rÁtj	d }dtj	v rÐ|d tj	d  }n|d |	 }|d | }| j|||d | ||||d dtj	v r| j dd¡r| jtj	d d || _dS dS )zÄDo any platform-specific customization of a CCompiler instance.

    Mainly needed on Unix, so we can plug in the information that
    varies across Unices and is stored in Python's Makefile.
    ÚunixÚdarwinÚCUSTOMIZED_OSX_COMPILERr   NÚTrueÚCCÚCXXÚCFLAGSÚCCSHAREDÚLDSHAREDÚSHLIB_SUFFIXÚARÚARFLAGSÚCPPz -EÚLDFLAGSú ÚCPPFLAGS)ÚpreprocessorÚcompilerÚcompiler_soÚcompiler_cxxÚ	linker_soÚ
linker_exeÚarchiverÚRANLIBÚranlib)r_   )Úcompiler_typer   Úplatformr0   Ú_osx_supportÚcustomize_compilerÚ_config_varsÚget_config_varsr   Úenvironr   ÚlenÚset_executablesÚexecutablesÚgetÚshared_lib_extension)rX   rb   ÚccÚcxxÚcflagsÚccsharedÚldsharedÚshlib_suffixÚarÚar_flagsÚnewccÚcppr]   Úcc_cmdr   r   r   rc   Ã   sh   


ÿÿ


ÿ











ù	
¾rc   c                  C   sD   t rtjdkrtj tptd¡} n
tpt} ntdd} tj | d¡S )z2Return full pathname of installed pyconfig.h file.r   r*   r   ©r4   z
pyconfig.h)r/   r   r-   r	   r   r   r   r9   )Úinc_dirr   r   r   Úget_config_h_filename  s   


ry   z+config-{python_ver}{build_flags}{multiarch}c                  C   s`   t rtj tptd¡S tddd} ttj	dƒrdtj	j
 nd}tjtƒ t|d}tj | |d¡S )	zAReturn full pathname of installed Makefile from the Python build.ÚMakefiler   r   ©r4   r;   Ú
_multiarchz-%sr   )Ú
python_verr2   Ú	multiarch)r/   r   r	   r   r   r   rF   Úhasattrr   r7   r|   Ú_makefile_tmplÚformatr    r2   )Úlib_dirr~   Úconfig_filer   r   r   Úget_makefile_filename  s   
ÿþýr„   c                 C   sš   |du ri }t  d¡}t  d¡}	 |  ¡ }|s	 |S | |¡}|r>| dd¡\}}zt|ƒ}W n	 ty8   Y nw |||< n| |¡}|rLd|| d¡< q)zÌParse a config.h-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    Nz"#define ([A-Z][A-Za-z0-9_]+) (.*)
z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
Tr   r   r   )ÚreÚcompileÚreadlineÚmatchÚgroupÚintÚ
ValueError)ÚfpÚgÚ	define_rxÚundef_rxÚlineÚmÚnÚvr   r   r   Úparse_config_h0  s&   


ö

ór”   z"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}c              	   C   s¤  ddl m} || ddddd}|du ri }i }i }	 | ¡ }|du r#n?t |¡}|ra| dd¡\}}	|	 ¡ }	|	 d	d
¡}
d|
v rE|	||< nzt|	ƒ}	W n t	y\   |	 d	d¡||< Y nw |	||< qd}|r1t
|ƒD ]Ã}|| }t |¡pzt |¡}|r+| d¡}d}||v rt|| ƒ}n>||v r—d}n7|tjv r¢tj| }n,||v rÈ| d¡r¶|dd… |v r¶d
}nd| |v r¿d}nt|d|  ƒ}nd
 ||< }|r*|| ¡ d… }|d| ¡ … | | }d|v rî|||< qkzt|ƒ}W n t	y   | ¡ ||< Y nw |||< ||= | d¡r*|dd… |v r*|dd… }||vr*|||< qk||= qk|sg| ¡  | ¡ D ]\}}	t|	tƒrI|	 ¡ ||< q9| |¡ |S )zÌParse a Makefile-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    r   )ÚTextFiler   Úsurrogateescape)Ústrip_commentsÚskip_blanksÚ
join_linesÚerrorsNTr   z$$r   ú$)rM   rT   rV   FÚPY_r#   )Údistutils.text_filer•   r‡   Ú_variable_rxrˆ   r‰   ÚstripÚreplacerŠ   r‹   ÚlistÚ_findvar1_rxÚsearchÚ_findvar2_rxÚstrr   rf   r   ÚendÚstartÚcloseÚitemsÚ
isinstanceÚupdate)r   r   r•   rŒ   ÚdoneÚnotdoner   r‘   r’   r“   ÚtmpvÚrenamed_variablesr-   ÚvalueÚfoundÚitemÚafterÚkr   r   r   Úparse_makefileS  sŽ   

þì


ÿ
€Ð2€
rµ   c                 C   sX   	 t  | ¡p
t | ¡}|r(| ¡ \}}| d|… | | d¡¡ | |d…  } n	 | S q)a¨  Expand Makefile-style variables -- "${foo}" or "$(foo)" -- in
    'string' according to 'vars' (a dictionary mapping variable names to
    values).  Variables not present in 'vars' are silently expanded to the
    empty string.  The variable values in 'vars' should not contain further
    variable expansions; if 'vars' is the output of 'parse_makefile()',
    you're fine.  Returns a variable-expanded version of 's'.
    Tr   r   N)r¢   r£   r¤   Úspanrj   r‰   )ÚsÚvarsr‘   Úbegr¦   r   r   r   Úexpand_makefile_vars½  s   *ùrº   z+_sysconfigdata_{abi}_{platform}_{multiarch}c               
   C   s„   t j dtjtjtjttj	ddƒd¡} zt
| tƒ tƒ dgdƒ}W n ty5   t
dtƒ tƒ dgdƒ}Y nw |j}i at |¡ dS )	z7Initialize the module as appropriate for POSIX systems.Ú_PYTHON_SYSCONFIGDATA_NAMEr|   r   )Úabira   r~   Úbuild_time_varsr   Ú_sysconfigdataN)r   rf   rj   Ú_sysconfig_name_tmplr   r   Úabiflagsra   rD   r7   Ú
__import__ÚglobalsÚlocalsÚImportErrorr½   rd   r«   )r-   Ú_tempr½   r   r   r   Ú_init_posixÜ  s$   ýþÿþrÆ   c                  C   s~   i } t ddd| d< t ddd| d< tdd| d< t ¡ d | d< d	| d
< tƒ  dd¡| d< tj tj 	t
j¡¡| d< | adS )z+Initialize the module as appropriate for NTr   r   r{   ÚLIBDESTÚ
BINLIBDESTrw   Ú	INCLUDEPYÚ
EXT_SUFFIXz.exeÚEXEÚ.r   ÚVERSIONÚBINDIRN)rF   r9   Ú_impÚextension_suffixesr    r    r   r	   ÚdirnameÚabspathr   Ú
executablerd   )r   r   r   r   Ú_init_ntó  s   rÔ   c                  G   sL  t du r‘tƒ  dtj ¡}|r|ƒ  ni a tt d< tt d< tsƒt  d¡}|dur,|t d< t  dt¡}tjdkrOt	rHtj
 tƒ ¡}tj
 ||¡}ntj
 tƒ ¡}tj
 tj
 |¡¡t d< t	rƒtjdkrƒt}tj
 t d ¡sƒ|t ¡ krƒtj
 |t d ¡}tj
 |¡t d< tjd	kr‘d
dl}| t ¡ | r¤g }| D ]
}| t  |¡¡ q—|S t S )aß  With no arguments, return a dictionary of all configuration
    variables relevant for the current platform.  Generally this includes
    everything needed to build extensions and install both pure modules and
    extensions.  On Unix, this means every variable defined in Python's
    installed Makefile; on Windows it's a much smaller set.

    With arguments, return a list of values that result from looking up
    each argument in the configuration variable dictionary.
    NÚ_init_r5   Úexec_prefixrÊ   ÚSOr&   r!   rH   r   )rd   rÂ   rj   r   r-   r   rC   r.   r   r/   r	   rÑ   r„   r   rÒ   r1   ÚisabsÚgetcwdr   ra   rb   Úcustomize_config_varsÚappend)ÚargsÚfuncr×   r&   Úbaserb   Úvalsr-   r   r   r   re     sB   



re   c                 C   s*   | dkrddl }| dtd¡ tƒ  | ¡S )z“Return the value of a single variable using the dictionary
    returned by 'get_config_vars()'.  Equivalent to
    get_config_vars().get(name)
    r×   r   Nz SO is deprecated, use EXT_SUFFIXr   )ÚwarningsÚwarnÚDeprecationWarningre   rj   )r-   rà   r   r   r   r0   Q  s   r0   )r   N)r   r   Nr   )8Ú__doc__rÏ   r   r…   r   rš   r   Úbuiltin_module_namesr.   r	   r1   r5   r   rÖ   rC   Úbase_prefixr,   Úbase_exec_prefixr+   rf   rÒ   r   rÓ   rÑ   rÙ   r   rD   r   r-   r   r   r/   r2   rÀ   ÚAttributeErrorr    r9   r>   rF   rc   ry   r€   r„   r”   r†   rž   r¢   r¤   rµ   rº   rd   r¿   rÆ   rÔ   re   r0   r   r   r   r   Ú<module>   sh    


€ý
,
7K




jK