config root man

Current Path : /usr/local/lib/python2.5/distutils/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/local/lib/python2.5/distutils/util.pyc

hRc@s!dZdZddkZddkZddkZddkZddklZddkl	Z	ddk
lZddkl
Z
dZd	Zd
ZdadZd
ZddZdaaadZdZddddZdZddddddddZdZdS(sudistutils.util

Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
s9$Id: util.py 59116 2007-11-22 10:14:26Z ronald.oussoren $iN(tDistutilsPlatformError(tnewer(tspawn(tlogcCstidjpttdotiSnti\}}}}}ti|}ti|dd}ti|dd}ti|dd}|d d	jod
||fSnH|d djoA|dd
jo,d}dt	|dd|df}qn|d djod
||fSn|d djod|||fSn|d djo?d}t
id}|i|}|o|i
}qn]|d djoKddkl}|}tiid}	|	p|id}	n|	pytd}
Wntj
oqXt
idd|
i}|
i|d*j	o)d i|i
d!id d }	qn|	onddkl}|	}d"}|d d#jo&|id$dio
d%}q|d+jo
d(}qqnd)|||fS(,sReturn 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

    For non-POSIX platforms, currently just returns 'sys.platform'.
    tposixtunamet/tt t_t-itlinuxs%s-%stsunosit5tsolariss%d.%siiitirixtaixs%s-%s.%sitcygwins[\d.]+tdarwini(tget_config_varstMACOSX_DEPLOYMENT_TARGETs0/System/Library/CoreServices/SystemVersion.plists'<key>ProductUserVisibleVersion</key>\s*s<string>(.*?)</string>t.itmacosxs10.4.tUNIVERSALSDKtfattPowerPCtPower_Macintoshtppcs%s-%s-%sN(sPowerPCsPower_Macintosh(tostnamethasattrtsystplatformRtstringtlowertreplacetinttretcompiletmatchtgrouptdistutils.sysconfigRtenvirontgettopentIOErrortsearchtreadtclosetNonetjointsplittstrip(tosnamethosttreleasetversiontmachinetrel_retmRtcfgvarstmacvertf((s*/usr/local/lib/python2.5/distutils/util.pytget_platformsd!*	

-

cCstidjo|Sn|p|Sn|ddjotd|n|ddjotd|nti|d}xd|jo|idqW|ptiSnttii	|S(sReturn '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.
    Rispath '%s' cannot be absoluteispath '%s' cannot end with '/'R(
Rtsept
ValueErrorR!R3tremovetcurdirtapplytpathR2(tpathnametpaths((s*/usr/local/lib/python2.5/distutils/util.pytconvert_path|s	
cCstidjoEtii|ptii||Sqtii||dSnDtidjoNtii|\}}|ddjo|d}ntii||SntidjoQtii|\}}|dtijo|d}ntii||Sntidjodtii|ptii||Sqti|dd}d|d}tii||Snt	d	tid
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.
    Ritntis\tos2tmact:s!nothing known about platform '%s'N(
RRREtisabsR2t
splitdriveR@R!R3R(tnew_rootRFtdriveREtelements((s*/usr/local/lib/python2.5/distutils/util.pytchange_roots,icCstodSntidjoDtiido0ddk}|itidtid<ntiidpttid<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()')
    NRtHOMEiitPLATi(	t_environ_checkedRRR*thas_keytpwdtgetpwuidtgetuidR?(RW((s*/usr/local/lib/python2.5/distutils/util.pyt
check_environs	$$cCsSt|d}ytid||SWn"tj
o}td|nXdS(sPerform 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}|i|ot||Snti|SdS(Ni(R(RVtstrRR*(R't
local_varstvar_name((s*/usr/local/lib/python2.5/distutils/util.pyt_substss\$([a-zA-Z_][a-zA-Z_0-9]*)sinvalid variable '$%s'N(RZR%tsubtKeyErrorRA(tsR\R^tvar((s*/usr/local/lib/python2.5/distutils/util.pyt
subst_varss	serror: cCsut|doMt|do=|io|d|i|if}qq|d|i}n|t|d}|S(sGenerate 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(RRdReR[(texctprefixterror((s*/usr/local/lib/python2.5/distutils/util.pytgrok_environment_errors	 
cCs8tidtiatidatidadS(Ns
[^\\\'\"%s ]*s'(?:[^'\\]|\\.)*'s"(?:[^"\\]|\\.)*"(R%R&R!t
whitespacet
_wordchars_ret
_squote_ret
_dquote_re(((s*/usr/local/lib/python2.5/distutils/util.pyt_init_regexscCstd	jotnti|}g}d}x|oti||}|i}|t|jo|i|| Pn||ti	jo.|i|| ti
||}d}n||djo$|| ||d}|d}n||djoti||}n9||djoti||}nt
d|||d	jotd||n|i\}}|| ||d|d!||}|id}|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(RkR1RnR!R4R'tendtlentappendRjtlstripRlRmtRuntimeErrorRAtspan(RatwordstposR;Rqtbeg((s*/usr/local/lib/python2.5/distutils/util.pytsplit_quotedsF


%

cCss|djo=d|i|f}|ddjo|dd!d}qJnti||pt||ndS(sPerform 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%ris,)it)N(R1t__name__RtinfoRD(tfunctargstmsgtverbosetdry_run((s*/usr/local/lib/python2.5/distutils/util.pytexecuteKs	

cCsMti|}|djodSn&|djodSntd|fdS(sConvert 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.
    tytyesttttruetont1itntnoR>tfalsetofft0isinvalid truth value %rN(RsyesRstruesonR(RsnoR>sfalsesoffR(R!R"RA(tval((s*/usr/local/lib/python2.5/distutils/util.pyt	strtobool^s

icCs|djoto
|dj}n|py&ddkl}|d\}	}
Wn6tj
o*ddkl}d|d}	}
nXtid|
|p|	dj	oti	|	d}nt
|
d}|id|iti
tt|d	d
|id|||||f|inti|
g}
|djo|
idd
n"|djo|
iddnt|
d|tti|
fd|
d|n:ddkl}x&|D]}|ddjoqn|todpd}|}|oB|t| |jotd||fn|t|}n|otii
||}ntii|}|o`|pt||o2tid|||p||||qqtid||qqWdS(sByte-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.
    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-OORsremoving %s(R&itctos1invalid prefix: filename %r doesn't start with %rsbyte-compiling %s to %ss%skipping byte-compilation of %s to %sN(R1t	__debug__ttempfileRtImportErrorRRR}RtfdopenR,twriteR!R2tmaptreprR0Rt
executabletinsertRRRBt
py_compileR&RrRAREtbasenameRtdebug(tpy_filestoptimizetforceRgtbase_dirRRtdirectRt	script_fdtscript_nameRtscripttcmdR&tfiletcfiletdfilet
cfile_base((s*/usr/local/lib/python2.5/distutils/util.pytbyte_compilensf,

&

	cCs>ti|d}tti|}ti|dd}|S(sReturn a version of the string escaped for inclusion in an
    RFC-822 header, by ensuring there are 8 spaces space after each newline.
    s
iRs        (R!R3RR4R2(theadertlines((s*/usr/local/lib/python2.5/distutils/util.pyt
rfc822_escapes(t__doc__t__revision__RRR!R%tdistutils.errorsRtdistutils.dep_utilRtdistutils.spawnRt	distutilsRR?RHRRRURZRcRiR1RkRlRmRnRzRRRR(((s*/usr/local/lib/python2.5/distutils/util.pys<module>s.0	m		&				?	

Man Man