<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
B
    Reh                 @   s  d Z ddlZddlZddlZddlZddlmZmZ yddlZW n e	k
r\   ddl
ZY nX dddddd	d
ddddgZdd ZejrejeejZnee Zejdkrdedd  kreejeeZejdkrdedd  kreejeeeZejdkrBdedd  krBeejeeeZdd Ze Zdadd Ze ZedZdd Zd ejdd!  Zd"ejdd#  Z d$ejdd#  Z!ej"ej#Z$ej"ej%Z&da'dZ(d%d& Z)d'd( Z*d)d* Z+d+d, Z,d-d. Z-d/d0 Z.dHd1d2Z/d3d Z0d4d5 Z1d6d7 Z2dId8dZ3d9d Z4d:d Z5d;d	 Z6e- dd<fd=d
Z7e- dd<fd>dZ8d?d Z9d@d Z:dAd Z;dBd Z<dCdD Z=dEdF Z>e?dGkre>  dS )Jz-Access to Python's configuration information.    N)pardirrealpathget_config_h_filenameget_config_varget_config_varsget_makefile_filenameget_pathget_path_names	get_pathsget_platformget_python_versionget_scheme_namesparse_config_hc             C   s"   yt | S  tk
r   | S X d S )N)r   OSError)path r   /builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.py_safe_realpath"   s    r   ntZpcbuildiz\pc\viz\pcbuild\amd64ic              C   s.   x(dD ] } t jt jtd| rdS qW dS )N)z
Setup.distzSetup.localModulesTF)osr   isfilejoin_PROJECT_BASE)fnr   r   r   is_python_build:   s    
r   Fc           	   C   s   t sddlm}  tddd }| |}|d}|s>td| }t	| W d Q R X t
rx(dD ] }t|d	d
 t|dd qfW da d S )N   )finder.   r   zsysconfig.cfgzsysconfig.cfg exists)posix_prefix
posix_homeincludez{srcdir}/Includeplatincludez{projectbase}/.T)	_cfg_read	resourcesr   __name__rsplitfindAssertionError	as_stream_SCHEMESreadfp_PYTHON_BUILDset)r   Zbackport_packageZ_finderZ_cfgfilesschemer   r   r   _ensure_cfg_readD   s    


r1   z\{([^{]*?)\}c          
      s   t   | dr| d}nt }|  }xD|D ]<}|dkr>q0x,|D ]$\}}| ||rZqD| ||| qDW q0W | d xX|  D ]L}t| |  fdd}x,| |D ]\}}| ||t	
|| qW qW d S )Nglobalsc                s$   |  d}| kr | S |  dS )Nr   r   )group)matchobjname)	variablesr   r   	_replacero   s    
z"_expand_globals.<locals>._replacer)r1   has_sectionitemstuplesections
has_optionr.   remove_sectiondict	_VAR_REPLsub)configr2   r;   sectionoptionvaluer7   r   )r6   r   _expand_globalsY   s$    


rE   z%s.%s.%s   z%s.%sr   z%s%sc                s    fdd}t || S )zIn the string `path`, replace tokens like {some.thing} with the
    corresponding value from the map `local_vars`.

    If there is no corresponding value, leave the token unchanged.
    c                s8   |  d}| kr | S |tjkr.tj| S |  dS )Nr   r   )r3   r   environ)r4   r5   )
local_varsr   r   r7      s    


z_subst_vars.<locals>._replacer)r?   r@   )r   rH   r7   r   )rH   r   _subst_vars   s    rI   c             C   s4   |   }x&| D ]\}}||kr$q|| |< qW d S )N)keysr9   )target_dict
other_dicttarget_keyskeyrD   r   r   r   _extend_dict   s
    rO   c             C   sd   i }|d kri }t |t  xBt| D ]4\}}tjdkrFtj|}tjt	||||< q(W |S )N)posixr   )
rO   r   r+   r9   r   r5   r   
expandusernormpathrI   )r0   varsresrN   rD   r   r   r   _expand_vars   s    
rU   c                s    fdd}t || S )Nc                s$   |  d}| kr | S |  dS )Nr   r   )r3   )r4   r5   )rS   r   r   r7      s    
zformat_value.<locals>._replacer)r?   r@   )rD   rS   r7   r   )rS   r   format_value   s    rV   c               C   s   t jdkrdS t jS )NrP   r    )r   r5   r   r   r   r   _get_default_scheme   s    
rW   c              C   s   t jdd } dd }t jdkrBt jdp.d}| r8| S ||dS tjdkr|td	}|r|| r`| S |dd
|dtjd d  S | r| S |ddS d S )NPYTHONUSERBASEc              W   s   t jt jj|  S )N)r   r   rQ   r   )argsr   r   r   joinuser   s    z_getuserbase.<locals>.joinuserr   APPDATA~PythondarwinPYTHONFRAMEWORKLibraryz%d.%dr   z.local)r   rG   getr5   sysplatformr   version_info)env_baserZ   baseZ	frameworkr   r   r   _getuserbase   s"    



rg   c          	   C   s"  t d}t d}t d}|dkr*i }i }i }tj| ddd}| }W dQ R X x|D ]}	|	ds\|	 d	krxq\||	}
|
r\|
d
d\}}| }|	dd	}d|kr|||< q\yt
|}W n$ tk
r   |	dd||< Y q\X |||< q\W t| }d}xt|dkrxt|D ]}|| }||pJ||}
|
dk	r|
d
}d}||kr|t|| }n||krd}nx|tjkrtj| }n`||kr|dr|dd |krd	}n$d| |krd}nt|d|  }nd	 ||< }|r||
 d }|d|
  | | }d|krF|||< n~yt
|}W n" tk
rt   | ||< Y n
X |||< || |dr|dd |kr|dd }||kr|||< n|||< || q(W qW x.| D ]"\}}t|tr| ||< qW || |S )zParse 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.
    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_]*)}Nzutf-8surrogateescape)encodingerrors# r   r   z$$$)CFLAGSLDFLAGSCPPFLAGSr   TFPY_rF   )recompilecodecsopen	readlines
startswithstripmatchr3   replaceint
ValueErrorlistrJ   lenr:   searchstrr   rG   endstartremover9   
isinstanceupdate)filenamerS   _variable_rx_findvar1_rx_findvar2_rxdonenotdoneflineslinemnvtmpvr6   renamed_variablesr5   rD   founditemafterkr   r   r   _parse_makefile   s    	
















r   c              C   sD   t rtjtdS ttdr,dttjf } nd} tjt	d| dS )z Return the path of the Makefile.Makefileabiflagszconfig-%s%srA   stdlib)
r-   r   r   r   r   hasattrrb   _PY_VERSION_SHORTr   r   )config_dir_namer   r   r   r   K  s    
c          
   C   s   t  }yt||  W nJ tk
r^ } z,d| }t|drF|d|j  }t|W dd}~X Y nX t }y"t|}t||  W dQ R X W nJ tk
r } z,d| }t|dr|d|j  }t|W dd}~X Y nX tr| d | d< dS )z7Initialize the module as appropriate for POSIX systems.z.invalid Python installation: unable to open %sstrerrorz (%s)N	BLDSHAREDLDSHARED)	r   r   IOErrorr   r   r   ru   r   r-   )rS   makefileemsgconfig_hr   r   r   r   _init_posixV  s&    


r   c             C   sV   t d| d< t d| d< t d| d< d| d< d	| d
< t| d< tjttj| d< dS )z+Initialize the module as appropriate for NTr   LIBDEST
platstdlib
BINLIBDESTr"   	INCLUDEPYz.pydSOz.exeEXEVERSIONBINDIRN)r   _PY_VERSION_SHORT_NO_DOTr   r   dirnamer   rb   
executable)rS   r   r   r   _init_non_posixr  s    r   c             C   s   |dkri }t d}t d}xx|  }|s0P ||}|rz|dd\}}yt|}W n tk
rn   Y nX |||< q"||}|r"d||d< q"W |S )zParse 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_]+) [*]/
r   r   r   )rr   rs   readlinery   r3   r{   r|   )fprS   	define_rxundef_rxr   r   r   r   r   r   r   r     s(    




c              C   s:   t r$tjdkrtjtd} q,t} ntd} tj| dS )zReturn the path of pyconfig.h.r   PCr#   z
pyconfig.h)r-   r   r5   r   r   r   r   )inc_dirr   r   r   r     s    
c               C   s   t tt S )z,Return a tuple containing the schemes names.)r:   sortedr+   r;   r   r   r   r   r     s    c               C   s
   t dS )z*Return a tuple containing the paths names.r    )r+   optionsr   r   r   r   r	     s    Tc             C   s&   t   |rt| |S tt| S dS )zReturn a mapping containing an install scheme.

    ``scheme`` is the install scheme name. If not provided, it will
    return the default scheme for the current platform.
    N)r1   rU   r>   r+   r9   )r0   rS   expandr   r   r   r
     s    
c             C   s   t ||||  S )z[Return a path corresponding to the scheme.

    ``scheme`` is the install scheme name.
    )r
   )r5   r0   rS   r   r   r   r   r     s    c              G   s  t dkri a tt d< tt d< tt d< tt d< td td  t d< tt d	< tt d
< tt d< ytjt d< W n tk
r   dt d< Y nX t	j
dkrtt  t	j
dkrtt  tjdkrt t d< dt krtt d< ntt d t d< tr\t	j
dkr\t}yt	 }W n tk
r   d}Y nX t	jt d s\||kr\t	j|t d }t	j|t d< tjdkrt	 d }t|dd }|dk rxdD ]2}t | }tdd|}tdd|}|t |< qW ndt	jkrt	jd }x8dD ]0}t | }tdd|}|d | }|t |< qW t dd}	td|	}
|
dk	r|
 d}t	j!|sx,dD ]$}t | }tdd|}|t |< q^W | rg }x| D ]}|"t | qW |S t S dS )ay  With no arguments, return a dictionary of all configuration
    variables relevant for the current platform.

    On Unix, this means every variable defined in Python's installed Makefile;
    On Windows and Mac OS 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prefixexec_prefix
py_versionpy_version_shortr   r   py_version_nodotrf   platbaseprojectbaser   rl   )r   Zos2rP   z2.6userbasesrcdirr^   r      )ro   
BASECFLAGSrn   	PY_CFLAGSr   z-arch\s+\w+\s z-isysroot [^ 	]*Z	ARCHFLAGSrn   z-isysroot\s+(\S+)r   z-isysroot\s+\S+(\s|$))#_CONFIG_VARS_PREFIX_EXEC_PREFIX_PY_VERSIONr   r   rb   r   AttributeErrorr   r5   r   r   versionrg   r   r-   getcwdr   r   isabsr   rR   rc   unamer{   splitrr   r@   rG   ra   r   r3   existsappend)rY   rf   cwdr   Zkernel_versionmajor_versionrN   flagsarchrn   r   Zsdkvalsr5   r   r   r   r     s    















c             C   s   t  | S )zReturn the value of a single variable using the dictionary returned by
    'get_config_vars()'.

    Equivalent to get_config_vars().get(name)
    )r   ra   )r5   r   r   r   r   P  s    c              C   s^  t jdkrnd} tj| }|dkr(tjS tjd|}tj|t|  |  }|dkr\dS |dkrhdS tjS t jd	kstt d
stjS t 	 \}}}}}| 
dd}|
dd}|
dd}|dd dkrd||f S |dd dkr&|d dkrPd}dt|d d |dd f }n*|dd dkrDd||f S |dd dkrdd|||f S |dd d krd }td!}	|	|}
|
rP|
 }n|dd d"krPt }|d#}|}ytd$}W n tk
r   Y nJX ztd%| }
W d|  X |
dk	r2d&|
d'd&dd }|s<|}|rP|}d(}|d& d)krd*t d+d krd,}t d+}td-|}ttt|}t|d'kr|d }n^|d.krd,}nN|d/krd0}n>|d1krd2}n.|d3krd4}n|d5krd6}ntd7|f n<|d8kr0tjd9krPd:}n |d;krPtjd9krLd<}nd=}d>|||f S )?a  Return a string that identifies the current platform.

    This is used mainly to distinguish platform-specific build directories and
    platform-specific built distributions.  Typically includes the OS name
    and version and the architecture (as supplied by 'os.uname()'),
    although the exact information included depends on the OS; eg. for IRIX
    the architecture isn't particularly important (IRIX only runs on SGI
    hardware), but for Linux the kernel version isn't particularly
    important.

    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u
       irix-5.3
       irix64-6.2

    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win-ia64 (64bit Windows on Itanium)
       win32 (all others - specifically, sys.platform is returned)

    For other non-POSIX platforms, currently just returns 'sys.platform'.
    r   z bit ()amd64z	win-amd64Zitaniumzwin-ia64rP   r   /rl   r   _-N   linuxz%s-%ssunosr   5solarisz%d.%srF   r      Zirixaixz%s-%s.%s   cygwinz[\d.]+r^   MACOSX_DEPLOYMENT_TARGETz0/System/Library/CoreServices/SystemVersion.plistz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>r   r   macosxz10.4.z-archrn   fatz-arch\s+(\S+))i386ppc)r   x86_64intel)r   r   r   Zfat3)ppc64r   fat64)r   r   r   r   	universalz%Don't know machine value for archs=%rr   l        r   )PowerPCPower_Macintoshr   r   z%s-%s-%s) r   r5   rb   r   r(   rc   r~   lowerr   r   rz   r{   rr   rs   ry   r3   r   ra   ru   r   r   readcloser   r   rx   findallr:   r   r.   r|   maxsize)r   ijZlookosnamehostreleaser   machinerel_rer   ZcfgvarsZmacverZ
macreleaser   cflagsZarchsr   r   r   r   Y  s    
$












c               C   s   t S )N)r   r   r   r   r   r     s    c             C   sJ   xDt t| D ]0\}\}}|dkr2td|   td||f  qW d S )Nr   z%s: z
	%s = "%s")	enumerater   r9   print)titledataindexrN   rD   r   r   r   _print_dict  s    r  c               C   sR   t dt   t dt   t dt   t   tdt  t   tdt  dS )z*Display all information sysconfig detains.zPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"Paths	VariablesN)r  r   r   rW   r  r
   r   r   r   r   r   _main  s    r  __main__)N)N)@__doc__rt   r   rr   rb   os.pathr   r   configparserImportErrorConfigParser__all__r   r   r   r   r   r   r5   r   r   r   r-   r$   r1   RawConfigParserr+   rs   r?   rE   rd   r   r   r   rR   r   r   r   r   r   
_USER_BASErI   rO   rU   rV   rW   rg   r   r   r   r   r   r   r   r	   r
   r   r   r   r   r   r  r  r&   r   r   r   r   <module>   s   ""
!	
v
 	 #
