/
usr
/
lib64
/
python2.7
/
/usr/lib64/python2.7
mkdir
upload
Name
Size
Mode
Actions
bsddb/
-
0755
rm
compiler/
-
0755
rm
config/
-
0755
rm
ctypes/
-
0755
rm
curses/
-
0755
rm
distutils/
-
0755
rm
email/
-
0755
rm
encodings/
-
0755
rm
ensurepip/
-
0755
rm
hotshot/
-
0755
rm
idlelib/
-
0755
rm
importlib/
-
0755
rm
json/
-
0755
rm
lib-dynload/
-
0755
rm
lib2to3/
-
0755
rm
logging/
-
0755
rm
multiprocessing/
-
0755
rm
plat-linux2/
-
0755
rm
pydoc_data/
-
0755
rm
site-packages/
-
0755
rm
sqlite3/
-
0755
rm
test/
-
0755
rm
unittest/
-
0755
rm
wsgiref/
-
0755
rm
xml/
-
0755
rm
abc.py
7145
0644
edit
dl
rm
abc.pyc
6143
0644
edit
dl
rm
abc.pyo
6087
0644
edit
dl
rm
aifc.py
34579
0644
edit
dl
rm
aifc.pyc
30459
0644
edit
dl
rm
aifc.pyo
30459
0644
edit
dl
rm
antigravity.py
60
0644
edit
dl
rm
antigravity.pyc
203
0644
edit
dl
rm
antigravity.pyo
203
0644
edit
dl
rm
anydbm.py
2663
0644
edit
dl
rm
anydbm.pyc
2800
0644
edit
dl
rm
anydbm.pyo
2800
0644
edit
dl
rm
argparse.py
89228
0644
edit
dl
rm
argparse.pyc
64367
0644
edit
dl
rm
argparse.pyo
64202
0644
edit
dl
rm
ast.py
11805
0644
edit
dl
rm
ast.pyc
12938
0644
edit
dl
rm
ast.pyo
12938
0644
edit
dl
rm
asynchat.py
11581
0644
edit
dl
rm
asynchat.pyc
8810
0644
edit
dl
rm
asynchat.pyo
8810
0644
edit
dl
rm
asyncore.py
20943
0644
edit
dl
rm
asyncore.pyc
18893
0644
edit
dl
rm
asyncore.pyo
18893
0644
edit
dl
rm
atexit.py
1705
0644
edit
dl
rm
atexit.pyc
2203
0644
edit
dl
rm
atexit.pyo
2203
0644
edit
dl
rm
audiodev.py
7597
0644
edit
dl
rm
audiodev.pyc
8469
0644
edit
dl
rm
audiodev.pyo
8469
0644
edit
dl
rm
base64.py
11806
0755
edit
dl
rm
base64.pyc
11297
0644
edit
dl
rm
base64.pyo
11297
0644
edit
dl
rm
BaseHTTPServer.py
22747
0644
edit
dl
rm
BaseHTTPServer.pyc
21722
0644
edit
dl
rm
BaseHTTPServer.pyo
21722
0644
edit
dl
rm
Bastion.py
5744
0644
edit
dl
rm
Bastion.pyc
6660
0644
edit
dl
rm
Bastion.pyo
6660
0644
edit
dl
rm
bdb.py
21714
0644
edit
dl
rm
bdb.pyc
19101
0644
edit
dl
rm
bdb.pyo
19101
0644
edit
dl
rm
binhex.py
14698
0644
edit
dl
rm
binhex.pyc
15460
0644
edit
dl
rm
binhex.pyo
15460
0644
edit
dl
rm
bisect.py
2595
0644
edit
dl
rm
bisect.pyc
3071
0644
edit
dl
rm
bisect.pyo
3071
0644
edit
dl
rm
calendar.py
23384
0644
edit
dl
rm
calendar.pyc
27913
0644
edit
dl
rm
calendar.pyo
27913
0644
edit
dl
rm
cgi.py
36308
0755
edit
dl
rm
cgi.pyc
33366
0644
edit
dl
rm
cgi.pyo
33366
0644
edit
dl
rm
CGIHTTPServer.py
13089
0644
edit
dl
rm
CGIHTTPServer.pyc
11018
0644
edit
dl
rm
CGIHTTPServer.pyo
11018
0644
edit
dl
rm
cgitb.py
12175
0644
edit
dl
rm
cgitb.pyc
12138
0644
edit
dl
rm
cgitb.pyo
12138
0644
edit
dl
rm
chunk.py
5419
0644
edit
dl
rm
chunk.pyc
5602
0644
edit
dl
rm
chunk.pyo
5602
0644
edit
dl
rm
cmd.py
15026
0644
edit
dl
rm
cmd.pyc
14039
0644
edit
dl
rm
cmd.pyo
14039
0644
edit
dl
rm
code.py
10189
0644
edit
dl
rm
code.pyc
10334
0644
edit
dl
rm
code.pyo
10334
0644
edit
dl
rm
codecs.py
36143
0644
edit
dl
rm
codecs.pyc
36824
0644
edit
dl
rm
codecs.pyo
36824
0644
edit
dl
rm
codeop.py
5999
0644
edit
dl
rm
codeop.pyc
6597
0644
edit
dl
rm
codeop.pyo
6597
0644
edit
dl
rm
collections.py
27798
0644
edit
dl
rm
collections.pyc
26163
0644
edit
dl
rm
collections.pyo
26112
0644
edit
dl
rm
colorsys.py
3691
0644
edit
dl
rm
colorsys.pyc
3991
0644
edit
dl
rm
colorsys.pyo
3991
0644
edit
dl
rm
commands.py
2545
0644
edit
dl
rm
commands.pyc
2469
0644
edit
dl
rm
commands.pyo
2469
0644
edit
dl
rm
compileall.py
7763
0644
edit
dl
rm
compileall.pyc
7017
0644
edit
dl
rm
compileall.pyo
7017
0644
edit
dl
rm
ConfigParser.py
27746
0644
edit
dl
rm
ConfigParser.pyc
25213
0644
edit
dl
rm
ConfigParser.pyo
25213
0644
edit
dl
rm
contextlib.py
4424
0644
edit
dl
rm
contextlib.pyc
4454
0644
edit
dl
rm
contextlib.pyo
4454
0644
edit
dl
rm
Cookie.py
26538
0644
edit
dl
rm
Cookie.pyc
22658
0644
edit
dl
rm
Cookie.pyo
22658
0644
edit
dl
rm
cookielib.py
65486
0644
edit
dl
rm
cookielib.pyc
54725
0644
edit
dl
rm
cookielib.pyo
54537
0644
edit
dl
rm
copy.py
11533
0644
edit
dl
rm
copy.pyc
12170
0644
edit
dl
rm
copy.pyo
12078
0644
edit
dl
rm
copy_reg.py
6974
0644
edit
dl
rm
copy_reg.pyc
5167
0644
edit
dl
rm
copy_reg.pyo
5123
0644
edit
dl
rm
cProfile.py
6573
0755
edit
dl
rm
cProfile.pyc
6395
0644
edit
dl
rm
cProfile.pyo
6395
0644
edit
dl
rm
crypt.py
2292
0644
edit
dl
rm
crypt.pyc
2960
0644
edit
dl
rm
crypt.pyo
2960
0644
edit
dl
rm
csv.py
16708
0644
edit
dl
rm
csv.pyc
13507
0644
edit
dl
rm
csv.pyo
13507
0644
edit
dl
rm
dbhash.py
498
0644
edit
dl
rm
dbhash.pyc
718
0644
edit
dl
rm
dbhash.pyo
718
0644
edit
dl
rm
decimal.py
221933
0644
edit
dl
rm
decimal.pyc
172155
0644
edit
dl
rm
decimal.pyo
172155
0644
edit
dl
rm
difflib.py
82325
0644
edit
dl
rm
difflib.pyc
61898
0644
edit
dl
rm
difflib.pyo
61847
0644
edit
dl
rm
dircache.py
1126
0644
edit
dl
rm
dircache.pyc
1576
0644
edit
dl
rm
dircache.pyo
1576
0644
edit
dl
rm
dis.py
6499
0644
edit
dl
rm
dis.pyc
6228
0644
edit
dl
rm
dis.pyo
6228
0644
edit
dl
rm
doctest.py
105095
0644
edit
dl
rm
doctest.pyc
83637
0644
edit
dl
rm
doctest.pyo
83350
0644
edit
dl
rm
DocXMLRPCServer.py
10768
0644
edit
dl
rm
DocXMLRPCServer.pyc
10195
0644
edit
dl
rm
DocXMLRPCServer.pyo
10086
0644
edit
dl
rm
dumbdbm.py
9141
0644
edit
dl
rm
dumbdbm.pyc
6746
0644
edit
dl
rm
dumbdbm.pyo
6746
0644
edit
dl
rm
dummy_thread.py
4418
0644
edit
dl
rm
dummy_thread.pyc
5394
0644
edit
dl
rm
dummy_thread.pyo
5394
0644
edit
dl
rm
dummy_threading.py
2804
0644
edit
dl
rm
dummy_threading.pyc
1285
0644
edit
dl
rm
dummy_threading.pyo
1285
0644
edit
dl
rm
filecmp.py
9588
0644
edit
dl
rm
filecmp.pyc
9622
0644
edit
dl
rm
filecmp.pyo
9622
0644
edit
dl
rm
fileinput.py
13746
0644
edit
dl
rm
fileinput.pyc
14500
0644
edit
dl
rm
fileinput.pyo
14500
0644
edit
dl
rm
fnmatch.py
3315
0644
edit
dl
rm
fnmatch.pyc
3614
0644
edit
dl
rm
fnmatch.pyo
3614
0644
edit
dl
rm
formatter.py
14911
0644
edit
dl
rm
formatter.pyc
19178
0644
edit
dl
rm
formatter.pyo
19178
0644
edit
dl
rm
fpformat.py
4732
0644
edit
dl
rm
fpformat.pyc
4703
0644
edit
dl
rm
fpformat.pyo
4703
0644
edit
dl
rm
fractions.py
22390
0644
edit
dl
rm
fractions.pyc
19711
0644
edit
dl
rm
fractions.pyo
19711
0644
edit
dl
rm
ftplib.py
38555
0644
edit
dl
rm
ftplib.pyc
34939
0644
edit
dl
rm
ftplib.pyo
34939
0644
edit
dl
rm
functools.py
4806
0644
edit
dl
rm
functools.pyc
6629
0644
edit
dl
rm
functools.pyo
6629
0644
edit
dl
rm
genericpath.py
3201
0644
edit
dl
rm
genericpath.pyc
3517
0644
edit
dl
rm
genericpath.pyo
3517
0644
edit
dl
rm
getopt.py
7319
0644
edit
dl
rm
getopt.pyc
6654
0644
edit
dl
rm
getopt.pyo
6609
0644
edit
dl
rm
getpass.py
5563
0644
edit
dl
rm
getpass.pyc
4744
0644
edit
dl
rm
getpass.pyo
4744
0644
edit
dl
rm
gettext.py
22666
0644
edit
dl
rm
gettext.pyc
18004
0644
edit
dl
rm
gettext.pyo
18004
0644
edit
dl
rm
glob.py
3114
0644
edit
dl
rm
glob.pyc
2943
0644
edit
dl
rm
glob.pyo
2943
0644
edit
dl
rm
gzip.py
19028
0644
edit
dl
rm
gzip.pyc
15236
0644
edit
dl
rm
gzip.pyo
15236
0644
edit
dl
rm
hashlib.py
7841
0644
edit
dl
rm
hashlib.pyc
6919
0644
edit
dl
rm
hashlib.pyo
6919
0644
edit
dl
rm
heapq.py
18295
0644
edit
dl
rm
heapq.pyc
14564
0644
edit
dl
rm
heapq.pyo
14564
0644
edit
dl
rm
hmac.py
4588
0644
edit
dl
rm
hmac.pyc
4542
0644
edit
dl
rm
hmac.pyo
4542
0644
edit
dl
rm
htmlentitydefs.py
18056
0644
edit
dl
rm
htmlentitydefs.pyc
6367
0644
edit
dl
rm
htmlentitydefs.pyo
6367
0644
edit
dl
rm
htmllib.py
12869
0644
edit
dl
rm
htmllib.pyc
20309
0644
edit
dl
rm
htmllib.pyo
20309
0644
edit
dl
rm
HTMLParser.py
17171
0644
edit
dl
rm
HTMLParser.pyc
13727
0644
edit
dl
rm
HTMLParser.pyo
13422
0644
edit
dl
rm
httplib.py
53306
0644
edit
dl
rm
httplib.pyc
38724
0644
edit
dl
rm
httplib.pyo
38540
0644
edit
dl
rm
ihooks.py
18986
0644
edit
dl
rm
ihooks.pyc
21372
0644
edit
dl
rm
ihooks.pyo
21372
0644
edit
dl
rm
imaplib.py
48366
0644
edit
dl
rm
imaplib.pyc
45011
0644
edit
dl
rm
imaplib.pyo
42310
0644
edit
dl
rm
imghdr.py
3541
0644
edit
dl
rm
imghdr.pyc
4838
0644
edit
dl
rm
imghdr.pyo
4838
0644
edit
dl
rm
imputil.py
25764
0644
edit
dl
rm
imputil.pyc
15623
0644
edit
dl
rm
imputil.pyo
15445
0644
edit
dl
rm
inspect.py
43008
0644
edit
dl
rm
inspect.pyc
40229
0644
edit
dl
rm
inspect.pyo
40229
0644
edit
dl
rm
io.py
3322
0644
edit
dl
rm
io.pyc
3589
0644
edit
dl
rm
io.pyo
3589
0644
edit
dl
rm
keyword.py
1995
0755
edit
dl
rm
keyword.pyc
2105
0644
edit
dl
rm
keyword.pyo
2105
0644
edit
dl
rm
linecache.py
4027
0644
edit
dl
rm
linecache.pyc
3272
0644
edit
dl
rm
linecache.pyo
3272
0644
edit
dl
rm
locale.py
102834
0644
edit
dl
rm
locale.pyc
56610
0644
edit
dl
rm
locale.pyo
56610
0644
edit
dl
rm
macpath.py
6289
0644
edit
dl
rm
macpath.pyc
7681
0644
edit
dl
rm
macpath.pyo
7681
0644
edit
dl
rm
macurl2path.py
2731
0644
edit
dl
rm
macurl2path.pyc
2244
0644
edit
dl
rm
macurl2path.pyo
2244
0644
edit
dl
rm
mailbox.py
81240
0644
edit
dl
rm
mailbox.pyc
76717
0644
edit
dl
rm
mailbox.pyo
76670
0644
edit
dl
rm
mailcap.py
8404
0644
edit
dl
rm
mailcap.pyc
7955
0644
edit
dl
rm
mailcap.pyo
7955
0644
edit
dl
rm
markupbase.py
14643
0644
edit
dl
rm
markupbase.pyc
9267
0644
edit
dl
rm
markupbase.pyo
9071
0644
edit
dl
rm
md5.py
358
0644
edit
dl
rm
md5.pyc
378
0644
edit
dl
rm
md5.pyo
378
0644
edit
dl
rm
mhlib.py
33434
0644
edit
dl
rm
mhlib.pyc
33777
0644
edit
dl
rm
mhlib.pyo
33777
0644
edit
dl
rm
mimetools.py
7168
0644
edit
dl
rm
mimetools.pyc
8201
0644
edit
dl
rm
mimetools.pyo
8201
0644
edit
dl
rm
mimetypes.py
21028
0644
edit
dl
rm
mimetypes.pyc
18489
0644
edit
dl
rm
mimetypes.pyo
18489
0644
edit
dl
rm
MimeWriter.py
6482
0644
edit
dl
rm
MimeWriter.pyc
7364
0644
edit
dl
rm
MimeWriter.pyo
7364
0644
edit
dl
rm
mimify.py
15020
0755
edit
dl
rm
mimify.pyc
12001
0644
edit
dl
rm
mimify.pyo
12001
0644
edit
dl
rm
modulefinder.py
24461
0644
edit
dl
rm
modulefinder.pyc
19127
0644
edit
dl
rm
modulefinder.pyo
19045
0644
edit
dl
rm
multifile.py
4820
0644
edit
dl
rm
multifile.pyc
5420
0644
edit
dl
rm
multifile.pyo
5378
0644
edit
dl
rm
mutex.py
1878
0644
edit
dl
rm
mutex.pyc
2516
0644
edit
dl
rm
mutex.pyo
2516
0644
edit
dl
rm
netrc.py
5888
0644
edit
dl
rm
netrc.pyc
4714
0644
edit
dl
rm
netrc.pyo
4714
0644
edit
dl
rm
new.py
610
0644
edit
dl
rm
new.pyc
862
0644
edit
dl
rm
new.pyo
862
0644
edit
dl
rm
nntplib.py
21470
0644
edit
dl
rm
nntplib.pyc
21044
0644
edit
dl
rm
nntplib.pyo
21044
0644
edit
dl
rm
ntpath.py
19429
0644
edit
dl
rm
ntpath.pyc
13129
0644
edit
dl
rm
ntpath.pyo
13129
0644
edit
dl
rm
nturl2path.py
2419
0644
edit
dl
rm
nturl2path.pyc
1815
0644
edit
dl
rm
nturl2path.pyo
1815
0644
edit
dl
rm
numbers.py
10319
0644
edit
dl
rm
numbers.pyc
14012
0644
edit
dl
rm
numbers.pyo
14012
0644
edit
dl
rm
opcode.py
5474
0644
edit
dl
rm
opcode.pyc
6145
0644
edit
dl
rm
opcode.pyo
6145
0644
edit
dl
rm
optparse.py
61203
0644
edit
dl
rm
optparse.pyc
53894
0644
edit
dl
rm
optparse.pyo
53811
0644
edit
dl
rm
os.py
25910
0644
edit
dl
rm
os.pyc
25689
0644
edit
dl
rm
os.pyo
25689
0644
edit
dl
rm
os2emxpath.py
4635
0644
edit
dl
rm
os2emxpath.pyc
4525
0644
edit
dl
rm
os2emxpath.pyo
4525
0644
edit
dl
rm
pdb.doc
7914
0644
edit
dl
rm
pdb.py
46098
0755
edit
dl
rm
pdb.pyc
43669
0644
edit
dl
rm
pdb.pyo
43669
0644
edit
dl
rm
pickle.py
45489
0644
edit
dl
rm
pickle.pyc
38560
0644
edit
dl
rm
pickle.pyo
38364
0644
edit
dl
rm
pickletools.py
74523
0644
edit
dl
rm
pickletools.pyc
57032
0644
edit
dl
rm
pickletools.pyo
56171
0644
edit
dl
rm
pipes.py
9582
0644
edit
dl
rm
pipes.pyc
9308
0644
edit
dl
rm
pipes.pyo
9308
0644
edit
dl
rm
pkgutil.py
20243
0644
edit
dl
rm
pkgutil.pyc
18959
0644
edit
dl
rm
pkgutil.pyo
18959
0644
edit
dl
rm
platform.py
52801
0755
edit
dl
rm
platform.pyc
37971
0644
edit
dl
rm
platform.pyo
37971
0644
edit
dl
rm
plistlib.py
15810
0644
edit
dl
rm
plistlib.pyc
19963
0644
edit
dl
rm
plistlib.pyo
19877
0644
edit
dl
rm
popen2.py
8416
0644
edit
dl
rm
popen2.pyc
9025
0644
edit
dl
rm
popen2.pyo
8983
0644
edit
dl
rm
poplib.py
12824
0644
edit
dl
rm
poplib.pyc
13345
0644
edit
dl
rm
poplib.pyo
13345
0644
edit
dl
rm
posixfile.py
8003
0644
edit
dl
rm
posixfile.pyc
7652
0644
edit
dl
rm
posixfile.pyo
7652
0644
edit
dl
rm
posixpath.py
14293
0644
edit
dl
rm
posixpath.pyc
11462
0644
edit
dl
rm
posixpath.pyo
11462
0644
edit
dl
rm
pprint.py
11777
0644
edit
dl
rm
pprint.pyc
10194
0644
edit
dl
rm
pprint.pyo
10017
0644
edit
dl
rm
profile.py
22781
0755
edit
dl
rm
profile.pyc
16456
0644
edit
dl
rm
profile.pyo
16209
0644
edit
dl
rm
pstats.py
26712
0644
edit
dl
rm
pstats.pyc
25013
0644
edit
dl
rm
pstats.pyo
25013
0644
edit
dl
rm
pty.py
5058
0644
edit
dl
rm
pty.pyc
4966
0644
edit
dl
rm
pty.pyo
4966
0644
edit
dl
rm
pyclbr.py
13388
0644
edit
dl
rm
pyclbr.pyc
9651
0644
edit
dl
rm
pyclbr.pyo
9651
0644
edit
dl
rm
pydoc.py
95739
0755
edit
dl
rm
pydoc.pyc
92342
0644
edit
dl
rm
pydoc.pyo
92278
0644
edit
dl
rm
py_compile.py
5936
0644
edit
dl
rm
py_compile.pyc
6428
0644
edit
dl
rm
py_compile.pyo
6428
0644
edit
dl
rm
Queue.py
8577
0644
edit
dl
rm
Queue.pyc
9424
0644
edit
dl
rm
Queue.pyo
9424
0644
edit
dl
rm
quopri.py
6968
0755
edit
dl
rm
quopri.pyc
6574
0644
edit
dl
rm
quopri.pyo
6574
0644
edit
dl
rm
random.py
32457
0644
edit
dl
rm
random.pyc
25704
0644
edit
dl
rm
random.pyo
25704
0644
edit
dl
rm
re.py
13423
0644
edit
dl
rm
re.pyc
13413
0644
edit
dl
rm
re.pyo
13413
0644
edit
dl
rm
repr.py
4296
0644
edit
dl
rm
repr.pyc
5385
0644
edit
dl
rm
repr.pyo
5385
0644
edit
dl
rm
rexec.py
20148
0644
edit
dl
rm
rexec.pyc
23807
0644
edit
dl
rm
rexec.pyo
23807
0644
edit
dl
rm
rfc822.py
33542
0644
edit
dl
rm
rfc822.pyc
31813
0644
edit
dl
rm
rfc822.pyo
31813
0644
edit
dl
rm
rlcompleter.py
5991
0644
edit
dl
rm
rlcompleter.pyc
6078
0644
edit
dl
rm
rlcompleter.pyo
6078
0644
edit
dl
rm
robotparser.py
7695
0644
edit
dl
rm
robotparser.pyc
8003
0644
edit
dl
rm
robotparser.pyo
8003
0644
edit
dl
rm
runpy.py
11081
0644
edit
dl
rm
runpy.pyc
8803
0644
edit
dl
rm
runpy.pyo
8803
0644
edit
dl
rm
sched.py
5088
0644
edit
dl
rm
sched.pyc
4994
0644
edit
dl
rm
sched.pyo
4994
0644
edit
dl
rm
sets.py
19050
0644
edit
dl
rm
sets.pyc
16895
0644
edit
dl
rm
sets.pyo
16895
0644
edit
dl
rm
sgmllib.py
17884
0644
edit
dl
rm
sgmllib.pyc
15436
0644
edit
dl
rm
sgmllib.pyo
15436
0644
edit
dl
rm
sha.py
393
0644
edit
dl
rm
sha.pyc
421
0644
edit
dl
rm
sha.pyo
421
0644
edit
dl
rm
shelve.py
8178
0644
edit
dl
rm
shelve.pyc
10256
0644
edit
dl
rm
shelve.pyo
10256
0644
edit
dl
rm
shlex.py
11164
0644
edit
dl
rm
shlex.pyc
7558
0644
edit
dl
rm
shlex.pyo
7558
0644
edit
dl
rm
shutil.py
19871
0644
edit
dl
rm
shutil.pyc
19259
0644
edit
dl
rm
shutil.pyo
19259
0644
edit
dl
rm
SimpleHTTPServer.py
7997
0644
edit
dl
rm
SimpleHTTPServer.pyc
8010
0644
edit
dl
rm
SimpleHTTPServer.pyo
8010
0644
edit
dl
rm
SimpleXMLRPCServer.py
25812
0644
edit
dl
rm
SimpleXMLRPCServer.pyc
22863
0644
edit
dl
rm
SimpleXMLRPCServer.pyo
22863
0644
edit
dl
rm
site.py
21296
0644
edit
dl
rm
site.pyc
20786
0644
edit
dl
rm
site.pyo
20786
0644
edit
dl
rm
smtpd.py
18542
0755
edit
dl
rm
smtpd.pyc
15883
0644
edit
dl
rm
smtpd.pyo
15883
0644
edit
dl
rm
smtplib.py
32134
0755
edit
dl
rm
smtplib.pyc
30304
0644
edit
dl
rm
smtplib.pyo
30304
0644
edit
dl
rm
sndhdr.py
5973
0644
edit
dl
rm
sndhdr.pyc
7361
0644
edit
dl
rm
sndhdr.pyo
7361
0644
edit
dl
rm
socket.py
20615
0644
edit
dl
rm
socket.pyc
16152
0644
edit
dl
rm
socket.pyo
16066
0644
edit
dl
rm
SocketServer.py
23948
0644
edit
dl
rm
SocketServer.pyc
24087
0644
edit
dl
rm
SocketServer.pyo
24087
0644
edit
dl
rm
sre.py
384
0644
edit
dl
rm
sre.pyc
519
0644
edit
dl
rm
sre.pyo
519
0644
edit
dl
rm
sre_compile.py
19823
0644
edit
dl
rm
sre_compile.pyc
12560
0644
edit
dl
rm
sre_compile.pyo
12404
0644
edit
dl
rm
sre_constants.py
7197
0644
edit
dl
rm
sre_constants.pyc
6195
0644
edit
dl
rm
sre_constants.pyo
6195
0644
edit
dl
rm
sre_parse.py
30700
0644
edit
dl
rm
sre_parse.pyc
21156
0644
edit
dl
rm
sre_parse.pyo
21156
0644
edit
dl
rm
ssl.py
39310
0644
edit
dl
rm
ssl.pyc
32716
0644
edit
dl
rm
ssl.pyo
32716
0644
edit
dl
rm
stat.py
1842
0644
edit
dl
rm
stat.pyc
2751
0644
edit
dl
rm
stat.pyo
2751
0644
edit
dl
rm
statvfs.py
898
0644
edit
dl
rm
statvfs.pyc
620
0644
edit
dl
rm
statvfs.pyo
620
0644
edit
dl
rm
string.py
21548
0644
edit
dl
rm
string.pyc
20459
0644
edit
dl
rm
string.pyo
20459
0644
edit
dl
rm
StringIO.py
10662
0644
edit
dl
rm
StringIO.pyc
11480
0644
edit
dl
rm
StringIO.pyo
11480
0644
edit
dl
rm
stringold.py
12449
0644
edit
dl
rm
stringold.pyc
12549
0644
edit
dl
rm
stringold.pyo
12549
0644
edit
dl
rm
stringprep.py
13522
0644
edit
dl
rm
stringprep.pyc
14487
0644
edit
dl
rm
stringprep.pyo
14415
0644
edit
dl
rm
struct.py
82
0644
edit
dl
rm
struct.pyc
239
0644
edit
dl
rm
struct.pyo
239
0644
edit
dl
rm
subprocess.py
50520
0644
edit
dl
rm
subprocess.pyc
32398
0644
edit
dl
rm
subprocess.pyo
32398
0644
edit
dl
rm
sunau.py
17222
0644
edit
dl
rm
sunau.pyc
18394
0644
edit
dl
rm
sunau.pyo
18394
0644
edit
dl
rm
sunaudio.py
1399
0644
edit
dl
rm
sunaudio.pyc
1987
0644
edit
dl
rm
sunaudio.pyo
1987
0644
edit
dl
rm
symbol.py
2057
0755
edit
dl
rm
symbol.pyc
3026
0644
edit
dl
rm
symbol.pyo
3026
0644
edit
dl
rm
symtable.py
7437
0644
edit
dl
rm
symtable.pyc
11786
0644
edit
dl
rm
symtable.pyo
11655
0644
edit
dl
rm
sysconfig.py
22852
0644
edit
dl
rm
sysconfig.pyc
17818
0644
edit
dl
rm
sysconfig.pyo
17818
0644
edit
dl
rm
tabnanny.py
11339
0755
edit
dl
rm
tabnanny.pyc
8247
0644
edit
dl
rm
tabnanny.pyo
8247
0644
edit
dl
rm
tarfile.py
90655
0644
edit
dl
rm
tarfile.pyc
76193
0644
edit
dl
rm
tarfile.pyo
76193
0644
edit
dl
rm
telnetlib.py
27036
0644
edit
dl
rm
telnetlib.pyc
23154
0644
edit
dl
rm
telnetlib.pyo
23154
0644
edit
dl
rm
tempfile.py
19547
0644
edit
dl
rm
tempfile.pyc
20344
0644
edit
dl
rm
tempfile.pyo
20344
0644
edit
dl
rm
textwrap.py
17280
0644
edit
dl
rm
textwrap.pyc
12097
0644
edit
dl
rm
textwrap.pyo
12005
0644
edit
dl
rm
this.py
1002
0644
edit
dl
rm
this.pyc
1220
0644
edit
dl
rm
this.pyo
1220
0644
edit
dl
rm
threading.py
47377
0644
edit
dl
rm
threading.pyc
42726
0644
edit
dl
rm
threading.pyo
40552
0644
edit
dl
rm
timeit.py
12791
0755
edit
dl
rm
timeit.pyc
12183
0644
edit
dl
rm
timeit.pyo
12183
0644
edit
dl
rm
toaiff.py
3142
0644
edit
dl
rm
toaiff.pyc
3106
0644
edit
dl
rm
toaiff.pyo
3106
0644
edit
dl
rm
token.py
2922
0644
edit
dl
rm
token.pyc
3816
0644
edit
dl
rm
token.pyo
3816
0644
edit
dl
rm
tokenize.py
17483
0644
edit
dl
rm
tokenize.pyc
14505
0644
edit
dl
rm
tokenize.pyo
14449
0644
edit
dl
rm
trace.py
29891
0755
edit
dl
rm
trace.pyc
22793
0644
edit
dl
rm
trace.pyo
22730
0644
edit
dl
rm
traceback.py
11285
0644
edit
dl
rm
traceback.pyc
11679
0644
edit
dl
rm
traceback.pyo
11679
0644
edit
dl
rm
tty.py
879
0644
edit
dl
rm
tty.pyc
1317
0644
edit
dl
rm
tty.pyo
1317
0644
edit
dl
rm
types.py
2094
0644
edit
dl
rm
types.pyc
2725
0644
edit
dl
rm
types.pyo
2725
0644
edit
dl
rm
urllib.py
60228
0644
edit
dl
rm
urllib.pyc
51241
0644
edit
dl
rm
urllib.pyo
51146
0644
edit
dl
rm
urllib2.py
52541
0644
edit
dl
rm
urllib2.pyc
47302
0644
edit
dl
rm
urllib2.pyo
47207
0644
edit
dl
rm
urlparse.py
20461
0644
edit
dl
rm
urlparse.pyc
18015
0644
edit
dl
rm
urlparse.pyo
18015
0644
edit
dl
rm
user.py
1627
0644
edit
dl
rm
user.pyc
1724
0644
edit
dl
rm
user.pyo
1724
0644
edit
dl
rm
UserDict.py
7060
0644
edit
dl
rm
UserDict.pyc
9711
0644
edit
dl
rm
UserDict.pyo
9711
0644
edit
dl
rm
UserList.py
3644
0644
edit
dl
rm
UserList.pyc
6577
0644
edit
dl
rm
UserList.pyo
6577
0644
edit
dl
rm
UserString.py
9687
0755
edit
dl
rm
UserString.pyc
14864
0644
edit
dl
rm
UserString.pyo
14864
0644
edit
dl
rm
uu.py
6697
0755
edit
dl
rm
uu.pyc
4390
0644
edit
dl
rm
uu.pyo
4390
0644
edit
dl
rm
uuid.py
23530
0644
edit
dl
rm
uuid.pyc
23366
0644
edit
dl
rm
uuid.pyo
23250
0644
edit
dl
rm
warnings.py
14823
0644
edit
dl
rm
warnings.pyc
13510
0644
edit
dl
rm
warnings.pyo
12721
0644
edit
dl
rm
wave.py
18582
0644
edit
dl
rm
wave.pyc
20013
0644
edit
dl
rm
wave.pyo
19869
0644
edit
dl
rm
weakref.py
14830
0644
edit
dl
rm
weakref.pyc
16441
0644
edit
dl
rm
weakref.pyo
16441
0644
edit
dl
rm
webbrowser.py
22725
0755
edit
dl
rm
webbrowser.pyc
19750
0644
edit
dl
rm
webbrowser.pyo
19705
0644
edit
dl
rm
whichdb.py
3379
0644
edit
dl
rm
whichdb.pyc
2241
0644
edit
dl
rm
whichdb.pyo
2241
0644
edit
dl
rm
wsgiref.egg-info
187
0644
edit
dl
rm
xdrlib.py
6069
0644
edit
dl
rm
xdrlib.pyc
9902
0644
edit
dl
rm
xdrlib.pyo
9902
0644
edit
dl
rm
xmllib.py
34865
0644
edit
dl
rm
xmllib.pyc
26848
0644
edit
dl
rm
xmllib.pyo
26848
0644
edit
dl
rm
xmlrpclib.py
52136
0644
edit
dl
rm
xmlrpclib.pyc
44106
0644
edit
dl
rm
xmlrpclib.pyo
43922
0644
edit
dl
rm
zipfile.py
59477
0644
edit
dl
rm
zipfile.pyc
42137
0644
edit
dl
rm
zipfile.pyo
42137
0644
edit
dl
rm
_abcoll.py
18619
0644
edit
dl
rm
_abcoll.pyc
25682
0644
edit
dl
rm
_abcoll.pyo
25682
0644
edit
dl
rm
_LWPCookieJar.py
6553
0644
edit
dl
rm
_LWPCookieJar.pyc
5434
0644
edit
dl
rm
_LWPCookieJar.pyo
5434
0644
edit
dl
rm
_MozillaCookieJar.py
5797
0644
edit
dl
rm
_MozillaCookieJar.pyc
4461
0644
edit
dl
rm
_MozillaCookieJar.pyo
4422
0644
edit
dl
rm
_osx_support.py
19100
0644
edit
dl
rm
_osx_support.pyc
11758
0644
edit
dl
rm
_osx_support.pyo
11758
0644
edit
dl
rm
_pyio.py
69630
0644
edit
dl
rm
_pyio.pyc
64701
0644
edit
dl
rm
_pyio.pyo
64701
0644
edit
dl
rm
_strptime.py
20728
0644
edit
dl
rm
_strptime.pyc
15172
0644
edit
dl
rm
_strptime.pyo
15172
0644
edit
dl
rm
_sysconfigdata.py
19732
0644
edit
dl
rm
_sysconfigdata.pyc
22968
0644
edit
dl
rm
_sysconfigdata.pyo
22968
0644
edit
dl
rm
_threading_local.py
7260
0644
edit
dl
rm
_threading_local.pyc
6373
0644
edit
dl
rm
_threading_local.pyo
6373
0644
edit
dl
rm
_weakrefset.py
5911
0644
edit
dl
rm
_weakrefset.pyc
9678
0644
edit
dl
rm
_weakrefset.pyo
9678
0644
edit
dl
rm
__future__.py
4380
0644
edit
dl
rm
__future__.pyc
4223
0644
edit
dl
rm
__future__.pyo
4223
0644
edit
dl
rm
__phello__.foo.py
64
0644
edit
dl
rm
__phello__.foo.pyc
125
0644
edit
dl
rm
__phello__.foo.pyo
125
0644
edit
dl
rm
Edit:
/usr/lib64/python2.7/cgi.py
(36308B)
#! /usr/bin/python2.7 # NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is # intentionally NOT "/usr/bin/env python". On many systems # (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI # scripts, and /usr/local/bin is the default directory where Python is # installed, so /usr/bin/env would be unable to find python. Granted, # binary installations by Linux vendors often install Python in # /usr/bin. So let those vendors patch cgi.py to match their choice # of installation. """Support module for CGI (Common Gateway Interface) scripts. This module defines a number of utilities for use by CGI scripts written in Python. """ # XXX Perhaps there should be a slimmed version that doesn't contain # all those backwards compatible and debugging classes and functions? # History # ------- # # Michael McLay started this module. Steve Majewski changed the # interface to SvFormContentDict and FormContentDict. The multipart # parsing was inspired by code submitted by Andreas Paepcke. Guido van # Rossum rewrote, reformatted and documented the module and is currently # responsible for its maintenance. # __version__ = "2.6" # Imports # ======= from operator import attrgetter import sys import os import UserDict import urlparse from warnings import filterwarnings, catch_warnings, warn with catch_warnings(): if sys.py3kwarning: filterwarnings("ignore", ".*mimetools has been removed", DeprecationWarning) filterwarnings("ignore", ".*rfc822 has been removed", DeprecationWarning) import mimetools import rfc822 try: from cStringIO import StringIO except ImportError: from StringIO import StringIO __all__ = ["MiniFieldStorage", "FieldStorage", "FormContentDict", "SvFormContentDict", "InterpFormContentDict", "FormContent", "parse", "parse_qs", "parse_qsl", "parse_multipart", "parse_header", "print_exception", "print_environ", "print_form", "print_directory", "print_arguments", "print_environ_usage", "escape"] # Logging support # =============== logfile = "" # Filename to log to, if not empty logfp = None # File object to log to, if not None def initlog(*allargs): """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). """ global logfp, log if logfile and not logfp: try: logfp = open(logfile, "a") except IOError: pass if not logfp: log = nolog else: log = dolog log(*allargs) def dolog(fmt, *args): """Write a log message to the log file. See initlog() for docs.""" logfp.write(fmt%args + "\n") def nolog(*allargs): """Dummy function, assigned to log when logging is disabled.""" pass log = initlog # The current logging function # Parsing functions # ================= # Maximum input we will accept when REQUEST_METHOD is POST # 0 ==> unlimited input maxlen = 0 def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0, separator=None): """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. separator: str. The symbol to use for separating the query arguments. """ if fp is None: fp = sys.stdin if not 'REQUEST_METHOD' in environ: environ['REQUEST_METHOD'] = 'GET' # For testing stand-alone if environ['REQUEST_METHOD'] == 'POST': ctype, pdict = parse_header(environ['CONTENT_TYPE']) if ctype == 'multipart/form-data': return parse_multipart(fp, pdict) elif ctype == 'application/x-www-form-urlencoded': clength = int(environ['CONTENT_LENGTH']) if maxlen and clength > maxlen: raise ValueError, 'Maximum content length exceeded' qs = fp.read(clength) else: qs = '' # Unknown content-type if 'QUERY_STRING' in environ: if qs: qs = qs + '&' qs = qs + environ['QUERY_STRING'] elif sys.argv[1:]: if qs: qs = qs + '&' qs = qs + sys.argv[1] environ['QUERY_STRING'] = qs # XXX Shouldn't, really elif 'QUERY_STRING' in environ: qs = environ['QUERY_STRING'] else: if sys.argv[1:]: qs = sys.argv[1] else: qs = "" environ['QUERY_STRING'] = qs # XXX Shouldn't, really return urlparse.parse_qs(qs, keep_blank_values, strict_parsing, separator=separator) # parse query string function called from urlparse, # this is done in order to maintain backward compatibility. def parse_qs(qs, keep_blank_values=0, strict_parsing=0, separator=None): """Parse a query given as a string argument.""" warn("cgi.parse_qs is deprecated, use urlparse.parse_qs instead", PendingDeprecationWarning, 2) return urlparse.parse_qs(qs, keep_blank_values, strict_parsing, separator=separator) def parse_qsl(qs, keep_blank_values=0, strict_parsing=0, max_num_fields=None, separator=None): """Parse a query given as a string argument.""" warn("cgi.parse_qsl is deprecated, use urlparse.parse_qsl instead", PendingDeprecationWarning, 2) return urlparse.parse_qsl(qs, keep_blank_values, strict_parsing, max_num_fields, separator=separator) def parse_multipart(fp, pdict): """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(). """ boundary = "" if 'boundary' in pdict: boundary = pdict['boundary'] if not valid_boundary(boundary): raise ValueError, ('Invalid boundary in multipart form: %r' % (boundary,)) nextpart = "--" + boundary lastpart = "--" + boundary + "--" partdict = {} terminator = "" while terminator != lastpart: bytes = -1 data = None if terminator: # At start of next part. Read headers first. headers = mimetools.Message(fp) clength = headers.getheader('content-length') if clength: try: bytes = int(clength) except ValueError: pass if bytes > 0: if maxlen and bytes > maxlen: raise ValueError, 'Maximum content length exceeded' data = fp.read(bytes) else: data = "" # Read lines until end of part. lines = [] while 1: line = fp.readline() if not line: terminator = lastpart # End outer loop break if line[:2] == "--": terminator = line.strip() if terminator in (nextpart, lastpart): break lines.append(line) # Done with part. if data is None: continue if bytes < 0: if lines: # Strip final line terminator line = lines[-1] if line[-2:] == "\r\n": line = line[:-2] elif line[-1:] == "\n": line = line[:-1] lines[-1] = line data = "".join(lines) line = headers['content-disposition'] if not line: continue key, params = parse_header(line) if key != 'form-data': continue if 'name' in params: name = params['name'] else: continue if name in partdict: partdict[name].append(data) else: partdict[name] = [data] return partdict def _parseparam(s): while s[:1] == ';': s = s[1:] end = s.find(';') while end > 0 and (s.count('"', 0, end) - s.count('\\"', 0, end)) % 2: end = s.find(';', end + 1) if end < 0: end = len(s) f = s[:end] yield f.strip() s = s[end:] def parse_header(line): """Parse a Content-type like header. Return the main content-type and a dictionary of options. """ parts = _parseparam(';' + line) key = parts.next() pdict = {} for p in parts: i = p.find('=') if i >= 0: name = p[:i].strip().lower() value = p[i+1:].strip() if len(value) >= 2 and value[0] == value[-1] == '"': value = value[1:-1] value = value.replace('\\\\', '\\').replace('\\"', '"') pdict[name] = value return key, pdict # Classes for field storage # ========================= class MiniFieldStorage: """Like FieldStorage, for use when no file uploads are possible.""" # Dummy attributes filename = None list = None type = None file = None type_options = {} disposition = None disposition_options = {} headers = {} def __init__(self, name, value): """Constructor from field name and value.""" self.name = name self.value = value # self.file = StringIO(value) def __repr__(self): """Return printable representation.""" return "MiniFieldStorage(%r, %r)" % (self.name, self.value) class FieldStorage: """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. """ def __init__(self, fp=None, headers=None, outerboundary="", environ=os.environ, keep_blank_values=0, strict_parsing=0, max_num_fields=None, separator=None): """Constructor. 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. max_num_fields: int. If set, then __init__ throws a ValueError if there are more than n fields read by parse_qsl(). """ method = 'GET' self.keep_blank_values = keep_blank_values self.strict_parsing = strict_parsing self.max_num_fields = max_num_fields self.separator = separator if 'REQUEST_METHOD' in environ: method = environ['REQUEST_METHOD'].upper() self.qs_on_post = None if method == 'GET' or method == 'HEAD': if 'QUERY_STRING' in environ: qs = environ['QUERY_STRING'] elif sys.argv[1:]: qs = sys.argv[1] else: qs = "" fp = StringIO(qs) if headers is None: headers = {'content-type': "application/x-www-form-urlencoded"} if headers is None: headers = {} if method == 'POST': # Set default content-type for POST to what's traditional headers['content-type'] = "application/x-www-form-urlencoded" if 'CONTENT_TYPE' in environ: headers['content-type'] = environ['CONTENT_TYPE'] if 'QUERY_STRING' in environ: self.qs_on_post = environ['QUERY_STRING'] if 'CONTENT_LENGTH' in environ: headers['content-length'] = environ['CONTENT_LENGTH'] self.fp = fp or sys.stdin self.headers = headers self.outerboundary = outerboundary # Process content-disposition header cdisp, pdict = "", {} if 'content-disposition' in self.headers: cdisp, pdict = parse_header(self.headers['content-disposition']) self.disposition = cdisp self.disposition_options = pdict self.name = None if 'name' in pdict: self.name = pdict['name'] self.filename = None if 'filename' in pdict: self.filename = pdict['filename'] # Process content-type header # # Honor any existing content-type header. But if there is no # content-type header, use some sensible defaults. Assume # outerboundary is "" at the outer level, but something non-false # inside a multi-part. The default for an inner part is text/plain, # but for an outer part it should be urlencoded. This should catch # bogus clients which erroneously forget to include a content-type # header. # # See below for what we do if there does exist a content-type header, # but it happens to be something we don't understand. if 'content-type' in self.headers: ctype, pdict = parse_header(self.headers['content-type']) elif self.outerboundary or method != 'POST': ctype, pdict = "text/plain", {} else: ctype, pdict = 'application/x-www-form-urlencoded', {} self.type = ctype self.type_options = pdict self.innerboundary = "" if 'boundary' in pdict: self.innerboundary = pdict['boundary'] clen = -1 if 'content-length' in self.headers: try: clen = int(self.headers['content-length']) except ValueError: pass if maxlen and clen > maxlen: raise ValueError, 'Maximum content length exceeded' self.length = clen self.list = self.file = None self.done = 0 if ctype == 'application/x-www-form-urlencoded': self.read_urlencoded() elif ctype[:10] == 'multipart/': self.read_multi(environ, keep_blank_values, strict_parsing) else: self.read_single() def __repr__(self): """Return a printable representation.""" return "FieldStorage(%r, %r, %r)" % ( self.name, self.filename, self.value) def __iter__(self): return iter(self.keys()) def __getattr__(self, name): if name != 'value': raise AttributeError, name if self.file: self.file.seek(0) value = self.file.read() self.file.seek(0) elif self.list is not None: value = self.list else: value = None return value def __getitem__(self, key): """Dictionary style indexing.""" if self.list is None: raise TypeError, "not indexable" found = [] for item in self.list: if item.name == key: found.append(item) if not found: raise KeyError, key if len(found) == 1: return found[0] else: return found def getvalue(self, key, default=None): """Dictionary style get() method, including 'value' lookup.""" if key in self: value = self[key] if type(value) is type([]): return map(attrgetter('value'), value) else: return value.value else: return default def getfirst(self, key, default=None): """ Return the first value received.""" if key in self: value = self[key] if type(value) is type([]): return value[0].value else: return value.value else: return default def getlist(self, key): """ Return list of received values.""" if key in self: value = self[key] if type(value) is type([]): return map(attrgetter('value'), value) else: return [value.value] else: return [] def keys(self): """Dictionary style keys() method.""" if self.list is None: raise TypeError, "not indexable" return list(set(item.name for item in self.list)) def has_key(self, key): """Dictionary style has_key() method.""" if self.list is None: raise TypeError, "not indexable" return any(item.name == key for item in self.list) def __contains__(self, key): """Dictionary style __contains__ method.""" if self.list is None: raise TypeError, "not indexable" return any(item.name == key for item in self.list) def __len__(self): """Dictionary style len(x) support.""" return len(self.keys()) def __nonzero__(self): return bool(self.list) def read_urlencoded(self): """Internal: read data in query string format.""" qs = self.fp.read(self.length) if self.qs_on_post: qs += '&' + self.qs_on_post query = urlparse.parse_qsl(qs, self.keep_blank_values, self.strict_parsing, self.max_num_fields, self.separator) self.list = [MiniFieldStorage(key, value) for key, value in query] self.skip_lines() FieldStorageClass = None def read_multi(self, environ, keep_blank_values, strict_parsing): """Internal: read a part that is itself multipart.""" ib = self.innerboundary if not valid_boundary(ib): raise ValueError, 'Invalid boundary in multipart form: %r' % (ib,) self.list = [] if self.qs_on_post: query = urlparse.parse_qsl(self.qs_on_post, self.keep_blank_values, self.strict_parsing, self.max_num_fields, self.separator) self.list.extend(MiniFieldStorage(key, value) for key, value in query) FieldStorageClass = None # Propagate max_num_fields into the sub class appropriately max_num_fields = self.max_num_fields if max_num_fields is not None: max_num_fields -= len(self.list) klass = self.FieldStorageClass or self.__class__ part = klass(self.fp, {}, ib, environ, keep_blank_values, strict_parsing, max_num_fields) # Throw first part away while not part.done: headers = rfc822.Message(self.fp) part = klass(self.fp, headers, ib, environ, keep_blank_values, strict_parsing, max_num_fields, separator=self.separator) if max_num_fields is not None: max_num_fields -= 1 if part.list: max_num_fields -= len(part.list) if max_num_fields < 0: raise ValueError('Max number of fields exceeded') self.list.append(part) self.skip_lines() def read_single(self): """Internal: read an atomic part.""" if self.length >= 0: self.read_binary() self.skip_lines() else: self.read_lines() self.file.seek(0) bufsize = 8*1024 # I/O buffering size for copy to file def read_binary(self): """Internal: read binary data.""" self.file = self.make_file('b') todo = self.length if todo >= 0: while todo > 0: data = self.fp.read(min(todo, self.bufsize)) if not data: self.done = -1 break self.file.write(data) todo = todo - len(data) def read_lines(self): """Internal: read lines until EOF or outerboundary.""" self.file = self.__file = StringIO() if self.outerboundary: self.read_lines_to_outerboundary() else: self.read_lines_to_eof() def __write(self, line): if self.__file is not None: if self.__file.tell() + len(line) > 1000: self.file = self.make_file('') self.file.write(self.__file.getvalue()) self.__file = None self.file.write(line) def read_lines_to_eof(self): """Internal: read lines until EOF.""" while 1: line = self.fp.readline(1<<16) if not line: self.done = -1 break self.__write(line) def read_lines_to_outerboundary(self): """Internal: read lines until outerboundary.""" next = "--" + self.outerboundary last = next + "--" delim = "" last_line_lfend = True while 1: line = self.fp.readline(1<<16) if not line: self.done = -1 break if delim == "\r": line = delim + line delim = "" if line[:2] == "--" and last_line_lfend: strippedline = line.strip() if strippedline == next: break if strippedline == last: self.done = 1 break odelim = delim if line[-2:] == "\r\n": delim = "\r\n" line = line[:-2] last_line_lfend = True elif line[-1] == "\n": delim = "\n" line = line[:-1] last_line_lfend = True elif line[-1] == "\r": # We may interrupt \r\n sequences if they span the 2**16 # byte boundary delim = "\r" line = line[:-1] last_line_lfend = False else: delim = "" last_line_lfend = False self.__write(odelim + line) def skip_lines(self): """Internal: skip lines until outer boundary if defined.""" if not self.outerboundary or self.done: return next = "--" + self.outerboundary last = next + "--" last_line_lfend = True while 1: line = self.fp.readline(1<<16) if not line: self.done = -1 break if line[:2] == "--" and last_line_lfend: strippedline = line.strip() if strippedline == next: break if strippedline == last: self.done = 1 break last_line_lfend = line.endswith('\n') def make_file(self, binary=None): """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. """ import tempfile return tempfile.TemporaryFile("w+b") # Backwards Compatibility Classes # =============================== class FormContentDict(UserDict.UserDict): """Form 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, ...], ...} """ def __init__(self, environ=os.environ, keep_blank_values=0, strict_parsing=0, separator=None): self.dict = self.data = parse(environ=environ, keep_blank_values=keep_blank_values, strict_parsing=strict_parsing, separator=separator) self.query_string = environ['QUERY_STRING'] class SvFormContentDict(FormContentDict): """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. """ def __getitem__(self, key): if len(self.dict[key]) > 1: raise IndexError, 'expecting a single value' return self.dict[key][0] def getlist(self, key): return self.dict[key] def values(self): result = [] for value in self.dict.values(): if len(value) == 1: result.append(value[0]) else: result.append(value) return result def items(self): result = [] for key, value in self.dict.items(): if len(value) == 1: result.append((key, value[0])) else: result.append((key, value)) return result class InterpFormContentDict(SvFormContentDict): """This class is present for backwards compatibility only.""" def __getitem__(self, key): v = SvFormContentDict.__getitem__(self, key) if v[0] in '0123456789+-.': try: return int(v) except ValueError: try: return float(v) except ValueError: pass return v.strip() def values(self): result = [] for key in self.keys(): try: result.append(self[key]) except IndexError: result.append(self.dict[key]) return result def items(self): result = [] for key in self.keys(): try: result.append((key, self[key])) except IndexError: result.append((key, self.dict[key])) return result class FormContent(FormContentDict): """This class is present for backwards compatibility only.""" def values(self, key): if key in self.dict :return self.dict[key] else: return None def indexed_value(self, key, location): if key in self.dict: if len(self.dict[key]) > location: return self.dict[key][location] else: return None else: return None def value(self, key): if key in self.dict: return self.dict[key][0] else: return None def length(self, key): return len(self.dict[key]) def stripped(self, key): if key in self.dict: return self.dict[key][0].strip() else: return None def pars(self): return self.dict # Test/debug code # =============== def test(environ=os.environ): """Robust test CGI script, usable as main program. Write minimal HTTP headers and dump all information provided to the script in HTML form. """ print "Content-type: text/html" print sys.stderr = sys.stdout try: form = FieldStorage() # Replace with other classes to test those print_directory() print_arguments() print_form(form) print_environ(environ) print_environ_usage() def f(): exec "testing print_exception() -- <I>italics?</I>" def g(f=f): f() print "<H3>What follows is a test, not an actual exception:</H3>" g() except: print_exception() print "<H1>Second try with a small maxlen...</H1>" global maxlen maxlen = 50 try: form = FieldStorage() # Replace with other classes to test those print_directory() print_arguments() print_form(form) print_environ(environ) except: print_exception() def print_exception(type=None, value=None, tb=None, limit=None): if type is None: type, value, tb = sys.exc_info() import traceback print print "<H3>Traceback (most recent call last):</H3>" list = traceback.format_tb(tb, limit) + \ traceback.format_exception_only(type, value) print "<PRE>%s<B>%s</B></PRE>" % ( escape("".join(list[:-1])), escape(list[-1]), ) del tb def print_environ(environ=os.environ): """Dump the shell environment as HTML.""" keys = environ.keys() keys.sort() print print "<H3>Shell Environment:</H3>" print "<DL>" for key in keys: print "<DT>", escape(key), "<DD>", escape(environ[key]) print "</DL>" print def print_form(form): """Dump the contents of a form as HTML.""" keys = form.keys() keys.sort() print print "<H3>Form Contents:</H3>" if not keys: print "<P>No form fields." print "<DL>" for key in keys: print "<DT>" + escape(key) + ":", value = form[key] print "<i>" + escape(repr(type(value))) + "</i>" print "<DD>" + escape(repr(value)) print "</DL>" print def print_directory(): """Dump the current directory as HTML.""" print print "<H3>Current Working Directory:</H3>" try: pwd = os.getcwd() except os.error, msg: print "os.error:", escape(str(msg)) else: print escape(pwd) print def print_arguments(): print print "<H3>Command Line Arguments:</H3>" print print sys.argv print def print_environ_usage(): """Dump a list of environment variables used by CGI as HTML.""" print """ <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> """ # Utilities # ========= def escape(s, quote=None): '''Replace special characters "&", "<" and ">" to HTML-safe sequences. If the optional flag quote is true, the quotation mark character (") is also translated.''' s = s.replace("&", "&") # Must be done first! s = s.replace("<", "<") s = s.replace(">", ">") if quote: s = s.replace('"', """) return s def valid_boundary(s, _vb_pattern="^[ -~]{0,200}[!-~]$"): import re return re.match(_vb_pattern, s) # Invoke mainline # =============== # Call test() when this file is run as a script (not imported as a module) if __name__ == '__main__': test()
Save
cmd:
run