AlkantarClanX12

Your IP : 18.227.52.248


Current Path : /opt/alt/python33/lib64/python3.3/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/distutils/__pycache__/util.cpython-33.pyo

�
��f:Qc	@s�dZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	�Zd
d�Zdd
�Zdadd�Zdd�Zddd�Zdaaadd�Zdd�Zddddd�Zdd�Zddddddddd�Zd d!�Zdddd"d#�Z ddddd$d%�Z!Gd&d'�d'�Z"dS((uudistutils.util

Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
iN(uDistutilsPlatformError(unewer(uspawn(ulog(uDistutilsByteCompileErrorcCs�tjdkr�d}tjj|�}|d*kr:tjStjjd|�}tj|t|�|�j�}|dkr�dS|dkr�dStjSd	tjkr�tjd	Stjd
ks�t	td�r�tjStj
�\}}}}}|j�jdd
�}|jdd�}|jdd�}|dd�dkrTd||fS|dd�dkr�|ddkr�d}dt|d�d|dd�f}idd6dd6}	|d |	tj
7}q�n�|dd!�d"kr�d||fS|dd�d#kr"d$|||fS|dd%�d&krzd&}tjd'tj�}
|
j|�}|r�|j�}q�n[|dd%�d(kr�ddl}ddl}
|j|
jj�|||�\}}}nd)|||fS(+u�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'.
    untu bit (iu)uamd64u	win-amd64uitaniumuwin-ia64u_PYTHON_HOST_PLATFORMuposixuunameu/uu u_u-Niulinuxu%s-%susunosiu5usolarisu%d.%siiu32biti���u64bitl����u.%siuirixuaixu%s-%s.%siucygwinu[\d.]+udarwinu%s-%s-%si����(uosunameusysuversionufinduplatformulenuloweruenvironuhasattruunameureplaceuintumaxsizeureucompileuASCIIumatchugroupu_osx_supportudistutils.sysconfiguget_platform_osxu	sysconfiguget_config_vars(uprefixuiujulookuosnameuhostureleaseuversionumachineubitnessurel_reumu_osx_supportu	distutils((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyuget_platformsX#(uget_platformcCs�tjdkr|S|s|S|ddkr@td|��n|ddkrctd|��n|jd�}xd|kr�|jd�quW|s�tjStjj|�S(u�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.
    u/iupath '%s' cannot be absoluteiupath '%s' cannot end with '/'u.i����(uosusepu
ValueErrorusplituremoveucurdirupathujoin(upathnameupaths((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyuconvert_pathos	uconvert_pathcCs(tjdkrTtjj|�s4tjj||�Stjj||dd��Sn�tjdkr�tjj|�\}}|ddkr�|dd�}ntjj||�Stjdkrtjj|�\}}|dtjkr�|dd�}ntjj||�Stdtj��dS(	u	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.
    uposixiNuntiu\uos2u!nothing known about platform '%s'(uosunameupathuisabsujoinu
splitdriveusepuDistutilsPlatformError(unew_rootupathnameudriveupath((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyuchange_root�s uchange_rootcCs�tr
dStjdkrWdtjkrWddl}|jtj��dtjd<ndtjkryt�tjd<ndadS(uLEnsure 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()')
    NuposixuHOMEiiuPLATi(u_environ_checkeduosunameuenvironupwdugetpwuidugetuiduget_platform(upwd((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyu
check_environ�s	#u
check_environcCsit�|dd�}ytjd||�SWn5tk
rd}ztd|��WYdd}~XnXdS(u�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'.
    cSs8|jd�}||kr)t||�Stj|SdS(Ni(ugroupustruosuenviron(umatchu
local_varsuvar_name((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyu_subst�susubst_vars.<locals>._substu\$([a-zA-Z_][a-zA-Z_0-9]*)uinvalid variable '$%s'N(u
check_environureusubuKeyErroru
ValueError(usu
local_varsu_substuvar((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyu
subst_vars�s	u
subst_varsuerror: cCs|t|�S(N(ustr(uexcuprefix((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyugrok_environment_error�sugrok_environment_errorcCs8tjdtj�atjd�atjd�adS(Nu
[^\\\'\"%s ]*u'(?:[^'\\]|\\.)*'u"(?:[^"\\]|\\.)*"(ureucompileustringu
whitespaceu
_wordchars_reu
_squote_reu
_dquote_re(((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyu_init_regex�su_init_regexcCstdkrt�n|j�}g}d}x�|rtj||�}|j�}|t|�kr�|j|d|��Pn||tj	kr�|j|d|��||d�j
�}d}n||dkr
|d|�||dd�}|d}n�||dkr/tj||�}n9||dkrTtj||�}nt
d||��|dkr�td||��n|j�\}}|d|�||d|d�||d�}|j�d	}|t|�kr1|j|�Pq1q1W|S(
uSplit 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.
    iNu\iu'u"u!this can't happen (bad char '%c')u"bad string (mismatched %s quotes?)i(u
_wordchars_reuNoneu_init_regexustripumatchuendulenuappendustringu
whitespaceulstripu
_squote_reu
_dquote_reuRuntimeErroru
ValueErroruspan(usuwordsuposumuendubeg((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyusplit_quoted�s@
		"
4
usplit_quotedcCss|dkrOd|j|f}|dd�dkrO|dd�d}qOntj|�|so||�ndS(	u�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.
    u%s%riNu,)iu)i����i����(uNoneu__name__uloguinfo(ufuncuargsumsguverboseudry_run((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyuexecute#s	
uexecutecCsC|j�}|dkrdS|dkr,dStd|f��dS(u�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.
    uyuyesututrueuonu1iununoufufalseuoffu0iuinvalid truth value %rN(uyuyesututrueuonu1(ununoufufalseuoffu0(uloweru
ValueError(uval((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyu	strtobool6su	strtoboolicCstjrtd��n|dkr9to3|dk}n|s�y&ddlm}|d�\}	}
Wn5tk
r�ddlm}d|d�}	}
YnXt	j
d|
�|s@|	dk	r�tj|	d�}nt
|
d�}|jd�|jd	jtt|��d
�|jd|||||f�|j�ntj|
g}
|dkrn|
jdd
�n|dkr�|
jdd�nt|
d|�ttj|
fd|
d|�n[ddlm}xH|D]@}|dd�dkr�q�n|dkrtj|d|�}ntj|�}|}|r�|dt|��|krntd||f��n|t|�d�}n|r�tjj||�}ntjj|�}|r�|s�t ||�rt	j
d||�|s||||�qqt	j!d||�q�q�WdS(u�Byte-compile a collection of Python source files to either .pyc
    or .pyo files in a __pycache__ subdirectory.  '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.
    ubyte-compiling is disabled.i(umkstempu.py(umktempu$writing byte-compilation script '%s'uwu2from distutils.util import byte_compile
files = [
u,
u]
u�
byte_compile(files, optimize=%r, force=%r,
             prefix=%r, base_dir=%r,
             verbose=%r, dry_run=0,
             direct=1)
iu-Oiu-OOudry_runuremoving %s(ucompileiNudebug_overrideu1invalid prefix: filename %r doesn't start with %rubyte-compiling %s to %su%skipping byte-compilation of %s to %si����("usysudont_write_bytecodeuDistutilsByteCompileErroruNoneu	__debug__utempfileumkstempuImportErrorumktempuloguinfouosufdopenuopenuwriteujoinumapureprucloseu
executableuinsertuspawnuexecuteuremoveu
py_compileucompileuimpucache_from_sourceulenu
ValueErrorupathubasenameunewerudebug(upy_filesuoptimizeuforceuprefixubase_diruverboseudry_runudirectumkstempu	script_fduscript_nameumktempuscriptucmducompileufileucfileudfileu
cfile_base((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyubyte_compileFsj"	
#


	ubyte_compilecCs"|jd�}d}|j|�S(u�Return a version of the string escaped for inclusion in an
    RFC-822 header, by ensuring there are 8 spaces space after each newline.
    u
iu u        u	
        (usplitujoin(uheaderulinesusep((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyu
rfc822_escape�su
rfc822_escapecCsz|s
dSddlm}m}Gdd�d|�}|dkrQ|d�}n||d|�}|j|dd	�dS(
uInvoke 2to3 on a list of Python files.
    The files should all come from the build area, as the
    modification is done in-place. To reduce the build time,
    only files modified since the last invocation of this
    function should be passed in the files argument.Ni(uRefactoringTooluget_fixers_from_packagecBs8|EeZdZdd�Zdd�Zdd�ZdS(u*run_2to3.<locals>.DistutilsRefactoringToolc_stj||�dS(N(uloguerror(uselfumsguargsukw((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyu	log_error�su4run_2to3.<locals>.DistutilsRefactoringTool.log_errorcWstj||�dS(N(uloguinfo(uselfumsguargs((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyulog_message�su6run_2to3.<locals>.DistutilsRefactoringTool.log_messagecWstj||�dS(N(ulogudebug(uselfumsguargs((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyu	log_debug�su4run_2to3.<locals>.DistutilsRefactoringTool.log_debugN(u__name__u
__module__u__qualname__u	log_errorulog_messageu	log_debug(u
__locals__((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyuDistutilsRefactoringTool�suDistutilsRefactoringToolu
lib2to3.fixesuoptionsuwriteT(ulib2to3.refactoruRefactoringTooluget_fixers_from_packageuNoneurefactoruTrue(ufilesufixer_namesuoptionsuexplicituRefactoringTooluget_fixers_from_packageuDistutilsRefactoringToolur((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyurun_2to3�s
urun_2to3cCs|ddlm}ddlm}ddlm}|�}	tj�}
tj|�z|	j	�Wdtj|
�X|	j
|	jdd�<|r�x<|j�D]+}|j
�}|s�q�n|	j|�q�Wng}xz|	jD]o}
tjj||
�}|tjj|��|tjj||
�|dd�}|dr�|j|�q�q�Wtdd	�|D�d
|d|d|�|S(
u�Recursively copy a directory, only copying new and changed files,
    running run_2to3 over all newly copied Python modules afterward.

    If you give a template string, it's parsed like a MANIFEST.in.
    i(umkpath(u	copy_file(uFileListNuupdateicSs+g|]!}|j�jd�r|�qS(u.py(uloweruendswith(u.0ufn((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyu
<listcomp>s	u$copydir_run_2to3.<locals>.<listcomp>ufixer_namesuoptionsuexplicit(udistutils.dir_utilumkpathudistutils.file_utilu	copy_fileudistutils.filelistuFileListuosugetcwduchdirufindalluallfilesufilesu
splitlinesustripuprocess_template_lineupathujoinudirnameuappendurun_2to3(usrcudestutemplateufixer_namesuoptionsuexplicitumkpathu	copy_fileuFileListufilelistucurdirulineucopiedufilenameuoutnameures((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyucopydir_run_2to3�s4	
$
ucopydir_run_2to3cBs8|EeZdZdZdZdZdZdd�ZdS(u	Mixin2to3u�Mixin class for commands that run 2to3.
    To configure 2to3, setup scripts may either change
    the class variables, or inherit from individual commands
    to override how 2to3 is invoked.cCst||j|j|j�S(N(urun_2to3ufixer_namesuoptionsuexplicit(uselfufiles((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyurun_2to3-suMixin2to3.run_2to3N(	u__name__u
__module__u__qualname__u__doc__uNoneufixer_namesuoptionsuexpliciturun_2to3(u
__locals__((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyu	Mixin2to3s
u	Mixin2to3(#u__doc__uosureuimpusysustringudistutils.errorsuDistutilsPlatformErrorudistutils.dep_utilunewerudistutils.spawnuspawnu	distutilsuloguDistutilsByteCompileErroruget_platformuconvert_pathuchange_rootu_environ_checkedu
check_environu
subst_varsugrok_environment_erroruNoneu
_wordchars_reu
_squote_reu
_dquote_reu_init_regexusplit_quoteduexecuteu	strtoboolubyte_compileu
rfc822_escapeurun_2to3ucopydir_run_2to3u	Mixin2to3(((u3/opt/alt/python33/lib64/python3.3/distutils/util.pyu<module>s>]=�