b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 / distutils /
Filename/usr/lib64/python2.6/distutils/util.pyc
Size16.04 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed20-Jun-2019 19:45
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@s1dZdZddkZddkZddkZddkZddklZddkl Z ddk
l Z ddk l
Z
ddklZd �Zd
�Zd �Zd ad
�Zd�Zdd�Zdaaad�Zd�Zdd d d�Zd�Zd d dddd dd�Zd�ZdS(sudistutils.util

Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
s6$Id: util.py 83588 2010-08-02 21:35:06Z ezio.melotti $iÿÿÿÿN(tDistutilsPlatformError(tnewer(tspawn(tlog(tDistutilsByteCompileErrorcCsâtidjo�d}titi|�}|djotiStitid|�}ti|t|�|!i�}|djodS|djodStiStid jpt td
� otiSti
�\}}}}}ti|�}ti |d d �}ti |d
d�}ti |d d�}|d djod||fS|d djoA|ddjo,d}dt |d�d|df}qÑn*|d djod||fS|d djod|||fS|d djo?d}t
id �} | i|�}
|
o|
i�}qÑn�|d d!jo�dd"kl} | �} tiid#�}
|
p| id#�}
n|
}ytd$�}Wntj
on^Xt
id%d&|i��}
|i�|
d<j o)d'i|
id(�id'�d �}n|
p
|}
n|
o�dd"kl} |
}d)}|d'd*jod+| �id,d �i�joíd-}| �id,�}t
id.|�}tt t!|���}t|�d(jo|d}qÉ|d=jo
d-}qÉ|d>jo
d2}qÉ|d?jo
d3}qÉ|d@jo
d5}qÉ|dAjo
d6}qÉt"d7|f��qÍ|d/joti#dBjo
d1}qÉqÍ|dCjo$d0}ti#dDjo
d4}qÉqÍqÑnd;|||fS(Es«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'.
tnts bit (iÿÿÿÿt)tamd64s win-amd64titaniumswin-ia64tposixtunamet/tt t_t-itlinuxs%s-%stsunosit5tsolariss%d.%siiitirixtaixs%s-%s.%sitcygwins[\d.]+tdarwin(tget_config_varstMACOSX_DEPLOYMENT_TARGETs0/System/Library/CoreServices/SystemVersion.plists'<key>ProductUserVisibleVersion</key>\s*s<string>(.*?)</string>t.itmacosxs10.4.s-archtCFLAGStfats
-arch\s+(\S+)ti386tppctx86_64tinteltfat3tppc64tfat64t universals%Don't know machine value for archs=%ri tPowerPCtPower_Macintoshs%s-%s-%sN(RR(RR (RRR (R#R (RRR#R I(R&R'I($tostnametstringtfindtsystversiontplatformtlentlowerthasattrR
treplacetinttretcompiletmatchtgrouptdistutils.sysconfigRtenvirontgettopentIOErrortsearchtreadtclosetNonetjointsplittstriptfindallttupletsortedtsett
ValueErrortmaxint(tprefixtitjtlooktosnamethosttreleaseR-tmachinetrel_retmRtcfgvarstmacvert
macreleasetftcflagstarchs((s&/usr/lib64/python2.6/distutils/util.pyt get_platforms¬
 

!* 

)
"











cCs¸tidjo|S|p|S|ddjotd|�n|ddjotd|�nti|d�}xd|jo|id�qzW|ptiStii|�S(sÎReturn 'pathname' as a name that will work on the native filesystem,
i.e. split it on '/' and put it back together again using the current
directory separator. Needed because filenames in the setup script are
always supplied in Unix style, and have to be converted to the local
convention before we can actually use them in the filesystem. Raises
ValueError on non-Unix-ish systems if 'pathname' either starts or
ends with a slash.
R ispath '%s' cannot be absoluteiÿÿÿÿspath '%s' cannot end with '/'R( R(tsepRHR*RBtremovetcurdirtpathRA(tpathnametpaths((s&/usr/lib64/python2.6/distutils/util.pyt convert_path¹s 
cCs�tidjoBtii|�ptii||�Stii||d�Sn;tidjoKtii|�\}}|ddjo|d}ntii||�StidjoNtii|�\}}|dtijo|d}ntii||�Stidjoatii|�ptii||�Sti|dd�}d|d}tii||�Snt d ti�d
S( s Return 'pathname' with 'new_root' prepended. If 'pathname' is
relative, this is equivalent to "os.path.join(new_root,pathname)".
Otherwise, it requires making 'pathname' relative and then joining the
two, which is tricky on DOS/Windows and Mac OS.
R iRis\tos2tmact:s!nothing known about platform '%s'N(
R(R)R^tisabsRAt
splitdriveR[R*RBR(tnew_rootR_tdriveR^telements((s&/usr/lib64/python2.6/distutils/util.pyt change_rootÕs,icCs�todStidjo@dtijo0ddk}|iti��dtid<ndtijot�tid<ndadS(sLEnsure that 'os.environ' has all the environment variables we
guarantee that users can use in config files, command-line options,
etc. Currently this includes:
HOME - user's home directory (Unix only)
PLAT - description of the current platform, including hardware
and OS (see 'get_platform()')
NR tHOMEiÿÿÿÿitPLATi(t_environ_checkedR(R)R9tpwdtgetpwuidtgetuidRZ(Rn((s&/usr/lib64/python2.6/distutils/util.pyt
check_environüs   $cCsSt�|d�}ytid||�SWn"tj
o}td|�nXdS(sàPerform shell/Perl-style variable substitution on 'string'. Every
occurrence of '$' followed by a name is considered a variable, and
variable is substituted by the value found in the 'local_vars'
dictionary, or in 'os.environ' if it's not in 'local_vars'.
'os.environ' is first checked/augmented to guarantee that it contains
certain values: see 'check_environ()'. Raise ValueError for any
variables not found in either 'local_vars' or 'os.environ'.
cSs:|id�}||jot||�Sti|SdS(Ni(R7tstrR(R9(R6t
local_varstvar_name((s&/usr/lib64/python2.6/distutils/util.pyt_substs
s\$([a-zA-Z_][a-zA-Z_0-9]*)sinvalid variable '$%s'N(RqR4tsubtKeyErrorRH(tsRsRutvar((s&/usr/lib64/python2.6/distutils/util.pyt
subst_varss  serror: cCsut|d�oMt|d�o=|io|d|i|if}qq|d|i}n|t|d�}|S(s�Generate a useful error message from an EnvironmentError (IOError or
OSError) exception object. Handles Python 1.5.1 and 1.5.2 styles, and
does what it can to deal with exception objects that don't have a
filename (which happens when the error is due to a two-file operation,
such as 'rename()' or 'link()'. Returns the error message as a string
prefixed with 'prefix'.
tfilenametstrerrors%s: %ss%siÿÿÿÿ(R1R{R|Rr(texcRJterror((s&/usr/lib64/python2.6/distutils/util.pytgrok_environment_error+s 
cCs8tidti�atid�atid�adS(Ns
[^\\\'\"%s ]*s'(?:[^'\\]|\\.)*'s"(?:[^"\\]|\\.)*"(R4R5R*t
whitespacet
_wordchars_ret
_squote_ret
_dquote_re(((s&/usr/lib64/python2.6/distutils/util.pyt _init_regexCscCsñtd jo t�nti|�}g}d}x·|o¯ti||�}|i�}|t|�jo|i|| �Pn||ti jo.|i|| �ti
||�}d}nþ||djo$|| ||d}|d}nÉ||djot i||�}n9||djot i||�}nt
d||�|d jotd||�n|i�\}}|| ||d|d!||}|i�d}|t|�jo|i|�Pq6q6W|S(
sSplit a string up according to Unix shell-like rules for quotes and
backslashes. In short: words are delimited by spaces, as long as those
spaces are not escaped by a backslash, or inside a quoted string.
Single and double quotes are equivalent, and the quote characters can
be backslash-escaped. The backslash is stripped from any two-character
escape sequence, leaving only the escaped character. The quote
characters are stripped from any quoted string. Returns a list of
words.
is\it't"s!this can't happen (bad char '%c')s"bad string (mismatched %s quotes?)iN(R�R@R�R*RCR6tendR/tappendR�tlstripR�R�t RuntimeErrorRHtspan(RxtwordstposRSR�tbeg((s&/usr/lib64/python2.6/distutils/util.pyt split_quotedIsF
 

%

cCsp|djo=d|i|f}|ddjo|dd!d}qJnti|�|p||�ndS(s�Perform some action that affects the outside world (eg. by
writing to the filesystem). Such actions are special because they
are disabled by the 'dry_run' flag. This method takes care of all
that bureaucracy for you; all you have to do is supply the
function to call and an argument tuple for it (to embody the
"external action" being performed), and an optional message to
print.
s%s%riþÿÿÿs,)iRN(R@t__name__Rtinfo(tfunctargstmsgtverbosetdry_run((s&/usr/lib64/python2.6/distutils/util.pytexecute�s

cCsGti|�}|djodS|djodStd|f�dS(sôConvert a string representation of truth to true (1) or false (0).

True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if
'val' is anything else.
tytyesttttruetont1itntnoRWtfalsetofft0isinvalid truth value %rN(R�R�R�R�R�R�(R�R�RWR R¡R¢(R*R0RH(tval((s&/usr/lib64/python2.6/distutils/util.pyt strtobool�s 

ic Cstiotd��n|djoto
|dj}n|p�y&ddkl}|d�\} }
Wn6tj
o*ddkl} d| d�} }
nXt i
d|
�|p�| dj ot i | d�} nt
|
d�} | id �| ititt|�d
�d �| id |||||f�| i�nti|
g}
|d
jo|
id
d�n"|djo|
id
d�nt|
d|�tt i|
fd|
d|�n:ddkl}x&|D]}|ddjoqên|todpd}|}|oB|t|� |jotd||f�n|t|�}n|ot ii||�}nt ii|�}|o`|pt||�o2t i
d||�|p||||�qqt i d||�qêqêWdS(s�Byte-compile a collection of Python source files to either .pyc
or .pyo files in the same directory. 'py_files' is a list of files
to compile; any files that don't end in ".py" are silently skipped.
'optimize' must be one of the following:
0 - don't optimize (generate .pyc)
1 - normal optimization (like "python -O")
2 - extra optimization (like "python -OO")
If 'force' is true, all files are recompiled regardless of
timestamps.

The source filename encoded in each bytecode file defaults to the
filenames listed in 'py_files'; you can modify these with 'prefix' and
'basedir'. 'prefix' is a string that will be stripped off of each
source filename, and 'base_dir' is a directory name that will be
prepended (after 'prefix' is stripped). You can supply either or both
(or neither) of 'prefix' and 'base_dir', as you wish.

If 'dry_run' is true, doesn't actually do anything that would
affect the filesystem.

Byte-compilation is either done directly in this interpreter process
with the standard py_compile module, or indirectly by writing a
temporary script and executing it. Normally, you should let
'byte_compile()' figure out to use direct compilation or not (see
the source for details). The 'direct' flag is used by the script
generated in indirect mode; unless you know what you're doing, leave
it set to None.
sbyte-compiling is disabled.iiÿÿÿÿ(tmkstemps.py(tmktemps$writing byte-compilation script '%s'tws2from distutils.util import byte_compile
files = [
s,
s]
s�
byte_compile(files, optimize=%r, force=%r,
prefix=%r, base_dir=%r,
verbose=%r, dry_run=0,
direct=1)
is-Ois-OOR�s removing %s(R5iýÿÿÿtctos1invalid prefix: filename %r doesn't start with %rsbyte-compiling %s to %ss%skipping byte-compilation of %s to %sN(!R,tdont_write_bytecodeRR@t __debug__ttempfileR¥t ImportErrorR¦RR�R(tfdopenR;twriteR*RAtmaptreprR?t
executabletinsertRR�R\t
py_compileR5R/RHR^tbasenameRtdebug(tpy_filestoptimizetforceRJtbase_dirR�R�tdirectR¥t script_fdt script_nameR¦tscripttcmdR5tfiletcfiletdfilet
cfile_base((s&/usr/lib64/python2.6/distutils/util.pyt byte_compile«sj"


&

  cCs,ti|d�}ti|dd�}|S(s�Return a version of the string escaped for inclusion in an
RFC-822 header, by ensuring there are 8 spaces space after each newline.
s
iR
s (R*RBRA(theadertlines((s&/usr/lib64/python2.6/distutils/util.pyt
rfc822_escape:s( t__doc__t __revision__R,R(R*R4tdistutils.errorsRtdistutils.dep_utilRtdistutils.spawnRt distutilsRRRZRaRjRmRqRzRR@R�R�R�R�R�R�R¤RÄRÇ(((s&/usr/lib64/python2.6/distutils/util.pyt<module>s00 ©  &     ?  �