tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
M\¬Qc@spdZddlZddlZddlZddlZejejgZda    da
da d„Z d„Z d„Zd„Zd„Zdd„Zd    „Zd
„Zd „Zd „Zd „Zd„Zd„Zd„Zdefd„ƒYZd„Zdefd„ƒYZd„Zd„Zd„Z d„Z!d„Z"d„Z#e#ƒd„Z$e%dkrle$ƒndS(sN    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 (including Mac OSX), it starts with sys.prefix and
sys.exec_prefix (if different) and appends
lib/python<version>/site-packages as well as lib/site-python.
On other platforms (such as Windows), it tries each of the
prefixes directly, as well as with lib/site-packages appended.  The
resulting directories, if they exist, are appended to sys.path, and
also inspected for path configuration files.
 
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.5/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.5/site-packages/bar
  /usr/local/lib/python2.5/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ÿÿÿÿNcGsRtjj|Œ}ytjj|ƒ}Wntk
r;nX|tjj|ƒfS(N(tostpathtjointabspathtOSErrortnormcase(tpathstdir((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pytmakepathOs  cCsixbtjjƒD]Q}t|dƒr+qnytjj|jƒ|_Wqtt    fk
r`qXqWdS(s6Set all module' __file__ attribute to an absolute patht
__loader__N(
tsystmodulestvaluesthasattrRRRt__file__tAttributeErrorR(tm((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyt abs__file__XscCslg}tƒ}xLtjD]A}t|ƒ\}}||kr|j|ƒ|j|ƒqqW|tj(|S(sK Remove duplicate entries from sys.path along with making them
    absolute(tsetR
RRtappendtadd(tLt known_pathsRtdircase((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pytremoveduppathscs      
cCsptƒ}x`tjD]U}y8tjj|ƒrPt|ƒ\}}|j|ƒnWqtk
rgqqXqW|S(sDReturn a set containing all existing directory entries from sys.path(RR
RRtisdirRRt    TypeError(tdRR((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyt_init_pathinfovs      c Bsº|dkreƒd}nd}ejj||ƒ}ye|dƒ}Wnek
r^dSX|@x8e|ƒD]*\}}|jdƒr”qsny€|jd ƒr´|dUwsn|j    ƒ}e
||ƒ\}}    |    |krejj |ƒre jj |ƒ|j|    ƒnWqsek
rœ}
e jdj|d|ƒIJxEeje jƒŒD].} x%| jƒD]}e jd    |IJqlWqYWe jd
IJPqsXqsWWdQX|r¶d}n|S( sÖProcess a .pth file within the site-packages directory:
       For each line in the file, either combine it with sitedir to a path
       and add that to known_paths, or execute it if it starts with 'import '.
    iitrUNt#simport simport    s"Error processing line {:d} of {}:
s  s
Remainder of file ignored(simport simport    (tNoneRRRRtopentIOErrort    enumeratet
startswithtrstripRtexistsR
RRt    Exceptiontstderrtformatt    tracebacktformat_exceptiontexc_infot
splitlines( tsitedirtnameRtresettfullnametftntlineRRterrtrecord((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyt
addpackageƒsB             cCsï|dkrtƒ}d}nd}t|ƒ\}}||krUtjj|ƒnytj|ƒ}Wntjk
rdSXtj    d}g|D]}|j
|ƒr”|^q”}x$t |ƒD]}t |||ƒqÂW|rëd}n|S(sTAdd 'sitedir' argument to sys.path if missing and handle .pth files in
    'sitedir'iiNtpth( RRRR
RRRtlistdirterrortextseptendswithtsortedR6(R-RR/t sitedircasetnamestdotpthR.((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyt
addsitedir¬s$           (    cCsŽtjjrtSttdƒrMttdƒrMtjƒtjƒkrMdSnttdƒrŠttdƒrŠtj    ƒtj
ƒ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
    tgetuidtgeteuidtgetgidtgetegidN( R
tflagst no_user_sitetFalseR RRBRARRDRCtTrue(((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pytcheck_enableusersiteÄs
cCs0tdk    rtSddlm}|dƒatS(sËReturns the `user base` directory path.
 
    The `user base` directory can be used to store data. If the global
    variable ``USER_BASE`` is not initialized yet, this function will also set
    it.
    iÿÿÿÿ(tget_config_vartuserbaseN(t    USER_BASERt    sysconfigRJ(RJ((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyt getuserbaseÜs
  cCstƒ}tdk    rtSddlm}ddl}tjdkrvddlm}|dƒrv|ddƒatSn|dd    |j    ƒatS(
s¢Returns the user-specific site-packages directory path.
 
    If the global variable ``USER_SITE`` is not initialized yet, this
    function will also set it.
    iÿÿÿÿ(tget_pathNtdarwin(RJtPYTHONFRAMEWORKtpurelibtosx_framework_users%s_user(
RNt    USER_SITERRMRORR
tplatformRJR.(t    user_baseRORRJ((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pytgetusersitepackagesês       cCs5tƒ}tr1tjj|ƒr1t||ƒn|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.
    (RWtENABLE_USER_SITERRRR@(Rt    user_site((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pytaddusersitepackagess    c    Cseg}tƒ}xOtD]G}| s||kr5qn|j|ƒtjdkrs|jtjj|ddƒƒnŠtj    dkrÑ|jtjj|ddtj
d dƒƒ|jtjj|dd    ƒƒn,|j|ƒ|jtjj|ddƒƒtjd
krd d l m }|d ƒ}|r]|jtjjd|tj
d dƒƒq]qqW|S(s+Returns a list containing all global site-packages directories
    (and possibly site-python).
 
    For each directory present in the global ``PREFIXES``, this function
    will find its `site-packages` subdirectory depending on the system
    environment, and will return a list of full paths.
    tos2emxtriscostLibs site-packagest/tlibtpythonis site-pythonRPiÿÿÿÿ(RJRQs/Library(sos2emxsriscos( RtPREFIXESRR
RURRRRtseptversionRMRJ(t sitepackagestseentprefixRJt    framework((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pytgetsitepackagess.      "
"  cCs:x3tƒD](}tjj|ƒr
t||ƒq
q
W|S(s8Add site-packages (and possibly site-python) to sys.path(RhRRRR@(RR-((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pytaddsitepackages5scCsotjjtjddƒ}tjdjdƒ}|drK|j|ƒn
||d<dj|ƒ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.
 
    R]s lib-dynloadt BEGINLIBPATHt;iÿÿÿÿN(RRRR
RftenvirontsplitR(tdllpathtlibpath((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pytsetBEGINLIBPATH=s 
 
csttjdkrd‰ntjdkr0d‰nd‰dtf‡fd†ƒY}|dƒt_|d    ƒt_d
S( s­Define new builtins 'quit' and 'exit'.
 
    These are objects which make the interpreter exit when called.
    The repr of each object contains a hint at how it works.
 
    t:sCmd-Qs\sCtrl-Z plus ReturnsCtrl-D (i.e. EOF)tQuittercs,eZd„Z‡fd†Zdd„ZRS(cSs ||_dS(N(R.(tselfR.((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyt__init__]scsd|jˆfS(NsUse %s() or %s to exit(R.(Rs(teof(sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyt__repr___scSs+ytjjƒWnnXt|ƒ‚dS(N(R
tstdintcloset
SystemExit(Rstcode((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyt__call__as
N(t__name__t
__module__RtRvRR{((Ru(sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyRr\s    tquittexitN(RRbtobjectt __builtin__R~R(Rr((RusL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pytsetquitNs         t_PrintercBs>eZdZdZddd„Zd„Zd„Zd„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(RsR.tdatatfilestdirs((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyRtss
                cCsÒ|jr dSd}x‚|jD]w}xd|jD]Y}tjj||ƒ}y*t|dƒ}|jƒ}|j    ƒPWq-t
k
r…q-Xq-W|rPqqW|sª|j }n|j dƒ|_t |jƒ|_dS(NRs
(RˆRR‡R†RRRtfiletreadRxR!R…Rmtlent_Printer__linecnt(RsR‰Rtfilenametfp((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyt__setupzs&     
  cCsH|jƒt|jƒ|jkr2dj|jƒSd|jfdSdS(Ns
s!Type %s() to see the full %s texti(t_Printer__setupRŽRˆtMAXLINESRR„(Rs((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyRvs
cCs½|jƒd}d}x y1x*t|||jƒD]}|j|GHq3WWntk
r^PqX||j7}d}x1|dkr¥t|ƒ}|dkrud}ququW|dkrPqqdS(Ns0Hit Return for more, or q (and Return) to quit: ittq(R•R–(R“trangeR”Rˆt
IndexErrorRt    raw_input(Rstprompttlinenotitkey((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyR{–s"
      (((R|R}t__doc__R”RtR“RvR{(((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyRƒms         cCs«tdtjƒt_tjd dkr=tddƒt_ntddƒt_tjjtj    ƒ}tddtj
d    d
gtjj |tj ƒ|tj gƒt_d S( s,Set 'copyright' and 'credits' in __builtin__t    copyrightitjavatcreditss?Jython is maintained by the Jython developers (www.jython.org).sž    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ƒR
RŸRRUR¡RRtdirnameRRcRtpardirtcurdirR¢(there((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyt setcopyrightªs      t_HelpercBs eZdZd„Zd„ZRS(sXDefine the builtin 'help'.
    This is a wrapper around pydoc.help (with a twist).
 
    cCsdS(NsHType help() for interactive help, or help(object) for help about object.((Rs((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyRvÂscOsddl}|j||ŽS(Niÿÿÿÿ(tpydocthelp(RstargstkwdsRª((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyR{Ås (R|R}RžRvR{(((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyR©¼s    cCstƒt_dS(N(R©RR«(((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyt    sethelperÉscCs¡tjdkrddl}ddl}|jƒd}|jdƒry|j|ƒWqštk
r–ddl}|j    |j
|<d|j j |<qšXq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ÿÿÿÿNitcptmbcs( R
RUtlocaletcodecstgetdefaultlocaleR#tlookupt LookupErrort    encodingst_unknownt_cachetaliases(R²R³tencR·((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyt    aliasmbcsÌs  cCs&d}|dkr"tj|ƒ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(R
tsetdefaultencoding(tencoding((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyt setencodingÛs cCsgyddl}WnPtk
r#n@tk
rbtjjrRtjtjƒŒqctjdIJnXdS(s,Run custom site specific code, if available.iÿÿÿÿNs3'import sitecustomize' failed; use -v for traceback(    t sitecustomizet ImportErrorR&R
REtverboset
excepthookR+R'(RÁ((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pytexecsitecustomizeïs   cCsgyddl}WnPtk
r#n@tk
rbtjjrRtjtjƒŒqctjdIJnXdS(s,Run custom user specific code, if available.iÿÿÿÿNs3'import usercustomize' failed; use -v for traceback(    t usercustomizeRÂR&R
RERÃRÄR+R'(RÆ((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pytexecusercustomizeýs   cCs¯tƒtƒ}tdkr(tƒant|ƒ}t|ƒ}tjdkrYt    ƒnt
ƒt ƒt ƒt ƒtƒtƒtr“tƒnttdƒr«t`ndS(NR[R¾(RRRXRRIRZRiR
RURpR‚R¨R®R¼RÀRÅRÇR R¾(R((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pytmain s$        
 
cCsœd}tjd}|sªdGHxtjD]}d|fGHq(WdGHdttjjtƒradndfGHd    ttjjtƒrˆdndfGHd
tGHtjd ƒng}d |krÌ|j    tƒnd |krè|j    tƒn|r]tj
j |ƒGHtrtjd ƒq˜tt kr1tjdƒq˜tdkrMtjdƒq˜tjdƒn;ddl}|j|tjd tj
fƒGHtjdƒdS(Ns²    %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]sUSER_BASE: %r (%s)R%s doesn't existsUSER_SITE: %r (%s)sENABLE_USER_SITE: %ris --user-bases --user-siteiiiÿÿÿÿi
(R
targvRRLRRRTRXRRtpathsepRRGRttextwraptdedent(R«R¬RtbufferRÌ((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyt_script&s< !!         "t__main__(&RžR
RRR)Rft exec_prefixRaRRXRTRLRRRRR6R@RIRNRWRZRhRiRpR‚R€RƒR¨R©R®R¼RÀRÅRÇRÈRÏR|(((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/site.pyt<module>;sF                            )                     %            =                                1