Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/root/sys/lib/python2.7/sysconfig.pyo

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�`^c@sdZddlZddlZddlmZmZiidd6dd6dd	6d
d6dd
6dd6dd6dd6d6idd6dd6dd	6dd6dd
6dd6dd6dd6d6idd6dd6dd	6dd6dd
6dd6dd6dd6d6idd6dd6dd	6dd6dd
6dd6dd6dd6d6idd6dd6dd	6dd6d d
6d!d6d"d6d#6id$d6d$d6d%d	6d%d6d&d
6d'd6d"d6d(6idd6dd6dd	6dd6d d
6d!d6d"d6d)6id*d6d*d6d+d	6d+d6d,d
6d!d6d"d6d-6idd6dd6dd	6d
d6dd
6dd6d.d6dd6d/6idd6dd6dd	6dd6dd
6dd6d0d6dd6d16idd6dd6dd	6dd6d d
6d2d6d"d6d36Zd]Zejj	�d4Z
ejd5 Ze
d4e
d6Zej
jej�Zej
jej�ZdadZd7�Zejrjej
jeej��Zneej��Zejdkr�d8ed9j�kr�eej
jee��Znejdkrd:ed;j�kreej
jeee��ZnejdkrKd<ed=j�krKeej
jeee��Znejd>kr�ed?d@kr�eej
je��ZndAejkr�ej
jej
j dB��ZndC�Z!e!�Z"e"rd^Z#ejd>kr�#d_Z#nx-e#D]"Z$dDee$d
<dEee$d<q�dF�Z%dG�Z&dH�Z'dI�Z(dJ�Z)ddK�Z*dL�Z+dM�Z,dN�Z-dO�Z.ddP�Z/dQ�Z0dR�Z1dS�Z2e(�de3dT�Z4e(�de3dU�Z5dV�Z6dW�Z7dX�Z8dY�Z9dZ�Z:d[�Z;e<d\kre;�ndS(`s7Provide access to Python's configuration information.

i�N(tpardirtrealpaths#{base}/lib/python{py_version_short}tstdlibs'{platbase}/lib/python{py_version_short}t
platstdlibs1{base}/lib/python{py_version_short}/site-packagestpurelibs5{platbase}/lib/python{py_version_short}/site-packagestplatlibs'{base}/include/python{py_version_short}tincludes+{platbase}/include/python{py_version_short}tplatincludes
{base}/bintscriptss{base}tdatatposix_prefixs{base}/lib/pythons{base}/include/pythont
posix_homes
{base}/Libs{base}/Lib/site-packagess{base}/Includes{base}/Scriptstnttos2s'{userbase}/lib/python{py_version_short}s5{userbase}/lib/python{py_version_short}/site-packagess+{userbase}/include/python{py_version_short}s{userbase}/bins
{userbase}tos2_homes#{userbase}/Python{py_version_nodot}s1{userbase}/Python{py_version_nodot}/site-packagess+{userbase}/Python{py_version_nodot}/Includes{userbase}/Scriptstnt_usert
posix_users{userbase}/lib/pythons#{userbase}/lib/python/site-packagess{userbase}/includetosx_framework_users/rc/bintplan9_prefixs
{base}/rc/bint
plan9_homes{userbase}/bin/rct
plan9_useriiicCs'yt|�SWntk
r"|SXdS(N(RtOSError(tpath((s/sys/lib/python2.7/sysconfig.pyt_safe_realpath~s
tpcbuildi�s\pc\vi�s\pcbuild\amd64i�tplan9i�tPlan9t_PYTHON_PROJECT_BASEt.cCs=x6dD].}tjjtjjtd|��rtSqWtS(Ns
Setup.distsSetup.localtModules(s
Setup.distsSetup.local(tosRtisfiletjoint
_PROJECT_BASEtTruetFalse(tfn((s/sys/lib/python2.7/sysconfig.pytis_python_build�s
$s{projectbase}/Includes{srcdir}cCscy|j|�SWnKtk
r^y|jtj�SWq_tk
rZ}td|��q_XnXdS(Ns{%s}(tformattKeyErrorRtenvirontAttributeError(tst
local_varstvar((s/sys/lib/python2.7/sysconfig.pyt_subst_vars�s
cCsI|j�}x6|j�D](\}}||kr7qn|||<qWdS(N(tkeystitems(ttarget_dictt
other_dictttarget_keystkeytvalue((s/sys/lib/python2.7/sysconfig.pyt_extend_dict�s
cCs�i}|dkri}nt|t��xat|j�D]O\}}tjdkrltjj|�}ntjj	t
||��||<q<W|S(NtposixR(sposixsnt(tNoneR5tget_config_varst_INSTALL_SCHEMESR/RtnameRt
expandusertnormpathR-(tschemetvarstresR3R4((s/sys/lib/python2.7/sysconfig.pyt_expand_vars�s	#cCs0tjdkr)tjdkr"dSdSntjS(NR6RRR
(RR:tsystplatform(((s/sys/lib/python2.7/sysconfig.pyt_get_default_scheme�s
cCs�tjjdd�}d�}tjdkr\tjjd�pBd}|rO|S||d�Stjdkr�td�}|r�|r�|S|dd	|d
tjd �Sntjdkr�|r�|S|d�S|r�|S|dd
�S(NtPYTHONUSERBASEcWstjjtjj|��S(N(RRR;R (targs((s/sys/lib/python2.7/sysconfig.pytjoinuser�sRtAPPDATAt~tPythontdarwintPYTHONFRAMEWORKtLibrarys%d.%diRs.local(	RR(tgetR7R:RARBtget_config_vartversion_info(tenv_baseRFtbaset	framework((s/sys/lib/python2.7/sysconfig.pyt_getuserbase�s	
cCsddl}|jd�}|jd�}|jd�}|dkrNi}ni}i}t|��}|j�}	WdQXx�	D]�}
|
jd�s�|
j�dkr�q�n|j|
�}|r�|jdd	�\}}
|
j�}
|
j	d
d�}d|kr|
||<qZyt
|
�}
Wn'tk
rL|
j	d
d�||<qZX|
||<q�q�Wx^|r�xQ|j�D]C}||}|j
|�p�|j
|�}|r�|jd�}t}||kr�t||�}nB||kr�}n-|tjkrtj|}nd||<}|r�||j�}||j� ||}d|kre|||<q�yt
|�}Wn!tk
r�|j�||<nX|||<||=q�qt||=qtWqaWx<|j�D].\}}
t|
t�r�|
j�||<q�q�W|j|�|S(s�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.
    i�Ns"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)s\$\(([A-Za-z][A-Za-z0-9_]*)\)s\${([A-Za-z][A-Za-z0-9_]*)}t#tiis$$t$(tretcompileR7topent	readlinest
startswithtstriptmatchtgrouptreplacetintt
ValueErrorR.tsearchR"tstrR#RR(tendtstartR/t
isinstancetupdate(tfilenameR>RWt_variable_rxt_findvar1_rxt_findvar2_rxtdonetnotdonetftlinestlinetmtntvttmpvR:R4tfoundtitemtaftertk((s/sys/lib/python2.7/sysconfig.pyt_parse_makefile�sp	
!

	
	




cCs5trtjjtd�Stjjtd�dd�S(NtMakefileRtconfig(t
_PYTHON_BUILDRRR R!tget_path(((s/sys/lib/python2.7/sysconfig.pyt_get_makefile_filename<sc	Cs;ddl}i}t�}yt||�WnLtk
rz}d|}t|d�rk|d|j}nt|��nXt�}y&t|��}t||�WdQXWnLtk
r�d|}t|d�r�d|j}nt|��nXt	r|d|d<nd}d	t
jkrYddl}|j
|�}	||	_|	t
j|<nd
t�t
jd f}
tt
d�r�|
d
7}
nytj|
�Wntk
r�nXtjj|
|d�}t|d��}|jd�|jd�|j|d|�WdQXtdd��}|j|
�WdQXdS(s;Generate the Python module containing build-time variables.i�Ns.invalid Python installation: unable to open %ststrerrors (%s)t	BLDSHAREDtLDSHAREDt_sysconfigdataRJsbuild/lib.%s-%sitgettotalrefcounts-pydebugs.pytwbsB# system configuration generated and used by the sysconfig module
sbuild_time_vars = tstreamspybuilddir.txttw(tpprintR~RytIOErrorthasattrRtget_config_h_filenameRYtparse_config_hR|RARBtimpt
new_moduletbuild_time_varstmodulestget_platformtversionRtmakedirsRRR twrite(R�R>tmakefiletetmsgtconfig_hRnR:R�tmodulet
pybuilddirtdestfile((s/sys/lib/python2.7/sysconfig.pyt_generate_posix_varsAsR	
	

	



cCs!ddlm}|j|�dS(s7Initialize the module as appropriate for POSIX systems.i�(R�N(R�R�Rg(R>R�((s/sys/lib/python2.7/sysconfig.pyt_init_posix�scCsqtd�|d<td�|d<td�|d<d|d<d	|d
<t|d<tjjttj��|d<d
S(s+Initialize the module as appropriate for NTRtLIBDESTRt
BINLIBDESTRt	INCLUDEPYs.pydtSOs.exetEXEtVERSIONtBINDIRN(R}t_PY_VERSION_SHORT_NO_DOTRRtdirnameRRAt
executable(R>((s/sys/lib/python2.7/sysconfig.pyt_init_non_posix�s


c	Cs�ddl}|dkr!i}n|jd�}|jd�}x�tr�j�}|s^Pn|j|�}|r�|jdd�\}}yt|�}Wntk
r�nX|||<qB|j|�}|rBd||jd�<qBqBW|S(s�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.
    i�Ns"#define ([A-Z][A-Za-z0-9_]+) (.*)
s&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
iii(	RWR7RXR"treadlineR]R^R`Ra(	tfpR>RWt	define_rxtundef_rxRpRqRrRs((s/sys/lib/python2.7/sysconfig.pyR��s*		

cCs�tr~tjdkr-tjjtd�}q�tjdkrutjjtd�}tjd}tjj|d|�St}nt	d�}tjj|d�S(	sReturns the path of pyconfig.h.RtPCRRtcputypes
pyconfig-%s.hRs
pyconfig.h(
R|RR:RR R!RARBR(R}(tinc_dirR�((s/sys/lib/python2.7/sysconfig.pyR��s
	cCs tj�}|j�t|�S(s-Returns a tuple containing the schemes names.(R9R.tsortttuple(tschemes((s/sys/lib/python2.7/sysconfig.pytget_scheme_names�s
cCstS(s+Returns a tuple containing the paths names.(t_SCHEME_KEYS(((s/sys/lib/python2.7/sysconfig.pytget_path_names�scCs|rt||�St|SdS(s�Returns 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(R@R9(R=R>texpand((s/sys/lib/python2.7/sysconfig.pyt	get_paths�s
cCst|||�|S(s\Returns a path corresponding to the scheme.

    ``scheme`` is the install scheme name.
    (R�(R:R=R>R�((s/sys/lib/python2.7/sysconfig.pyR}�scGs�ddl}tdkr�iattd<ttd<ttd<ttd<tdtdtd	<ttd
<ttd<ttd<tj	dkr�t
t�ntj	dkr�tt�nt�td<dtkr�ttd<nt
rutj	dkrut}ytj�}Wntk
rd}nXtjjtd�ru||krutjj|td�}tjj|�td<quntjdkr�ddl}|jt�q�n|r�g}x$|D]}|jtj|��q�W|StSdS(syWith 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.
    i�Ntprefixtexec_prefixt
py_versiontpy_version_shortiitpy_version_nodotRQtplatbasetprojectbaseRR
R6tuserbasetsrcdirRJ(sntsos2(RWt_CONFIG_VARSR7t_PREFIXt_EXEC_PREFIXt_PY_VERSIONt_PY_VERSION_SHORTR!RR:R�R�RSR|tgetcwdRRtisabsR R<RARBt_osx_supporttcustomize_config_varstappendRM(RERWRQtcwdR�R�tvalsR:((s/sys/lib/python2.7/sysconfig.pyR8�sJ














cCst�j|�S(s�Return the value of a single variable using the dictionary returned by
    'get_config_vars()'.

    Equivalent to get_config_vars().get(name)
    (R8RM(R:((s/sys/lib/python2.7/sysconfig.pyRN*scCs�ddl}tjdkr�d}tjj|�}|dkrFtjStjjd|�}tj|t|�|!j�}|dkr�dS|dkr�d	StjSd
tj	kr�tj	d
Stjdks�t
td�r�jStj�\}}}}}	|j�jd
d�}|	jdd�}	|	jd
d�}	|d dkrWd||	fS|d dkr�|ddkr�d}dt
|d�d|df}idd6dd6}
|	d |
tj7}	q�n�|d! d"kr�||fS|d d#kr
d$|||fS|d% d&krYd&}|jd'�}|j|�}|r�|j�}q�nC|d% d(kr�ddl}
|
jt�|||	�\}}}	nd)|||	fS(*s�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'.
    i�NRs bit (t)tamd64s	win-amd64titaniumswin-ia64t_PYTHON_HOST_PLATFORMR6tunamet/RUt t_t-itlinuxs%s-%stsunosit5tsolariss%d.%siit32biti�t64bitl��s.%sitirixtaixs%s-%s.%sitcygwins[\d.]+RJs%s-%s-%s(RWRR:RAR�tfindRBtlentlowerR(R�R�R_R`tmaxintRXR]R^R�tget_platform_osxR8(RWR�titjtlooktosnamethosttreleaseR�tmachinetbitnesstrel_reRqR�((s/sys/lib/python2.7/sysconfig.pyR�2sZ "cCstS(N(R�(((s/sys/lib/python2.7/sysconfig.pytget_python_version�scCsZxStt|j���D]9\}\}}|dkrCd|GHnd||fGHqWdS(Nis%s: s
	%s = "%s"(t	enumeratetsortedR/(ttitleR	tindexR3R4((s/sys/lib/python2.7/sysconfig.pyt_print_dict�s+cCsddtjkrt�dSdt�GHdt�GHdt�GHHtdt��Htdt��dS(s*Display all information sysconfig detains.s--generate-posix-varsNsPlatform: "%s"sPython version: "%s"s!Current installation scheme: "%s"tPathst	Variables(	RAtargvR�R�R�RCR�R�R8(((s/sys/lib/python2.7/sysconfig.pyt_main�st__main__(sstdlibs
platstdlibspurelibsplatlibsincludesscriptssdata(sposix_prefixs
posix_home(splan9_prefixs
plan9_home(=t__doc__RARtos.pathRRR9R�R�tsplitR�R�R�RR<R�R�R�R�R7R�t
_USER_BASERR�R�R!R�R:R�R RBR(tabspathR%R|R�R=R-R5R@RCRSRyR~R�R�R�R�R�R�R�R"R�R}R8RNR�R�R�R�t__name__(((s/sys/lib/python2.7/sysconfig.pyt<module>s4
		%%!%!!		

							V		D						G		\			

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.