Files
PowerToys/PythonEnv/2.7/Lib/site.pyc

221 lines
25 KiB
Plaintext
Raw Normal View History

2013-12-21 01:22:42 +08:00
<03>
<EFBFBD>n<EFBFBD>Rc@s0dZddlZddlZyddlZWnek
rMddlZnXyeWn!ek
ryddlm ZnXej
ej gZ dadadaeedd<00>p<>eed<00>d(kZeed<00>Zejd d
kZer<>ee<00>Znd <00>Zd <00>Zd <00>Zd<00>Zd<00>Zd<00>Zdd<00>Zej
ej d<00>Z d<00>Z!d<00>Z"d<00>Z#d<00>Z$de%fd<00><00>YZ&d<00>Z'de%fd<00><00>YZ(d<00>Z)d<00>Z*d<00>Z+d<00>Z,d <00>Z-d!<00>Z.d"<00>Z/d#<00>Z0d$<00>Z1d%<00>Z2e2<00>d&<00>Z3e4d'kr,e3<00>ndS()s<>
Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
In earlier versions of Python (up to 1.5a3), scripts or modules that
needed to use site-specific modules would place ``import site''
somewhere near the top of their code. Because of the automatic
import, this is no longer necessary (but code that does it still
works).
This will append site-specific paths to the module search path. On
Unix, it starts with sys.prefix and sys.exec_prefix (if different) and
appends lib/python<version>/site-packages as well as lib/site-python.
It also supports the Debian convention of
lib/python<version>/dist-packages. On other platforms (mainly Mac and
Windows), it uses just sys.prefix (and sys.exec_prefix, if different,
but this is unlikely). The resulting directories, if they exist, are
appended to sys.path, and also inspected for path configuration files.
FOR DEBIAN, this sys.path is augmented with directories in /usr/local.
Local addons go into /usr/local/lib/python<version>/site-packages
(resp. /usr/local/lib/site-python), Debian addons install into
/usr/{lib,share}/python<version>/dist-packages.
A path configuration file is a file whose name has the form
<package>.pth; its contents are additional directories (one per line)
to be added to sys.path. Non-existing directories (or
non-directories) are never added to sys.path; no directory is added to
sys.path more than once. Blank lines and lines beginning with
'#' are skipped. Lines starting with 'import' are executed.
For example, suppose sys.prefix and sys.exec_prefix are set to
/usr/local and there is a directory /usr/local/lib/python2.X/site-packages
with three subdirectories, foo, bar and spam, and two path
configuration files, foo.pth and bar.pth. Assume foo.pth contains the
following:
# foo package configuration
foo
bar
bletch
and bar.pth contains:
# bar package configuration
bar
Then the following directories are added to sys.path, in this order:
/usr/local/lib/python2.X/site-packages/bar
/usr/local/lib/python2.X/site-packages/foo
Note that bletch is omitted because it doesn't exist; bar precedes foo
because bar.pth comes alphabetically before foo.pth; and spam is
omitted because it is not mentioned in either path configuration file.
After these path manipulations, an attempt is made to import a module
named sitecustomize, which can perform arbitrary additional
site-specific customizations. If this import fails with an
ImportError exception, it is silently ignored.
i<EFBFBD><EFBFBD><EFBFBD><EFBFBD>N(tSettmaxsizetmaxintii tpypy_version_infoitjavacGsetjj|<00>}tr=|dks3|jd<00>r=||fStjj|<00>}|tjj|<00>fS(Nt __classpath__t__pyclasspath__(tostpathtjoint
_is_jythont
startswithtabspathtnormcase(tpathstdir((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pytmakepath\s 
cCs<>x{tjj<00>D]j}tr,t|t<00> st|d<00>rAqnt|dd<00>}|dkreqnt j
j |<00>|_ qWdS(s6Set all module' __file__ attribute to an absolute patht
__loader__t__file__N( tsystmodulestvaluesR
t
isinstancet
ModuleTypethasattrtgetattrtNoneRRR R(tmtf((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt abs__file__ds cCslg}t<00>}xLtjD]A}t|<00>\}}||kr|j|<00>|j|<00>qqW|tj(|S(sK Remove duplicate entries from sys.path along with making them
absolute(tsetRRRtappendtadd(tLt known_pathsRtdircase((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pytremoveduppathsqs   
cCs~ddlm}d|<00>tjf}ttd<00>rB|d7}ntjjtjjtjd<19>|<00>}tjj |<00>dS(sbAppend ./build/lib.<platform> in case we're running in the build dir
(especially for Guido :-)i<><69><EFBFBD><EFBFBD>(t get_platformsbuild/lib.%s-%.3stgettotalrefcounts-pydebugN(
tdistutils.utilR%RtversionRRRR tdirnameR(R%ts((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt addbuilddir<69>s  (cCspt<00>}x`tjD]U}y8tjj|<00>rPt|<00>\}}|j|<00>nWqtk
rgqqXqW|S(sDReturn a set containing all existing directory entries from sys.path(RRRRtisdirRR t TypeError(tdRR#((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt_init_pathinfo<66>s   c Bs&|dkre<00>d}nd}ejj||<00>}ye|d<00>}Wnek
r^dSXz<58>x<>|D]<5D>}|jd<00>r<>qin|jd<00>r<>|dUqin|j<00>}e ||<00>\}}||kriejj
|<00>rie jj |<00>|j |<00>qiqiWWd|j<00>X|r"d}n|S(soAdd a new path to known_paths by combining sitedir and 'name' or execute
sitedir if it starts with 'import'iitrUNt#timport(RR/RRR topentIOErrorR trstripRtexistsRRR tclose( tsitedirtnameR"tresettfullnameRtlineRR#((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt
addpackage<67>s2       cCs<>|dkrt<00>}d}nd}t|<00>\}}||krUtjj|<00>nytj|<00>}Wntjk
rdSX|j <00>x7|D]/}|j
tj d<17>r<>t |||<00>q<>q<>W|r<>d}n|S(sTAdd 'sitedir' argument to sys.path if missing and handle .pth files in
'sitedir'iiNtpth( RR/RRRRRtlistdirterrortsorttendswithtextsepR=(R8R"R:t sitedircasetnamesR9((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt
addsitedir<69>s$    
  c
Cs
tjj|d<00>|g}||krF|jtjj|d<00><00>nx<>|D]<5D>}|rMtjdksntr<>tjj|dd<00>g}n<>tr<>tjj|d<00>g}n<>tjdkr@||kr@|jd<00>rtjjdtj d d<00>tjj|d
d d <00>g}qdtjj|d d tj d d<00>g}n$tj
d krFtjj|d d tj d d<00>tjj|d d<00>tjj|d tj d d<00>g}tjj|dd tj d d<00>}tjj |<00>rEtjj |<00>g|D]}tjj |<00>^q<>krEt r5|jd|<00>qE|j|<00>ny.tj|jdtjj|dd<00><00>Wntk
r<>nXtj ddkr<>|jtjj|d d tj d d<00><00>n-|jtjj|d d tj dd<00><00>|jtjj|dd tj d d<00><00>|jtjj|d d<00><00>n|tjj|d d<00>g}tjdkr<>d|kr<>tjjd<00>}|r<>|jtjj|ddtj d d<00><00>q<>q<>nx3|D](} tjj| <00>r<>t| |<00>q<>q<>WqMqMWdS(s8Add site-packages (and possibly site-python) to sys.pathtlocaltos2emxtriscostLibs site-packagestdarwins/System/Library/Frameworks/s/Library/PythonitExtrastlibtpythont/s site-pythons lib-dynloadtlib64itdebugt2s dist-packagess local/libs dist-pythonsPython.frameworktHOMEtLibrarytPython(RHRIN(RRR RRtplatformR
t_is_pypyR R(tsepR6trealpatht _is_64bittinsertt
getobjectstAttributeErrortenvirontgetR,RFR(
R"t
sys_prefixt exec_prefixtprefixestprefixtsitedirst lib64_dirtpthomeR8((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pytaddsitepackages<65>sv  ! &&7'  

"  
 cCs<>ttd<00>r(ttjdt<00>r(tSttd<00>rettd<00>retj<00>tj<00>kredSnttd<00>r<>ttd<00>r<>tj <00>tj
<00>kr<>dSnt S(s,Check if user site directory is safe for inclusion
The function tests for the command line flag (including environment var),
process uid/gid equal to effective uid/gid.
None: Disabled for security reasons
False: Disabled by user (command line option)
True: Safe and enabled
tflagst no_user_sitetgetuidtgeteuidtgetgidtgetegidN( RRRRitFalseRRlRkRRnRmtTrue(((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pytcheck_enableusersites
$c Csftjjdd<00>}d<00>}tjdkr<>tjjd<00>pBd}|rT|an||d<00>atjjtdtj dtj dd <00>a
nD|r<>|an|dd
<00>atjjtd d tj d d <00>a
t rtjj t
<00>rt t
|<00>nt rbxYdD]N}tjjt|d tj d d<00>}tjj |<00>r t ||<00>q q Wn|S(s'Add a per user site-package to sys.path
Each user has its own python directory with site-packages in the
home directory.
USER_BASE is the root directory for all Python versions
USER_SITE is the user specific site-packages directory
USER_SITE/.. can be used for data.
tPYTHONUSERBASEcWstjjtjj|<00><00>S(N(RRt
expanduserR (targs((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pytjoinuserDstnttAPPDATAt~RUiis site-packagess.localRMRNis local/libs dist-packagesN(slibs local/lib(RR^R_RR9t USER_BASERR RR(t USER_SITEtENABLE_USER_SITER,RF(R"tenv_baseRutbaset dist_libdirt user_site((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pytaddusersitepackages5s4         cCsotjjtjdd<00>}tjdjd<00>}|drK|j|<00>n
||d<dj|<00>tjd<dS(sEThe OS/2 EMX port has optional extension modules that do double duty
as DLLs (and must use the .DLL file extension) for other extensions.
The library search path needs to be amended so these will be found
during module import. Use BEGINLIBPATH so that these are at the start
of the library search path.
RJs lib-dynloadt BEGINLIBPATHt;i<><69><EFBFBD><EFBFBD>N(RRR RRcR^tsplitR(tdllpathtlibpath((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pytsetBEGINLIBPATHjs 

csttjdkrd<00>ntjdkr0d<00>nd<00>dtf<00>fd<00><00>Y}|d<00>t_|d <00>t_d
S( snDefine new built-ins 'quit' and 'exit'.
These are simply strings that display a hint on how to exit.
t:sCmd-Qs\sCtrl-Z plus ReturnsCtrl-D (i.e. EOF)tQuittercs,eZd<00>Z<00>fd<00>Zdd<00>ZRS(cSs ||_dS(N(R9(tselfR9((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt__init__<5F>scsd|j<00>fS(NsUse %s() or %s to exit(R9(R<>(teof(sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt__repr__<5F>scSs+ytjj<00>WnnXt|<00><00>dS(N(RtstdinR7t
SystemExit(R<>tcode((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt__call__<5F>s
N(t__name__t
__module__R<5F>R<>RR<>((R<>(sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyR<79><00>s tquittexitN(RRXtobjecttbuiltinsR<73>R<>(R<>((R<>sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pytsetquit{s   t_PrintercBs>eZdZdZddd<00>Zd<00>Zd<00>Zd<00>ZRS(sninteractive prompt objects for printing the license text, a list of
contributors and the copyright notice.icCs1||_||_||_||_d|_dS(N(t_Printer__namet_Printer__datat_Printer__filest_Printer__dirsRt_Printer__lines(R<>R9tdatatfilestdirs((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyR<79><00>s
    cCs<>|jr dSd}x<>|jD]w}xd|jD]Y}tjj||<00>}y*t|d<00>}|j<00>}|j <00>PWq-t
k
r<>q-Xq-W|rPqqW|s<>|j }n|j d<00>|_t |j<00>|_dS(NR0s
(R<>RR<>R<>RRR R3treadR7R4R<>R<>tlent_Printer__linecnt(R<>R<>Rtfilenametfp((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt__setup<75>s&  
  cCsH|j<00>t|j<00>|jkr2dj|j<00>Sd|jfdSdS(Ns
s!Type %s() to see the full %s texti(t_Printer__setupR<70>R<>tMAXLINESR R<>(R<>((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyR<79><00>s
cCs<>|j<00>d}d}x<>y1x*t|||j<17>D]}|j|GHq3WWntk
r^PqX||j7}d}xU|dkr<>yt|<00>}Wntk
r<>t|<00>}nX|dkrud}ququW|dkrPqqdS(Ns0Hit Return for more, or q (and Return) to quit: ittq(R<>R<>( R<>trangeR<65>R<>t
IndexErrorRt raw_inputt NameErrortinput(R<>tprompttlinenotitkey((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyR<79><00>s(
      (((R<>R<>t__doc__R<5F>R<>R<>R<>R<>(((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyR<79><00>s   cCs<>tdtj<00>t_tr0tdd<00>t_n-trKtdd<00>t_ntdd<00>t_tjj tj
<00>}tddtj dd gtjj |tj <00>|tjg<00>t_d
S( s,Set 'copyright' and 'credits' in __builtin__t copyrighttcreditss?Jython is maintained by the Jython developers (www.jython.org).sDPyPy is maintained by the PyPy developers: http://codespeak.net/pypys<79> Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
for supporting Python development. See www.python.org for more information.tlicenses+See http://www.python.org/%.3s/license.htmls LICENSE.txttLICENSEN(R<>RR<>R<>R
R<>RWRRR)RR(R tpardirtcurdirR<72>(there((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt setcopyright<68>s    t_HelpercBs eZdZd<00>Zd<00>ZRS(sYDefine the built-in 'help'.
This is a wrapper around pydoc.help (with a twist).
cCsdS(NsHType help() for interactive help, or help(object) for help about object.((R<>((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyR<79><00>scOsddl}|j||<00>S(Ni<4E><69><EFBFBD><EFBFBD>(tpydocthelp(R<>RttkwdsR<73>((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyR<79><00>s (R<>R<>R<>R<>R<>(((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyR<79><00>s cCst<00>t_dS(N(R<>R<>R<>(((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt sethelper<65>scCs<>tjdkr<>ddl}ddl}|j<00>d}|jd<00>r<>y|j|<00>Wq<57>tk
r<>ddl}|j |j
|<d|j j |<q<>Xq<58>ndS(s<>On Windows, some default encodings are not provided by Python,
while they are always available as "mbcs" in each locale. Make
them usable by aliasing to "mbcs" in such a case.twin32i<32><69><EFBFBD><EFBFBD>Nitcptmbcs( RRVtlocaletcodecstgetdefaultlocaleR tlookupt LookupErrort encodingst_unknownt_cachetaliases(R<>R<>tencR<63>((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt aliasmbcs<63>s  cCs&d}|dkr"tj|<00>ndS(s<>Set the string encoding used by the Unicode implementation. The
default is 'ascii', but if you're willing to experiment, you can
change this.tasciiN(Rtsetdefaultencoding(tencoding((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt setencoding s cCs(yddl}Wntk
r#nXdS(s,Run custom site specific code, if available.i<><69><EFBFBD><EFBFBD>N(t sitecustomizet ImportError(R<>((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pytexecsitecustomize!s c Cs<>ttjjtjjt<00>d<00><00>}|j<00>j<00>t_ |j
<00>d}g}tjddkrr|d7}nt r<>tjjtj d<00>g}n}t r<>tj dkr<>dtj d}n4tjdkr<>d
tj d }nd tj d }tjjtj d <00>tjjtj d |<00>g}tjdkra|jdtjjtj d d|<16><00>n|}x<>|D]D}tjj|dtj<16>}tjj|<00>rp|j|<00>qpqpWnXtjdkr<>tjjtj d<00>tjjtj d<00>g}ntjjtj ddtjd <17>g}|}tjjtj ddtjd <17>}tjj|<00>r<>tr~|jd|<00>q<>|j|<00>nyttdt<00>j}Wntk
r<>tj}nXtjjtj ddtjd d|<16>}tjj|<00>r|j|<00>nxKt|<00>D]=}tjj|d<00>} tjj| <00>r |j| <00>q q Wtjdkr<>g|D](}
dD]} tjj|
| <00>^q<>qw} x3| D](}tjj|<00>r<>|j|<00>q<>q<>Wntjj|<00>dS( Nsorig-prefix.txtiiR<>iRJis%dis%d.%ds%d.%d.%dtlib_pypys
lib-pythoni s modified-%ssplat-%sR<73>tDLLsRMRNRPtimplementationslib-tkRKs plat-darwinsplat-macsplat-mac/lib-scriptpackages(ii(ii(ii (s plat-darwinsplat-macsplat-mac/lib-scriptpackages(R3RRR R)RR<>tstripRt real_prefixR7R
RWt version_infoRR[RVR6RR(RZRt
_multiarchR]tlisttextend( Rtposthardcoded_relative_dirsRtcpyverRt plat_patht
lib64_pathtarchttk_dirt relative_dirtmodulethardcoded_paths((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pytvirtual_install_main_packages(sn'
 3)&   
( cCsjttdd<00>}xDttj<00>D]3\}}||kr"|jtj<00>r"|}q"q"W|dt_dS(s
Force easy_installed eggs in the global environment to get placed
in sys.path after all packages inside the virtualenv. This
maintains the "least surprise" result that packages in the
virtualenv always mask global packages, never the other way
around.
t __egginsertiiN(RRt enumerateRR RcR<>(t egginsertR<74>R((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt+force_global_eggs_after_local_site_packagesss
 cCst<00>t|dtj<00>S(NR`(R<>RhRR<>(R"((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pytvirtual_addsitepackages<65>scCsug}g}xItjD]>}|dks7|jd<00>rG|j|<00>q|j|<00>qW|t_tjj|<00>dS(s<>Adjust the special classpath sys.path entries for Jython. These
entries should follow the base virtualenv lib directories.
RRN(RRR RR<>(Rt
classpathsR((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt fixclasspath<74>s cCs(yddl}Wntk
r#nXdS(s,Run custom user specific code, if available.i<><69><EFBFBD><EFBFBD>N(t usercustomizeR<65>(R<>((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pytexecusercustomize<7A>s cCsYt<00>t<00>t<00>}tjdkrXtjrXtjjtjd<19>dkrXt<00>nt rht
<00>ntjj tjj tjj t<00>d<00><00> }|s<>tantdkr<>t<00>ant|<00>}t|<00>}|r<>t|<00>}ntjdkrt<00>nt<00>t<00>t<00>t<00>t<00>t<00>tr=t<00>nttd<00>rUt` ndS(Ntposixi<78><69><EFBFBD><EFBFBD>tModulessno-global-site-packages.txtRHR<>(!R<>RR$RR9RRtbasenameR+R
R<>R6R R)RRoR{RRqRhR<>R<>RVR<>R<>R<>R<>R<>R<>R<>R<>RR<>(t paths_in_systGLOBAL_SITE_PACKAGES((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pytmain<69>s: 

.     

cCs<>d}tjd}|s<>dGHxtjD]}d|fGHq(WdGHd<00>}dt|t<00>fGHdt|t<00>fGHd tGHtjd
<00>ng}d |kr<>|jt<00>nd |kr<>|jt<00>n|rBtj j
|<00>GHtr<>tjd
<00>q}tt krtjd<00>q}tdkr2tjd <00>q}tjd<00>n;ddl }|j|tjd
tj f<16>GHtjd<00>dS(Ns<4E> %s [--user-base] [--user-site]
Without arguments print some useful information
With arguments print the value of USER_BASE and/or USER_SITE separated
by '%s'.
Exit codes with --user-base or --user-site:
0 - user site directory is enabled
1 - user site directory is disabled by user
2 - uses site directory is disabled by super user
or for security reasons
>2 - unknown error
is sys.path = [s %r,t]cSstjj|<00>rdSdSdS(NR6s doesn't exist(RRR,(R((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyR6<00>ssUSER_BASE: %r (%s)sUSER_SITE: %r (%s)sENABLE_USER_SITE: %ris --user-bases --user-siteiii<><69><EFBFBD><EFBFBD>i
(RtargvRRyRzR{R<>RRtpathsepR RoRttextwraptdedent(R<>RtRR6tbufferR<72>((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt_script<70>s:        "t__main__l(5R<>RRt __builtin__R<5F>R<>RR<>tsetsRRcRatPREFIXESRR{RzRyRRZRRWRVR
ttypeRRRR$R+R/R=RFRhRqR<>R<>R<>R<>R<>R<>R<>R<>R<>R<>R<>R<>R<>R<>R<>R<>R<>RR<>(((sAd:\github\WinAlfred\WinAlfred\bin\Debug\PythonEnv\2.7\lib\site.pyt<module>@s`    '  
 L  5  @      K     # 4