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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
L\¬Qc@s¾dZdZddlmZddlZddlZddlZddlZddlm    Z    m
Z
m Z e
ƒIej rže    dde ƒe    dde ƒnddlZddlZWdQXydd    lmZWn!ek
ródd    lmZnXd
d d d ddddddddddddddgZdZead„Zd„Zd„Zead aeejd d d!„Zd d d"„Zd d d#„Zd$„Z d%„Z!d&„Z"d
fd'„ƒYZ#d fd(„ƒYZ$d ejfd)„ƒYZ%d e%fd*„ƒYZ&de&fd+„ƒYZ'de%fd,„ƒYZ(ejd-„Z)eeeed.„Z*ejd/„Z+d0„Z,d1„Z-d2„Z.d3„Z/ed4„Z0d5d6„Z1e2d7krºe)ƒndS(8sSupport module for CGI (Common Gateway Interface) scripts.
 
This module defines a number of utilities for use by CGI scripts
written in Python.
s2.6iÿÿÿÿ(t
attrgetterN(tfilterwarningstcatch_warningstwarntignores.*mimetools has been removeds.*rfc822 has been removed(tStringIOtMiniFieldStoraget FieldStoragetFormContentDicttSvFormContentDicttInterpFormContentDictt FormContenttparsetparse_qst    parse_qsltparse_multipartt parse_headertprint_exceptiont print_environt
print_formtprint_directorytprint_argumentstprint_environ_usagetescapetcGsZtr7t r7yttdƒaWq7tk
r3q7XntsFtantat|ŒdS(s„Write a log message, if there is a log file.
 
    Even though this function is called initlog(), you should always
    use log(); log is a variable that is set either to initlog
    (initially), to dolog (once the log file has been opened), or to
    nolog (when logging is disabled).
 
    The first argument is a format string; the remaining arguments (if
    any) are arguments to the % operator, so e.g.
        log("%s: %s", "a", "b")
    will write "a: b" to the log file, followed by a newline.
 
    If the global logfp is not None, it should be a file object to
    which log data is written.
 
    If the global logfp is None, the global logfile may be a string
    giving a filename to open, in append mode.  This file should be
    world writable!!!  If the file can't be opened, logging is
    silently disabled (since there is no safe place where we could
    send an error message).
 
    taN(tlogfiletlogfptopentIOErrortnologtlogtdolog(tallargs((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pytinitlogGs      cGstj||dƒdS(s=Write a log message to the log file.  See initlog() for docs.s
N(Rtwrite(tfmttargs((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR jscGsdS(s9Dummy function, assigned to log when logging is disabled.N((R!((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRnsicCsŒ|d krtj}nd|kr1d|d<n|ddkr3t|dƒ\}}|dkrpt||ƒS|dkr¼t|dƒ}trª|tkrªtd‚n|j|ƒ}nd    }d
|krò|rá|d }n||d
}n4tj    d r&|r|d }n|tj    d }n||d
<nFd
|krL|d
}n-tj    d ritj    d }nd    }||d
<t
j |||ƒS(s Parse a query in the environment or from a file (default stdin)
 
        Arguments, all optional:
 
        fp              : file pointer; default: sys.stdin
 
        environ         : environment dictionary; default: os.environ
 
        keep_blank_values: flag indicating whether blank values in
            percent-encoded forms should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.
 
        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.
    tREQUEST_METHODtGETtPOSTt CONTENT_TYPEsmultipart/form-datas!application/x-www-form-urlencodedtCONTENT_LENGTHsMaximum content length exceededRt QUERY_STRINGt&iN( tNonetsyststdinRRtinttmaxlent
ValueErrortreadtargvturlparseR (tfptenvirontkeep_blank_valueststrict_parsingtctypetpdicttclengthtqs((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR |s<                
cCs#tdtdƒtj|||ƒS(s)Parse a query given as a string argument.s9cgi.parse_qs is deprecated, use urlparse.parse_qs insteadi(RtPendingDeprecationWarningR5R (R=R8R9((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR ´s
cCs#tdtdƒtj|||ƒS(s)Parse a query given as a string argument.s;cgi.parse_qsl is deprecated, use urlparse.parse_qsl insteadi(RR>R5R(R=R8R9((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR»s
cCsd}d|kr|d}nt|ƒs>td|f‚nd|}d|d}i}d}x&||krŠd}d}|rtj|ƒ}    |    jdƒ}
|
rÎyt|
ƒ}WqÎtk
rÊqÎXn|dkr
trø|tkrøtd‚n|j|ƒ}qd}ng} xa|j    ƒ} | s8|}Pn| d     dkrm| j
ƒ}|||fkrmPqmn| j | ƒq|dkrqen|dkr| r| d} | d
d krÈ| d
 } n| dd krå| d } n| | d<dj | ƒ}qn|    d } | sqent | ƒ\} }| dkr>qend|kre|d}nqe||krz||j |ƒqe|g||<qeW|S(søParse multipart input.
 
    Arguments:
    fp   : input file
    pdict: dictionary containing other parameters of content-type header
 
    Returns a dictionary just like parse_qs(): keys are the field names, each
    value is a list of values for that field.  This is easy to use but not
    much good if you are expecting megabytes to be uploaded -- in that case,
    use the FieldStorage class instead which is much more flexible.  Note
    that content-type is the raw, unparsed contents of the content-type
    header.
 
    XXX This does not parse nested multipart parts -- use FieldStorage for
    that.
 
    XXX This should really be subsumed by FieldStorage altogether -- no
    point in having two implementations of the same parsing algorithm.
    Also, FieldStorage protects itself better against certain DoS attacks
    by limiting the size of the data read in one chunk.  The API here
    does not support that kind of protection.  This also affects parse()
    since it can call parse_multipart().
 
    Rtboundarys&Invalid boundary in multipart form: %rs--iÿÿÿÿscontent-lengthisMaximum content length exceedediiþÿÿÿs
s
scontent-dispositions    form-datatnameN(tvalid_boundaryR2R-t    mimetoolstMessaget    getheaderR0R1R3treadlinetstriptappendtjoinR(R6R;R?tnextparttlastparttpartdictt
terminatortbytestdatatheadersR<tlinestlinetkeytparamsR@((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRÁsz    
           
 
 
    ccsÃx¼|d dkr¾|d}|jdƒ}xR|dkr€|jdd|ƒ|jdd|ƒdr€|jd|dƒ}q/W|dkrœt|ƒ}n|| }|jƒV||}qWdS(Nit;it"s\"i(tfindtcounttlenRF(tstendtf((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyt _parseparam#s
; 
 cCsótd|ƒ}|jƒ}i}xÄ|D]¼}|jdƒ}|dkr)|| jƒjƒ}||djƒ}t|ƒdkrØ|d|dko¥dknrØ|dd!}|jdd    ƒjd
dƒ}n|||<q)q)W||fS( sfParse a Content-type like header.
 
    Return the main content-type and a dictionary of options.
 
    RTt=iiiiÿÿÿÿRUs\\s\s\"(R\tnextRVRFtlowerRXtreplace(RQtpartsRRR;tptiR@tvalue((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR/s   6 !cBsPeZdZdZdZdZdZiZdZ    iZ
iZ d„Z d„Z RS(s=Like FieldStorage, for use when no file uploads are possible.cCs||_||_dS(s&Constructor from field name and value.N(R@Rd(tselfR@Rd((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyt__init__Us    cCsd|j|jfS(s Return printable representation.sMiniFieldStorage(%r, %r)(R@Rd(Re((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyt__repr__[sN(t__name__t
__module__t__doc__R-tfilenametlistttypetfilet type_optionst dispositiontdisposition_optionsRORfRg(((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRGs    cBseZdZdddejddd„Zd„Zd„Zd„Z    d„Z
dd„Z dd    „Z d
„Z d „Zd „Zd „Zd„Zd„Zd„ZdZd„Zd„ZdZd„Zd„Zd„Zd„Zd„Zd„Zdd„ZRS(sšStore a sequence of fields, reading multipart/form-data.
 
    This class provides naming, typing, files stored on disk, and
    more.  At the top level, it is accessible like a dictionary, whose
    keys are the field names.  (Note: None can occur as a field name.)
    The items are either a Python list (if there's multiple values) or
    another FieldStorage or MiniFieldStorage object.  If it's a single
    object, it has the following attributes:
 
    name: the field name, if specified; otherwise None
 
    filename: the filename, if specified; otherwise None; this is the
        client side filename, *not* the file name on which it is
        stored (that's a temporary file you don't deal with)
 
    value: the value as a *string*; for file uploads, this
        transparently reads the file every time you request the value
 
    file: the file(-like) object from which you can read the data;
        None if the data is stored a simple string
 
    type: the content-type, or None if not specified
 
    type_options: dictionary of options specified on the content-type
        line
 
    disposition: content-disposition, or None if not specified
 
    disposition_options: dictionary of corresponding options
 
    headers: a dictionary(-like) object (sometimes rfc822.Message or a
        subclass thereof) containing *all* headers
 
    The class is subclassable, mostly for the purpose of overriding
    the make_file() method, which is called internally to come up with
    a file open for reading and writing.  This makes it possible to
    override the default choice of storing all files in a temporary
    directory and unlinking them as soon as they have been opened.
 
    Ric Cs_d}||_||_d|kr7|djƒ}nd|_|dksX|dkr¿d|krq|d}n#tjdrŽtjd}nd}t|ƒ}|dkr¿idd6}q¿n|dkrCi}|d    krêd|d<nd
|kr|d
|d<nd|kr#|d|_nd |krC|d |d <qCn|pOtj|_    ||_
||_ di}    }
d |j
krŸt |j
d ƒ\}    }
n|    |_ |
|_d|_d|
krÖ|
d|_nd|_d|
krû|
d|_nd|j
kr&t |j
dƒ\} }
n2|j s;|d    krKdi} }
n di} }
| |_|
|_d|_d|
kr|
d|_nd} d |j
krðyt|j
d ƒ} Wntk
rÎnXtrð| tkrðtd‚qðn| |_d|_|_d|_| dkr+|jƒn0| d dkrQ|j|||ƒn
|jƒdS(sConstructor.  Read multipart/* until last part.
 
        Arguments, all optional:
 
        fp              : file pointer; default: sys.stdin
            (not used when the request method is GET)
 
        headers         : header dictionary-like object; default:
            taken from environ as per CGI spec
 
        outerboundary   : terminating multipart boundary
            (for internal use only)
 
        environ         : environment dictionary; default: os.environ
 
        keep_blank_values: flag indicating whether blank values in
            percent-encoded forms should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.
 
        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.
 
        R'R&tHEADR+iRs!application/x-www-form-urlencodeds content-typeR(R)R*scontent-lengthscontent-dispositionR@Rks
text/plainR?iÿÿÿÿsMaximum content length exceededii
s
multipart/N(R8R9tupperR-t
qs_on_postR.R4RR/R6ROt outerboundaryRRpRqR@RkRmRot innerboundaryR0R2R1tlengthRlRntdonetread_urlencodedt
read_multit read_single( ReR6RORuR7R8R9tmethodR=tcdispR;R:tclen((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRf‹s„                                                                            cCsd|j|j|jfS(s"Return a printable representation.sFieldStorage(%r, %r, %r)(R@RkRd(Re((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRgÿscCst|jƒƒS(N(titertkeys(Re((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyt__iter__scCsx|dkrt|‚n|jrS|jjdƒ|jjƒ}|jjdƒn!|jdk    rn|j}nd}|S(NRdi(tAttributeErrorRntseekR3RlR-(ReR@Rd((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyt __getattr__s       cCsˆ|jdkrtd‚ng}x0|jD]%}|j|kr+|j|ƒq+q+W|sft|‚nt|ƒdkr€|dS|SdS(sDictionary style indexing.s not indexableiiN(RlR-t    TypeErrorR@RGtKeyErrorRX(ReRRtfoundtitem((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyt __getitem__s  cCsS||krK||}t|ƒtgƒkrAttdƒ|ƒS|jSn|SdS(s8Dictionary style get() method, including 'value' lookup.RdN(RmtmapRRd(ReRRtdefaultRd((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pytgetvalue"s  
 
cCsK||krC||}t|ƒtgƒkr9|djS|jSn|SdS(s! Return the first value received.iN(RmRd(ReRRR‹Rd((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pytgetfirst-s  
 
cCsV||krN||}t|ƒtgƒkrAttdƒ|ƒS|jgSngSdS(s  Return list of received values.RdN(RmRŠRRd(ReRRRd((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pytgetlist8s  
 cCs8|jdkrtd‚nttd„|jDƒƒƒS(sDictionary style keys() method.s not indexablecss|]}|jVqdS(N(R@(t.0Rˆ((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pys    <genexpr>GsN(RlR-R…tset(Re((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR€Cs cs8|jdkrtd‚nt‡fd†|jDƒƒS(s"Dictionary style has_key() method.s not indexablec3s|]}|jˆkVqdS(N(R@(RRˆ(RR(sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pys    <genexpr>MsN(RlR-R…tany(ReRR((RRsK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pythas_keyIs cs8|jdkrtd‚nt‡fd†|jDƒƒS(s%Dictionary style __contains__ method.s not indexablec3s|]}|jˆkVqdS(N(R@(RRˆ(RR(sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pys    <genexpr>SsN(RlR-R…R‘(ReRR((RRsK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyt __contains__Os cCst|jƒƒS(s Dictionary style len(x) support.(RXR€(Re((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyt__len__UscCs t|jƒS(N(tboolRl(Re((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyt __nonzero__YscCs|jj|jƒ}|jr2|d|j7}ng|_}x?tj||j|jƒD]"\}}|j    t
||ƒƒq[W|j ƒdS(s+Internal: read data in query string format.R,N( R6R3RwRtRlR5RR8R9RGRt
skip_lines(ReR=RlRRRd((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRy\s     c Cs|j}t|ƒs(td|f‚ng|_|jr‹xEtj|j|j|jƒD]%\}}|jj    t
||ƒƒqYWd}n|j pš|j }||ji||||ƒ}    xM|    js
tj|jƒ}
||j|
||||ƒ}    |jj    |    ƒq¾W|jƒdS(s/Internal: read a part that is itself multipart.s&Invalid boundary in multipart form: %rN(RvRAR2RlRtR5RR8R9RGRR-tFieldStorageClasst    __class__R6Rxtrfc822RCR—( ReR7R8R9tibRRRdR˜tklasstpartRO((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRzis$                  cCsD|jdkr&|jƒ|jƒn
|jƒ|jjdƒdS(sInternal: read an atomic part.iN(Rwt read_binaryR—t
read_linesRnRƒ(Re((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR{€s
 
 
iicCs’|jdƒ|_|j}|dkrŽxd|dkrŠ|jjt||jƒƒ}|sgd|_Pn|jj|ƒ|t    |ƒ}q*WndS(sInternal: read binary data.tbiiÿÿÿÿN(
t    make_fileRnRwR6R3tmintbufsizeRxR#RX(RettodoRN((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRž‹s         cCs7tƒ|_|_|jr)|jƒn
|jƒdS(s0Internal: read lines until EOF or outerboundary.N(RRnt_FieldStorage__fileRutread_lines_to_outerboundarytread_lines_to_eof(Re((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRŸ˜s     cCs||jdk    rh|jjƒt|ƒdkrh|jdƒ|_|jj|jjƒƒd|_qhn|jj|ƒdS(NièR(R¥R-ttellRXR¡RnR#RŒ(ReRQ((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyt__write s cCs<x5|jjdƒ}|s(d|_Pn|j|ƒqdS(sInternal: read lines until EOF.iiiÿÿÿÿNi(R6RERxt_FieldStorage__write(ReRQ((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR§¨s     cCsd|j}|d}d}t}xë|jjd ƒ}|sKd|_Pn|d dkr™|r™|jƒ}||kr}Pn||kr™d|_Pq™n|}|ddkrÈd}|d }t}n5|dd    krñd    }|d }t}n d}t}|j||ƒq&d
S( s)Internal: read lines until outerboundary.s--Riiiÿÿÿÿiiþÿÿÿs
s
Ni(RutTrueR6RERxRFtFalseRª(ReR^tlasttdelimtlast_line_lfendRQt strippedlinetodelim((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR¦±s8 
           
    
    cCsÀ|j s|jrdSd|j}|d}t}x…|jjdƒ}|s\d|_Pn|d dkrª|rª|jƒ}||krŽPn||krªd|_Pqªn|jdƒ}q7dS(    s5Internal: skip lines until outer boundary if defined.Ns--iiiÿÿÿÿis
i(RuRxR«R6RERFtendswith(ReR^R­R¯RQR°((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR—Ñs$ 
           cCsddl}|jdƒS(s±Overridable: return a readable & writable file.
 
        The file will be used as follows:
        - data is written to it
        - seek(0)
        - data is read from it
 
        The 'binary' argument is unused -- the file is always opened
        in binary mode.
 
        This version opens a temporary file for reading and writing,
        and immediately deletes (unlinks) it.  The trick (on Unix!) is
        that the file can still be used, but it can't be opened by
        another process, and it will automatically be deleted when it
        is closed or when the current process terminates.
 
        If you want a more permanent file, you derive a class which
        overrides this method.  If you want a visible temporary file
        that is nevertheless automatically deleted when the script
        terminates, try defining a __del__ method in a derived class
        which unlinks the temporary files you have created.
 
        iÿÿÿÿNsw+b(ttempfilet TemporaryFile(RetbinaryR³((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR¡æs Ni (RhRiRjR-tosR7RfRgRR„R‰RŒRRŽR€R’R“R”R–RyR˜RzR{R£RžRŸRªR§R¦R—R¡(((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR`s6)    s                                                                                      cBs#eZdZejddd„ZRS(sxForm content as dictionary with a list of values per field.
 
    form = FormContentDict()
 
    form[key] -> [value, value, ...]
    key in form -> Boolean
    form.keys() -> [key, key, ...]
    form.values() -> [[val, val, ...], [val, val, ...], ...]
    form.items() ->  [(key, [val, val, ...]), (key, [val, val, ...]), ...]
    form.dict == {key: [val, val, ...], ...}
 
    icCs6td|d|d|ƒ|_|_|d|_dS(NR7R8R9R+(R tdictRNt query_string(ReR7R8R9((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRfs (RhRiRjR¶R7Rf(((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRs cBs2eZdZd„Zd„Zd„Zd„ZRS(s÷Form content as dictionary expecting a single value per field.
 
    If you only expect a single value for each field, then form[key]
    will return that single value.  It will raise an IndexError if
    that expectation is not true.  If you expect a field to have
    possible multiple values, than you can use form.getlist(key) to
    get all of the values.  values() and items() are a compromise:
    they return single strings where there is a single value, and
    lists of strings otherwise.
 
    cCs4t|j|ƒdkr%td‚n|j|dS(Nisexpecting a single valuei(RXR·t
IndexError(ReRR((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR‰&s cCs |j|S(N(R·(ReRR((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRŽ*scCsWg}xJ|jjƒD]9}t|ƒdkrB|j|dƒq|j|ƒqW|S(Nii(R·tvaluesRXRG(RetresultRd((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRº,s cCsig}x\|jjƒD]K\}}t|ƒdkrN|j||dfƒq|j||fƒqW|S(Nii(R·titemsRXRG(ReR»RRRd((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR¼3s (RhRiRjR‰RŽRºR¼(((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR    s
             cBs)eZdZd„Zd„Zd„ZRS(s7This class is present for backwards compatibility only.cCsstj||ƒ}|ddkriyt|ƒSWqitk
reyt|ƒSWqftk
raqfXqiXn|jƒS(Nis 0123456789+-.(R    R‰R0R2tfloatRF(ReRRtv((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR‰>s  cCs^g}xQ|jƒD]C}y|j||ƒWqtk
rU|j|j|ƒqXqW|S(N(R€RGR¹R·(ReR»RR((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRºFs cCsjg}x]|jƒD]O}y|j|||fƒWqtk
ra|j||j|fƒqXqW|S(N(R€RGR¹R·(ReR»RR((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR¼Ns "(RhRiRjR‰RºR¼(((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR
<s        cBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s7This class is present for backwards compatibility only.cCs"||jkr|j|SdSdS(N(R·R-(ReRR((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRºZs cCsF||jkr>t|j|ƒ|kr7|j||SdSndSdS(N(R·RXR-(ReRRtlocation((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyt indexed_value]s
cCs&||jkr|j|dSdSdS(Ni(R·R-(ReRR((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRdcscCst|j|ƒS(N(RXR·(ReRR((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRwfscCs,||jkr$|j|djƒSdSdS(Ni(R·RFR-(ReRR((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pytstrippedhscCs|jS(N(R·(Re((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pytparsks(    RhRiRjRºRÀRdRwRÁRÂ(((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR Xs                    cCsÉdGHHtjt_yWtƒ}tƒtƒt|ƒt|ƒtƒd„}|d„}dGH|ƒWnt    ƒnXdGHda
y/tƒ}tƒtƒt|ƒt|ƒWnt    ƒnXdS(s—Robust test CGI script, usable as main program.
 
    Write minimal HTTP headers and dump all information provided to
    the script in HTML form.
 
    sContent-type: text/htmlcRs ddUdS(Ns,testing print_exception() -- <I>italics?</I>((((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR[ƒscSs |ƒdS(N((R[((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pytg…ss9<H3>What follows is a test, not an actual exception:</H3>s*<H1>Second try with a small maxlen...</H1>i2N( R.tstdouttstderrRRRRRRRR1(R7tformR[RÃ((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyttestrs4     
 
           
cCs‹|dkr$tjƒ\}}}nddl}HdGH|j||ƒ|j||ƒ}dtdj|d ƒƒt|dƒfGH~dS(Niÿÿÿÿs+<H3>Traceback (most recent call last):</H3>s<PRE>%s<B>%s</B></PRE>R(R-R.texc_infot    tracebackt    format_tbtformat_exception_onlyRRH(RmRdttbtlimitRÉRl((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR™s  cCs]|jƒ}|jƒHdGHdGHx/|D]'}dGt|ƒGdGt||ƒGHq(WdGHHdS(s#Dump the shell environment as HTML.s<H3>Shell Environment:</H3>s<DL>s<DT>s<DD>s</DL>N(R€tsortR(R7R€RR((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR§s 
 %cCsš|jƒ}|jƒHdGH|s*dGHndGHx^|D]V}dt|ƒdG||}dttt|ƒƒƒdGHdtt|ƒƒGHq6Wd    GHHd
S( s$Dump the contents of a form as HTML.s<H3>Form Contents:</H3>s<P>No form fields.s<DL>s<DT>t:s<i>s</i>s<DD>s</DL>N(R€RÎRtreprRm(RÆR€RRRd((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR³s 
 
cCsTHdGHytjƒ}Wn+tjk
rC}dGtt|ƒƒGHn Xt|ƒGHHdS(s#Dump the current directory as HTML.s#<H3>Current Working Directory:</H3>s    os.error:N(R¶tgetcwdterrorRtstr(tpwdtmsg((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRÄs cCsHdGHHtjGHHdS(Ns <H3>Command Line Arguments:</H3>(R.R4(((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRÐs
cCs    dGHdS(s9Dump a list of environment variables used by CGI as HTML.sØ
<H3>These environment variables could have been set:</H3>
<UL>
<LI>AUTH_TYPE
<LI>CONTENT_LENGTH
<LI>CONTENT_TYPE
<LI>DATE_GMT
<LI>DATE_LOCAL
<LI>DOCUMENT_NAME
<LI>DOCUMENT_ROOT
<LI>DOCUMENT_URI
<LI>GATEWAY_INTERFACE
<LI>LAST_MODIFIED
<LI>PATH
<LI>PATH_INFO
<LI>PATH_TRANSLATED
<LI>QUERY_STRING
<LI>REMOTE_ADDR
<LI>REMOTE_HOST
<LI>REMOTE_IDENT
<LI>REMOTE_USER
<LI>REQUEST_METHOD
<LI>SCRIPT_NAME
<LI>SERVER_NAME
<LI>SERVER_PORT
<LI>SERVER_PROTOCOL
<LI>SERVER_ROOT
<LI>SERVER_SOFTWARE
</UL>
In addition, HTTP headers sent by the server may be passed in the
environment as well.  Here are some common variable names:
<UL>
<LI>HTTP_ACCEPT
<LI>HTTP_CONNECTION
<LI>HTTP_HOST
<LI>HTTP_PRAGMA
<LI>HTTP_REFERER
<LI>HTTP_USER_AGENT
</UL>
N((((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyR×s)cCsU|jddƒ}|jddƒ}|jddƒ}|rQ|jddƒ}n|S(    s¤Replace special characters "&", "<" and ">" to HTML-safe sequences.
    If the optional flag quote is true, the quotation mark character (")
    is also translated.R,s&amp;t<s&lt;t>s&gt;RUs&quot;(R`(RYtquote((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRs s^[ -~]{0,200}[!-~]$cCsddl}|j||ƒS(Niÿÿÿÿ(tretmatch(RYt _vb_patternRÙ((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyRAs t__main__(3Rjt __version__toperatorRR.R¶tUserDictR5twarningsRRRt py3kwarningtDeprecationWarningRBRšt    cStringIORt ImportErrort__all__RR-RR"R RRR1R7R R RRR\RRRRR    R
R RÇRRRRRRRRARh(((sK/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cgi.pyt<module>sp    
            
                        #        8    b        ÿ§"'                /