/
usr
/
lib
/
python2.6
/
/usr/lib/python2.6
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
hotshot/
-
0755
rm
idlelib/
-
0755
rm
json/
-
0755
rm
lib-dynload/
-
0755
rm
lib2to3/
-
0755
rm
logging/
-
0755
rm
multiprocessing/
-
0755
rm
plat-linux2/
-
0755
rm
site-packages/
-
0755
rm
sqlite3/
-
0755
rm
test/
-
0755
rm
wsgiref/
-
0755
rm
xml/
-
0755
rm
abc.py
7034
0644
edit
dl
rm
abc.pyc
6049
0644
edit
dl
rm
abc.pyo
5991
0644
edit
dl
rm
aifc.py
33188
0644
edit
dl
rm
aifc.pyc
29424
0644
edit
dl
rm
aifc.pyo
29424
0644
edit
dl
rm
anydbm.py
2620
0644
edit
dl
rm
anydbm.pyc
2769
0644
edit
dl
rm
anydbm.pyo
2769
0644
edit
dl
rm
ast.py
11347
0644
edit
dl
rm
ast.pyc
12732
0644
edit
dl
rm
ast.pyo
12732
0644
edit
dl
rm
asynchat.py
11402
0644
edit
dl
rm
asynchat.pyc
8677
0644
edit
dl
rm
asynchat.pyo
8677
0644
edit
dl
rm
asyncore.py
20061
0644
edit
dl
rm
asyncore.pyc
18334
0644
edit
dl
rm
asyncore.pyo
18334
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
8483
0644
edit
dl
rm
audiodev.pyo
8483
0644
edit
dl
rm
base64.py
11335
0755
edit
dl
rm
base64.pyc
10967
0644
edit
dl
rm
base64.pyo
10967
0644
edit
dl
rm
BaseHTTPServer.py
21974
0644
edit
dl
rm
BaseHTTPServer.pyc
21535
0644
edit
dl
rm
BaseHTTPServer.pyo
21535
0644
edit
dl
rm
Bastion.py
5744
0644
edit
dl
rm
Bastion.pyc
6637
0644
edit
dl
rm
Bastion.pyo
6637
0644
edit
dl
rm
bdb.py
20597
0644
edit
dl
rm
bdb.pyc
18449
0644
edit
dl
rm
bdb.pyo
18449
0644
edit
dl
rm
binhex.py
14878
0644
edit
dl
rm
binhex.pyc
15773
0644
edit
dl
rm
binhex.pyo
15773
0644
edit
dl
rm
bisect.py
2662
0644
edit
dl
rm
bisect.pyc
3163
0644
edit
dl
rm
bisect.pyo
3163
0644
edit
dl
rm
calendar.py
23110
0644
edit
dl
rm
calendar.pyc
28007
0644
edit
dl
rm
calendar.pyo
28007
0644
edit
dl
rm
cgi.py
34478
0755
edit
dl
rm
cgi.pyc
32680
0644
edit
dl
rm
cgi.pyo
32680
0644
edit
dl
rm
CGIHTTPServer.py
12773
0644
edit
dl
rm
CGIHTTPServer.pyc
10794
0644
edit
dl
rm
CGIHTTPServer.pyo
10794
0644
edit
dl
rm
cgitb.py
12155
0644
edit
dl
rm
cgitb.pyc
12425
0644
edit
dl
rm
cgitb.pyo
12425
0644
edit
dl
rm
chunk.py
5372
0644
edit
dl
rm
chunk.pyc
5623
0644
edit
dl
rm
chunk.pyo
5623
0644
edit
dl
rm
cmd.py
14962
0644
edit
dl
rm
cmd.pyc
13914
0644
edit
dl
rm
cmd.pyo
13914
0644
edit
dl
rm
code.py
10217
0644
edit
dl
rm
code.pyc
10395
0644
edit
dl
rm
code.pyo
10395
0644
edit
dl
rm
codecs.py
35266
0644
edit
dl
rm
codecs.pyc
36533
0644
edit
dl
rm
codecs.pyo
36533
0644
edit
dl
rm
codeop.py
5999
0644
edit
dl
rm
codeop.pyc
6616
0644
edit
dl
rm
codeop.pyo
6616
0644
edit
dl
rm
collections.py
13730
0644
edit
dl
rm
collections.pyc
14392
0644
edit
dl
rm
collections.pyo
14339
0644
edit
dl
rm
colorsys.py
3459
0644
edit
dl
rm
colorsys.pyc
4025
0644
edit
dl
rm
colorsys.pyo
4025
0644
edit
dl
rm
commands.py
2543
0644
edit
dl
rm
commands.pyc
2477
0644
edit
dl
rm
commands.pyo
2477
0644
edit
dl
rm
compileall.py
5285
0644
edit
dl
rm
compileall.pyc
4989
0644
edit
dl
rm
compileall.pyo
4989
0644
edit
dl
rm
ConfigParser.py
25989
0644
edit
dl
rm
ConfigParser.pyc
23755
0644
edit
dl
rm
ConfigParser.pyo
23755
0644
edit
dl
rm
contextlib.py
4136
0644
edit
dl
rm
contextlib.pyc
4127
0644
edit
dl
rm
contextlib.pyo
4127
0644
edit
dl
rm
Cookie.py
25054
0644
edit
dl
rm
Cookie.pyc
22067
0644
edit
dl
rm
Cookie.pyo
22067
0644
edit
dl
rm
cookielib.py
64726
0644
edit
dl
rm
cookielib.pyc
55176
0644
edit
dl
rm
cookielib.pyo
54985
0644
edit
dl
rm
copy.py
11177
0644
edit
dl
rm
copy.pyc
11629
0644
edit
dl
rm
copy.pyo
11533
0644
edit
dl
rm
copy_reg.py
6800
0644
edit
dl
rm
copy_reg.pyc
5156
0644
edit
dl
rm
copy_reg.pyo
5110
0644
edit
dl
rm
cProfile.py
6337
0755
edit
dl
rm
cProfile.pyc
6211
0644
edit
dl
rm
cProfile.pyo
6211
0644
edit
dl
rm
crypt.py
2229
0644
edit
dl
rm
crypt.pyc
3043
0644
edit
dl
rm
crypt.pyo
3043
0644
edit
dl
rm
csv.py
15730
0644
edit
dl
rm
csv.pyc
13170
0644
edit
dl
rm
csv.pyo
13170
0644
edit
dl
rm
dbhash.py
535
0644
edit
dl
rm
dbhash.pyc
756
0644
edit
dl
rm
dbhash.pyo
756
0644
edit
dl
rm
decimal.py
199273
0644
edit
dl
rm
decimal.pyc
155185
0644
edit
dl
rm
decimal.pyo
155119
0644
edit
dl
rm
difflib.py
81080
0644
edit
dl
rm
difflib.pyc
61093
0644
edit
dl
rm
difflib.pyo
61039
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
6449
0644
edit
dl
rm
dis.pyc
6350
0644
edit
dl
rm
dis.pyo
6350
0644
edit
dl
rm
doctest.py
101516
0644
edit
dl
rm
doctest.pyc
80782
0644
edit
dl
rm
doctest.pyo
80494
0644
edit
dl
rm
DocXMLRPCServer.py
10599
0644
edit
dl
rm
DocXMLRPCServer.pyc
9921
0644
edit
dl
rm
DocXMLRPCServer.pyo
9813
0644
edit
dl
rm
dumbdbm.py
8820
0644
edit
dl
rm
dumbdbm.pyc
6547
0644
edit
dl
rm
dumbdbm.pyo
6547
0644
edit
dl
rm
dummy_thread.py
4418
0644
edit
dl
rm
dummy_thread.pyc
5383
0644
edit
dl
rm
dummy_thread.pyo
5383
0644
edit
dl
rm
dummy_threading.py
2804
0644
edit
dl
rm
dummy_threading.pyc
1295
0644
edit
dl
rm
dummy_threading.pyo
1295
0644
edit
dl
rm
filecmp.py
9470
0644
edit
dl
rm
filecmp.pyc
9592
0644
edit
dl
rm
filecmp.pyo
9592
0644
edit
dl
rm
fileinput.py
14143
0644
edit
dl
rm
fileinput.pyc
14870
0644
edit
dl
rm
fileinput.pyo
14870
0644
edit
dl
rm
fnmatch.py
3239
0644
edit
dl
rm
fnmatch.pyc
3567
0644
edit
dl
rm
fnmatch.pyo
3567
0644
edit
dl
rm
formatter.py
14911
0644
edit
dl
rm
formatter.pyc
19149
0644
edit
dl
rm
formatter.pyo
19149
0644
edit
dl
rm
fpformat.py
4699
0644
edit
dl
rm
fpformat.pyc
4719
0644
edit
dl
rm
fpformat.pyo
4719
0644
edit
dl
rm
fractions.py
20073
0644
edit
dl
rm
fractions.pyc
18041
0644
edit
dl
rm
fractions.pyo
18041
0644
edit
dl
rm
ftplib.py
29197
0644
edit
dl
rm
ftplib.pyc
28387
0644
edit
dl
rm
ftplib.pyo
28387
0644
edit
dl
rm
functools.py
2162
0644
edit
dl
rm
functools.pyc
1921
0644
edit
dl
rm
functools.pyo
1921
0644
edit
dl
rm
genericpath.py
3020
0644
edit
dl
rm
genericpath.pyc
3272
0644
edit
dl
rm
genericpath.pyo
3272
0644
edit
dl
rm
getopt.py
7328
0644
edit
dl
rm
getopt.pyc
6710
0644
edit
dl
rm
getopt.pyo
6663
0644
edit
dl
rm
getpass.py
5534
0644
edit
dl
rm
getpass.pyc
4740
0644
edit
dl
rm
getpass.pyo
4740
0644
edit
dl
rm
gettext.py
19968
0644
edit
dl
rm
gettext.pyc
15674
0644
edit
dl
rm
gettext.pyo
15674
0644
edit
dl
rm
glob.py
2249
0644
edit
dl
rm
glob.pyc
2395
0644
edit
dl
rm
glob.pyo
2395
0644
edit
dl
rm
gzip.py
16754
0644
edit
dl
rm
gzip.pyc
14322
0644
edit
dl
rm
gzip.pyo
14322
0644
edit
dl
rm
hashlib.py
4427
0644
edit
dl
rm
hashlib.pyc
3975
0644
edit
dl
rm
hashlib.pyo
3975
0644
edit
dl
rm
heapq.py
15995
0644
edit
dl
rm
heapq.pyc
12668
0644
edit
dl
rm
heapq.pyo
12668
0644
edit
dl
rm
hmac.py
4531
0644
edit
dl
rm
hmac.pyc
4489
0644
edit
dl
rm
hmac.pyo
4489
0644
edit
dl
rm
htmlentitydefs.py
18054
0644
edit
dl
rm
htmlentitydefs.pyc
6369
0644
edit
dl
rm
htmlentitydefs.pyo
6369
0644
edit
dl
rm
htmllib.py
12869
0644
edit
dl
rm
htmllib.pyc
20202
0644
edit
dl
rm
htmllib.pyo
20202
0644
edit
dl
rm
HTMLParser.py
13576
0644
edit
dl
rm
HTMLParser.pyc
12198
0644
edit
dl
rm
HTMLParser.pyo
11890
0644
edit
dl
rm
httplib.py
48797
0644
edit
dl
rm
httplib.pyc
37578
0644
edit
dl
rm
httplib.pyo
37382
0644
edit
dl
rm
ihooks.py
17452
0644
edit
dl
rm
ihooks.pyc
20699
0644
edit
dl
rm
ihooks.pyo
20620
0644
edit
dl
rm
imaplib.py
47771
0644
edit
dl
rm
imaplib.pyc
45027
0644
edit
dl
rm
imaplib.pyo
42287
0644
edit
dl
rm
imghdr.py
3544
0644
edit
dl
rm
imghdr.pyc
4873
0644
edit
dl
rm
imghdr.pyo
4873
0644
edit
dl
rm
imputil.py
26009
0644
edit
dl
rm
imputil.pyc
15959
0644
edit
dl
rm
imputil.pyo
15787
0644
edit
dl
rm
inspect.py
38189
0644
edit
dl
rm
inspect.pyc
37033
0644
edit
dl
rm
inspect.pyo
37033
0644
edit
dl
rm
io.py
66165
0644
edit
dl
rm
io.pyc
62712
0644
edit
dl
rm
io.pyo
62712
0644
edit
dl
rm
keyword.py
1997
0755
edit
dl
rm
keyword.pyc
2113
0644
edit
dl
rm
keyword.pyo
2113
0644
edit
dl
rm
linecache.py
4128
0644
edit
dl
rm
linecache.pyc
3256
0644
edit
dl
rm
linecache.pyo
3256
0644
edit
dl
rm
locale.py
82674
0644
edit
dl
rm
locale.pyc
46620
0644
edit
dl
rm
locale.pyo
46620
0644
edit
dl
rm
macpath.py
6253
0644
edit
dl
rm
macpath.pyc
7669
0644
edit
dl
rm
macpath.pyo
7669
0644
edit
dl
rm
macurl2path.py
3275
0644
edit
dl
rm
macurl2path.pyc
2815
0644
edit
dl
rm
macurl2path.pyo
2815
0644
edit
dl
rm
mailbox.py
75824
0644
edit
dl
rm
mailbox.pyc
75633
0644
edit
dl
rm
mailbox.pyo
75584
0644
edit
dl
rm
mailcap.py
8402
0644
edit
dl
rm
mailcap.pyc
8051
0644
edit
dl
rm
mailcap.pyo
8051
0644
edit
dl
rm
markupbase.py
14350
0644
edit
dl
rm
markupbase.pyc
9430
0644
edit
dl
rm
markupbase.pyo
9236
0644
edit
dl
rm
md5.py
410
0644
edit
dl
rm
md5.pyc
376
0644
edit
dl
rm
md5.pyo
376
0644
edit
dl
rm
mhlib.py
33434
0644
edit
dl
rm
mhlib.pyc
33981
0644
edit
dl
rm
mhlib.pyo
33981
0644
edit
dl
rm
mimetools.py
7168
0644
edit
dl
rm
mimetools.pyc
8280
0644
edit
dl
rm
mimetools.pyo
8280
0644
edit
dl
rm
mimetypes.py
18822
0644
edit
dl
rm
mimetypes.pyc
16838
0644
edit
dl
rm
mimetypes.pyo
16838
0644
edit
dl
rm
MimeWriter.py
6482
0644
edit
dl
rm
MimeWriter.pyc
7365
0644
edit
dl
rm
MimeWriter.pyo
7365
0644
edit
dl
rm
mimify.py
15024
0755
edit
dl
rm
mimify.pyc
12189
0644
edit
dl
rm
mimify.pyo
12189
0644
edit
dl
rm
modulefinder.py
24283
0644
edit
dl
rm
modulefinder.pyc
18939
0644
edit
dl
rm
modulefinder.pyo
18851
0644
edit
dl
rm
multifile.py
4820
0644
edit
dl
rm
multifile.pyc
5449
0644
edit
dl
rm
multifile.pyo
5405
0644
edit
dl
rm
mutex.py
1866
0644
edit
dl
rm
mutex.pyc
2512
0644
edit
dl
rm
mutex.pyo
2512
0644
edit
dl
rm
netrc.py
4111
0644
edit
dl
rm
netrc.pyc
3586
0644
edit
dl
rm
netrc.pyo
3586
0644
edit
dl
rm
new.py
706
0644
edit
dl
rm
new.pyc
908
0644
edit
dl
rm
new.pyo
908
0644
edit
dl
rm
nntplib.py
21470
0644
edit
dl
rm
nntplib.pyc
21091
0644
edit
dl
rm
nntplib.pyo
21091
0644
edit
dl
rm
ntpath.py
17752
0644
edit
dl
rm
ntpath.pyc
11582
0644
edit
dl
rm
ntpath.pyo
11535
0644
edit
dl
rm
nturl2path.py
2239
0644
edit
dl
rm
nturl2path.pyc
1771
0644
edit
dl
rm
nturl2path.pyo
1771
0644
edit
dl
rm
numbers.py
10271
0644
edit
dl
rm
numbers.pyc
13840
0644
edit
dl
rm
numbers.pyo
13840
0644
edit
dl
rm
opcode.py
5248
0644
edit
dl
rm
opcode.pyc
5907
0644
edit
dl
rm
opcode.pyo
5907
0644
edit
dl
rm
optparse.py
60849
0644
edit
dl
rm
optparse.pyc
53959
0644
edit
dl
rm
optparse.pyo
53877
0644
edit
dl
rm
ordereddict.py
36
0644
edit
dl
rm
ordereddict.pyc
183
0644
edit
dl
rm
ordereddict.pyo
183
0644
edit
dl
rm
os.py
25802
0644
edit
dl
rm
os.pyc
25702
0644
edit
dl
rm
os.pyo
25702
0644
edit
dl
rm
os2emxpath.py
4603
0644
edit
dl
rm
os2emxpath.pyc
4518
0644
edit
dl
rm
os2emxpath.pyo
4518
0644
edit
dl
rm
pdb.doc
7899
0644
edit
dl
rm
pdb.py
45333
0755
edit
dl
rm
pdb.pyc
43585
0644
edit
dl
rm
pdb.pyo
43585
0644
edit
dl
rm
pickle.py
44811
0644
edit
dl
rm
pickle.pyc
38437
0644
edit
dl
rm
pickle.pyo
38232
0644
edit
dl
rm
pickletools.py
74348
0644
edit
dl
rm
pickletools.pyc
57079
0644
edit
dl
rm
pickletools.pyo
56182
0644
edit
dl
rm
pipes.py
9647
0644
edit
dl
rm
pipes.pyc
9428
0644
edit
dl
rm
pipes.pyo
9428
0644
edit
dl
rm
pkgutil.py
20001
0644
edit
dl
rm
pkgutil.pyc
18954
0644
edit
dl
rm
pkgutil.pyo
18954
0644
edit
dl
rm
platform.py
52630
0755
edit
dl
rm
platform.pyc
38699
0644
edit
dl
rm
platform.pyo
38699
0644
edit
dl
rm
plistlib.py
15806
0644
edit
dl
rm
plistlib.pyc
19926
0644
edit
dl
rm
plistlib.pyo
19836
0644
edit
dl
rm
popen2.py
8416
0644
edit
dl
rm
popen2.pyc
9032
0644
edit
dl
rm
popen2.pyo
8988
0644
edit
dl
rm
poplib.py
12825
0644
edit
dl
rm
poplib.pyc
13352
0644
edit
dl
rm
poplib.pyo
13352
0644
edit
dl
rm
posixfile.py
8003
0644
edit
dl
rm
posixfile.pyc
7700
0644
edit
dl
rm
posixfile.pyo
7700
0644
edit
dl
rm
posixpath.py
13119
0644
edit
dl
rm
posixpath.pyc
11142
0644
edit
dl
rm
posixpath.pyo
11142
0644
edit
dl
rm
pprint.py
11932
0644
edit
dl
rm
pprint.pyc
10356
0644
edit
dl
rm
pprint.pyo
10181
0644
edit
dl
rm
profile.py
23510
0755
edit
dl
rm
profile.pyc
16600
0644
edit
dl
rm
profile.pyo
16355
0644
edit
dl
rm
pstats.py
27310
0644
edit
dl
rm
pstats.pyc
25212
0644
edit
dl
rm
pstats.pyo
25212
0644
edit
dl
rm
pty.py
4869
0644
edit
dl
rm
pty.pyc
4899
0644
edit
dl
rm
pty.pyo
4899
0644
edit
dl
rm
pyclbr.py
13282
0644
edit
dl
rm
pyclbr.pyc
9706
0644
edit
dl
rm
pyclbr.pyo
9706
0644
edit
dl
rm
pydoc.py
92432
0755
edit
dl
rm
pydoc.pyc
90662
0644
edit
dl
rm
pydoc.pyo
90594
0644
edit
dl
rm
pydoc_topics.py
423126
0644
edit
dl
rm
pydoc_topics.pyc
407586
0644
edit
dl
rm
pydoc_topics.pyo
407586
0644
edit
dl
rm
py_compile.py
5633
0644
edit
dl
rm
py_compile.pyc
6536
0644
edit
dl
rm
py_compile.pyo
6536
0644
edit
dl
rm
Queue.py
8574
0644
edit
dl
rm
Queue.pyc
9391
0644
edit
dl
rm
Queue.pyo
9391
0644
edit
dl
rm
quopri.py
6972
0755
edit
dl
rm
quopri.pyc
6666
0644
edit
dl
rm
quopri.pyo
6666
0644
edit
dl
rm
random.py
31966
0644
edit
dl
rm
random.pyc
25024
0644
edit
dl
rm
random.pyo
25024
0644
edit
dl
rm
re.py
12966
0644
edit
dl
rm
re.pyc
13122
0644
edit
dl
rm
re.pyo
13122
0644
edit
dl
rm
repr.py
4296
0644
edit
dl
rm
repr.pyc
5400
0644
edit
dl
rm
repr.pyo
5400
0644
edit
dl
rm
rexec.py
20152
0644
edit
dl
rm
rexec.pyc
24102
0644
edit
dl
rm
rexec.pyo
24102
0644
edit
dl
rm
rfc822.py
33295
0644
edit
dl
rm
rfc822.pyc
31990
0644
edit
dl
rm
rfc822.pyo
31990
0644
edit
dl
rm
rlcompleter.py
5866
0644
edit
dl
rm
rlcompleter.pyc
6057
0644
edit
dl
rm
rlcompleter.pyo
6057
0644
edit
dl
rm
robotparser.py
7014
0644
edit
dl
rm
robotparser.pyc
7804
0644
edit
dl
rm
robotparser.pyo
7804
0644
edit
dl
rm
runpy.py
5413
0644
edit
dl
rm
runpy.pyc
3965
0644
edit
dl
rm
runpy.pyo
3965
0644
edit
dl
rm
sched.py
5091
0644
edit
dl
rm
sched.pyc
4987
0644
edit
dl
rm
sched.pyo
4987
0644
edit
dl
rm
sets.py
19050
0644
edit
dl
rm
sets.pyc
16885
0644
edit
dl
rm
sets.pyo
16885
0644
edit
dl
rm
sgmllib.py
17884
0644
edit
dl
rm
sgmllib.pyc
15504
0644
edit
dl
rm
sgmllib.pyo
15504
0644
edit
dl
rm
sha.py
445
0644
edit
dl
rm
sha.pyc
419
0644
edit
dl
rm
sha.pyo
419
0644
edit
dl
rm
shelve.py
8078
0644
edit
dl
rm
shelve.pyc
10242
0644
edit
dl
rm
shelve.pyo
10242
0644
edit
dl
rm
shlex.py
11137
0644
edit
dl
rm
shlex.pyc
7684
0644
edit
dl
rm
shlex.pyo
7684
0644
edit
dl
rm
shutil.py
8632
0644
edit
dl
rm
shutil.pyc
9519
0644
edit
dl
rm
shutil.pyo
9519
0644
edit
dl
rm
SimpleHTTPServer.py
7422
0644
edit
dl
rm
SimpleHTTPServer.pyc
7744
0644
edit
dl
rm
SimpleHTTPServer.pyo
7744
0644
edit
dl
rm
SimpleXMLRPCServer.py
21992
0644
edit
dl
rm
SimpleXMLRPCServer.pyc
19575
0644
edit
dl
rm
SimpleXMLRPCServer.pyo
19575
0644
edit
dl
rm
site.py
18927
0644
edit
dl
rm
site.pyc
18663
0644
edit
dl
rm
site.pyo
18663
0644
edit
dl
rm
smtpd.py
18920
0755
edit
dl
rm
smtpd.pyc
16126
0644
edit
dl
rm
smtpd.pyo
16126
0644
edit
dl
rm
smtplib.py
30924
0755
edit
dl
rm
smtplib.pyc
29629
0644
edit
dl
rm
smtplib.pyo
29629
0644
edit
dl
rm
sndhdr.py
5973
0644
edit
dl
rm
sndhdr.pyc
7386
0644
edit
dl
rm
sndhdr.pyo
7386
0644
edit
dl
rm
socket.py
20149
0644
edit
dl
rm
socket.pyc
16067
0644
edit
dl
rm
socket.pyo
15982
0644
edit
dl
rm
SocketServer.py
22326
0644
edit
dl
rm
SocketServer.pyc
23035
0644
edit
dl
rm
SocketServer.pyo
23035
0644
edit
dl
rm
sre.py
384
0644
edit
dl
rm
sre.pyc
517
0644
edit
dl
rm
sre.pyo
517
0644
edit
dl
rm
sre_compile.py
16507
0644
edit
dl
rm
sre_compile.pyc
11455
0644
edit
dl
rm
sre_compile.pyo
11342
0644
edit
dl
rm
sre_constants.py
7137
0644
edit
dl
rm
sre_constants.pyc
6083
0644
edit
dl
rm
sre_constants.pyo
6083
0644
edit
dl
rm
sre_parse.py
26878
0644
edit
dl
rm
sre_parse.pyc
19622
0644
edit
dl
rm
sre_parse.pyo
19622
0644
edit
dl
rm
ssl.py
16677
0644
edit
dl
rm
ssl.pyc
14218
0644
edit
dl
rm
ssl.pyo
14218
0644
edit
dl
rm
stat.py
1718
0644
edit
dl
rm
stat.pyc
2683
0644
edit
dl
rm
stat.pyo
2683
0644
edit
dl
rm
statvfs.py
898
0644
edit
dl
rm
statvfs.pyc
618
0644
edit
dl
rm
statvfs.pyo
618
0644
edit
dl
rm
string.py
20745
0644
edit
dl
rm
string.pyc
19964
0644
edit
dl
rm
string.pyo
19964
0644
edit
dl
rm
StringIO.py
10621
0644
edit
dl
rm
StringIO.pyc
11494
0644
edit
dl
rm
StringIO.pyo
11494
0644
edit
dl
rm
stringold.py
12449
0644
edit
dl
rm
stringold.pyc
12539
0644
edit
dl
rm
stringold.pyo
12539
0644
edit
dl
rm
stringprep.py
13522
0644
edit
dl
rm
stringprep.pyc
14486
0644
edit
dl
rm
stringprep.pyo
14412
0644
edit
dl
rm
struct.py
82
0644
edit
dl
rm
struct.pyc
237
0644
edit
dl
rm
struct.pyo
237
0644
edit
dl
rm
subprocess.py
57945
0644
edit
dl
rm
subprocess.pyc
40975
0644
edit
dl
rm
subprocess.pyo
40918
0644
edit
dl
rm
sunau.py
16537
0644
edit
dl
rm
sunau.pyc
17976
0644
edit
dl
rm
sunau.pyo
17976
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
2050
0755
edit
dl
rm
symbol.pyc
3021
0644
edit
dl
rm
symbol.pyo
3021
0644
edit
dl
rm
symtable.py
7911
0644
edit
dl
rm
symtable.pyc
12503
0644
edit
dl
rm
symtable.pyo
12373
0644
edit
dl
rm
tabnanny.py
11339
0755
edit
dl
rm
tabnanny.pyc
8293
0644
edit
dl
rm
tabnanny.pyo
8293
0644
edit
dl
rm
tarfile.py
87786
0644
edit
dl
rm
tarfile.pyc
73596
0644
edit
dl
rm
tarfile.pyo
73596
0644
edit
dl
rm
telnetlib.py
21808
0644
edit
dl
rm
telnetlib.pyc
19855
0644
edit
dl
rm
telnetlib.pyo
19855
0644
edit
dl
rm
tempfile.py
17774
0644
edit
dl
rm
tempfile.pyc
19463
0644
edit
dl
rm
tempfile.pyo
19463
0644
edit
dl
rm
textwrap.py
16889
0644
edit
dl
rm
textwrap.pyc
11766
0644
edit
dl
rm
textwrap.pyo
11674
0644
edit
dl
rm
this.py
1002
0644
edit
dl
rm
this.pyc
1239
0644
edit
dl
rm
this.pyo
1239
0644
edit
dl
rm
threading.py
31808
0644
edit
dl
rm
threading.pyc
27956
0644
edit
dl
rm
threading.pyo
25884
0644
edit
dl
rm
timeit.py
12003
0644
edit
dl
rm
timeit.pyc
11801
0644
edit
dl
rm
timeit.pyo
11801
0644
edit
dl
rm
toaiff.py
3142
0644
edit
dl
rm
toaiff.pyc
3126
0644
edit
dl
rm
toaiff.pyo
3126
0644
edit
dl
rm
token.py
2947
0755
edit
dl
rm
token.pyc
3830
0644
edit
dl
rm
token.pyo
3830
0644
edit
dl
rm
tokenize.py
16326
0644
edit
dl
rm
tokenize.pyc
13986
0644
edit
dl
rm
tokenize.pyo
13893
0644
edit
dl
rm
trace.py
30325
0644
edit
dl
rm
trace.pyc
22989
0644
edit
dl
rm
trace.pyo
22927
0644
edit
dl
rm
traceback.py
11211
0644
edit
dl
rm
traceback.pyc
11637
0644
edit
dl
rm
traceback.pyo
11637
0644
edit
dl
rm
tty.py
879
0644
edit
dl
rm
tty.pyc
1311
0644
edit
dl
rm
tty.pyo
1311
0644
edit
dl
rm
types.py
2323
0644
edit
dl
rm
types.pyc
2608
0644
edit
dl
rm
types.pyo
2608
0644
edit
dl
rm
unittest.py
31157
0644
edit
dl
rm
unittest.pyc
34656
0644
edit
dl
rm
unittest.pyo
34656
0644
edit
dl
rm
urllib.py
59022
0644
edit
dl
rm
urllib.pyc
51142
0644
edit
dl
rm
urllib.pyo
51048
0644
edit
dl
rm
urllib2.py
50866
0644
edit
dl
rm
urllib2.pyc
45569
0644
edit
dl
rm
urllib2.pyo
45475
0644
edit
dl
rm
urlparse.py
15618
0644
edit
dl
rm
urlparse.pyc
14727
0644
edit
dl
rm
urlparse.pyo
14727
0644
edit
dl
rm
user.py
1627
0644
edit
dl
rm
user.pyc
1734
0644
edit
dl
rm
user.pyo
1734
0644
edit
dl
rm
UserDict.py
5778
0644
edit
dl
rm
UserDict.pyc
8802
0644
edit
dl
rm
UserDict.pyo
8802
0644
edit
dl
rm
UserList.py
3644
0644
edit
dl
rm
UserList.pyc
6535
0644
edit
dl
rm
UserList.pyo
6535
0644
edit
dl
rm
UserString.py
9691
0755
edit
dl
rm
UserString.pyc
14786
0644
edit
dl
rm
UserString.pyo
14786
0644
edit
dl
rm
uu.py
5942
0755
edit
dl
rm
uu.pyc
4227
0644
edit
dl
rm
uu.pyo
4227
0644
edit
dl
rm
uuid.py
20944
0644
edit
dl
rm
uuid.pyc
21205
0644
edit
dl
rm
uuid.pyo
21205
0644
edit
dl
rm
warnings.py
14172
0644
edit
dl
rm
warnings.pyc
12996
0644
edit
dl
rm
warnings.pyo
12159
0644
edit
dl
rm
wave.py
17952
0644
edit
dl
rm
wave.pyc
19336
0644
edit
dl
rm
wave.pyo
19336
0644
edit
dl
rm
weakref.py
10087
0644
edit
dl
rm
weakref.pyc
13277
0644
edit
dl
rm
weakref.pyo
13277
0644
edit
dl
rm
webbrowser.py
21073
0644
edit
dl
rm
webbrowser.pyc
18669
0644
edit
dl
rm
webbrowser.pyo
18622
0644
edit
dl
rm
whichdb.py
3353
0644
edit
dl
rm
whichdb.pyc
2243
0644
edit
dl
rm
whichdb.pyo
2243
0644
edit
dl
rm
xdrlib.py
5513
0644
edit
dl
rm
xdrlib.pyc
9079
0644
edit
dl
rm
xdrlib.pyo
9079
0644
edit
dl
rm
xmllib.py
34865
0644
edit
dl
rm
xmllib.pyc
27166
0644
edit
dl
rm
xmllib.pyo
27166
0644
edit
dl
rm
xmlrpclib.py
47775
0644
edit
dl
rm
xmlrpclib.pyc
41230
0644
edit
dl
rm
xmlrpclib.pyo
41047
0644
edit
dl
rm
zipfile.py
53092
0644
edit
dl
rm
zipfile.pyc
37547
0644
edit
dl
rm
zipfile.pyo
37547
0644
edit
dl
rm
_abcoll.py
14242
0644
edit
dl
rm
_abcoll.pyc
21395
0644
edit
dl
rm
_abcoll.pyo
21395
0644
edit
dl
rm
_LWPCookieJar.py
6553
0644
edit
dl
rm
_LWPCookieJar.pyc
5589
0644
edit
dl
rm
_LWPCookieJar.pyo
5589
0644
edit
dl
rm
_MozillaCookieJar.py
5809
0644
edit
dl
rm
_MozillaCookieJar.pyc
4509
0644
edit
dl
rm
_MozillaCookieJar.pyo
4468
0644
edit
dl
rm
_strptime.py
19754
0644
edit
dl
rm
_strptime.pyc
14926
0644
edit
dl
rm
_strptime.pyo
14926
0644
edit
dl
rm
_threading_local.py
7114
0644
edit
dl
rm
_threading_local.pyc
6367
0644
edit
dl
rm
_threading_local.pyo
6367
0644
edit
dl
rm
__future__.py
4380
0644
edit
dl
rm
__future__.pyc
4221
0644
edit
dl
rm
__future__.pyo
4221
0644
edit
dl
rm
__phello__.foo.py
64
0644
edit
dl
rm
__phello__.foo.pyc
123
0644
edit
dl
rm
__phello__.foo.pyo
123
0644
edit
dl
rm
Edit:
/usr/lib/python2.6/SocketServer.py
(22326B)
"""Generic socket server classes. This module tries to capture the various aspects of defining a server: For socket-based servers: - address family: - AF_INET{,6}: IP (Internet Protocol) sockets (default) - AF_UNIX: Unix domain sockets - others, e.g. AF_DECNET are conceivable (see <socket.h> - socket type: - SOCK_STREAM (reliable stream, e.g. TCP) - SOCK_DGRAM (datagrams, e.g. UDP) For request-based servers (including socket-based): - client address verification before further looking at the request (This is actually a hook for any processing that needs to look at the request before anything else, e.g. logging) - how to handle multiple requests: - synchronous (one request is handled at a time) - forking (each request is handled by a new process) - threading (each request is handled by a new thread) The classes in this module favor the server type that is simplest to write: a synchronous TCP/IP server. This is bad class design, but save some typing. (There's also the issue that a deep class hierarchy slows down method lookups.) There are five classes in an inheritance diagram, four of which represent synchronous servers of four types: +------------+ | BaseServer | +------------+ | v +-----------+ +------------------+ | TCPServer |------->| UnixStreamServer | +-----------+ +------------------+ | v +-----------+ +--------------------+ | UDPServer |------->| UnixDatagramServer | +-----------+ +--------------------+ Note that UnixDatagramServer derives from UDPServer, not from UnixStreamServer -- the only difference between an IP and a Unix stream server is the address family, which is simply repeated in both unix server classes. Forking and threading versions of each type of server can be created using the ForkingMixIn and ThreadingMixIn mix-in classes. For instance, a threading UDP server class is created as follows: class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass The Mix-in class must come first, since it overrides a method defined in UDPServer! Setting the various member variables also changes the behavior of the underlying server mechanism. To implement a service, you must derive a class from BaseRequestHandler and redefine its handle() method. You can then run various versions of the service by combining one of the server classes with your request handler class. The request handler class must be different for datagram or stream services. This can be hidden by using the request handler subclasses StreamRequestHandler or DatagramRequestHandler. Of course, you still have to use your head! For instance, it makes no sense to use a forking server if the service contains state in memory that can be modified by requests (since the modifications in the child process would never reach the initial state kept in the parent process and passed to each child). In this case, you can use a threading server, but you will probably have to use locks to avoid two requests that come in nearly simultaneous to apply conflicting changes to the server state. On the other hand, if you are building e.g. an HTTP server, where all data is stored externally (e.g. in the file system), a synchronous class will essentially render the service "deaf" while one request is being handled -- which may be for a very long time if a client is slow to reqd all the data it has requested. Here a threading or forking server is appropriate. In some cases, it may be appropriate to process part of a request synchronously, but to finish processing in a forked child depending on the request data. This can be implemented by using a synchronous server and doing an explicit fork in the request handler class handle() method. Another approach to handling multiple simultaneous requests in an environment that supports neither threads nor fork (or where these are too expensive or inappropriate for the service) is to maintain an explicit table of partially finished requests and to use select() to decide which request to work on next (or whether to handle a new incoming request). This is particularly important for stream services where each client can potentially be connected for a long time (if threads or subprocesses cannot be used). Future work: - Standard classes for Sun RPC (which uses either UDP or TCP) - Standard mix-in classes to implement various authentication and encryption schemes - Standard framework for select-based multiplexing XXX Open problems: - What to do with out-of-band data? BaseServer: - split generic "request" functionality out into BaseServer class. Copyright (C) 2000 Luke Kenneth Casson Leighton <lkcl@samba.org> example: read entries from a SQL database (requires overriding get_request() to return a table entry from the database). entry is processed by a RequestHandlerClass. """ # Author of the BaseServer patch: Luke Kenneth Casson Leighton # XXX Warning! # There is a test suite for this module, but it cannot be run by the # standard regression test. # To run it manually, run Lib/test/test_socketserver.py. __version__ = "0.4" import socket import select import sys import os import errno try: import threading except ImportError: import dummy_threading as threading __all__ = ["TCPServer","UDPServer","ForkingUDPServer","ForkingTCPServer", "ThreadingUDPServer","ThreadingTCPServer","BaseRequestHandler", "StreamRequestHandler","DatagramRequestHandler", "ThreadingMixIn", "ForkingMixIn"] if hasattr(socket, "AF_UNIX"): __all__.extend(["UnixStreamServer","UnixDatagramServer", "ThreadingUnixStreamServer", "ThreadingUnixDatagramServer"]) def _eintr_retry(func, *args): """restart a system call interrupted by EINTR""" while True: try: return func(*args) except (OSError, select.error) as e: if e.args[0] != errno.EINTR: raise class BaseServer: """Base class for server classes. Methods for the caller: - __init__(server_address, RequestHandlerClass) - serve_forever(poll_interval=0.5) - shutdown() - handle_request() # if you do not use serve_forever() - fileno() -> int # for select() Methods that may be overridden: - server_bind() - server_activate() - get_request() -> request, client_address - handle_timeout() - verify_request(request, client_address) - server_close() - process_request(request, client_address) - close_request(request) - handle_error() Methods for derived classes: - finish_request(request, client_address) Class variables that may be overridden by derived classes or instances: - timeout - address_family - socket_type - allow_reuse_address Instance variables: - RequestHandlerClass - socket """ timeout = None def __init__(self, server_address, RequestHandlerClass): """Constructor. May be extended, do not override.""" self.server_address = server_address self.RequestHandlerClass = RequestHandlerClass self.__is_shut_down = threading.Event() self.__shutdown_request = False def server_activate(self): """Called by constructor to activate the server. May be overridden. """ pass def serve_forever(self, poll_interval=0.5): """Handle one request at a time until shutdown. Polls for shutdown every poll_interval seconds. Ignores self.timeout. If you need to do periodic tasks, do them in another thread. """ self.__is_shut_down.clear() try: while not self.__shutdown_request: # XXX: Consider using another file descriptor or # connecting to the socket to wake this up instead of # polling. Polling reduces our responsiveness to a # shutdown request and wastes cpu at all other times. r, w, e = _eintr_retry(select.select, [self], [], [], poll_interval) if self in r: self._handle_request_noblock() finally: self.__shutdown_request = False self.__is_shut_down.set() def shutdown(self): """Stops the serve_forever loop. Blocks until the loop has finished. This must be called while serve_forever() is running in another thread, or it will deadlock. """ self.__shutdown_request = True self.__is_shut_down.wait() # The distinction between handling, getting, processing and # finishing a request is fairly arbitrary. Remember: # # - handle_request() is the top-level call. It calls # select, get_request(), verify_request() and process_request() # - get_request() is different for stream or datagram sockets # - process_request() is the place that may fork a new process # or create a new thread to finish the request # - finish_request() instantiates the request handler class; # this constructor will handle the request all by itself def handle_request(self): """Handle one request, possibly blocking. Respects self.timeout. """ # Support people who used socket.settimeout() to escape # handle_request before self.timeout was available. timeout = self.socket.gettimeout() if timeout is None: timeout = self.timeout elif self.timeout is not None: timeout = min(timeout, self.timeout) fd_sets = _eintr_retry(select.select, [self], [], [], timeout) if not fd_sets[0]: self.handle_timeout() return self._handle_request_noblock() def _handle_request_noblock(self): """Handle one request, without blocking. I assume that select.select has returned that the socket is readable before this function was called, so there should be no risk of blocking in get_request(). """ try: request, client_address = self.get_request() except socket.error: return if self.verify_request(request, client_address): try: self.process_request(request, client_address) except: self.handle_error(request, client_address) self.close_request(request) def handle_timeout(self): """Called if no new request arrives within self.timeout. Overridden by ForkingMixIn. """ pass def verify_request(self, request, client_address): """Verify the request. May be overridden. Return True if we should proceed with this request. """ return True def process_request(self, request, client_address): """Call finish_request. Overridden by ForkingMixIn and ThreadingMixIn. """ self.finish_request(request, client_address) self.close_request(request) def server_close(self): """Called to clean-up the server. May be overridden. """ pass def finish_request(self, request, client_address): """Finish one request by instantiating RequestHandlerClass.""" self.RequestHandlerClass(request, client_address, self) def close_request(self, request): """Called to clean up an individual request.""" pass def handle_error(self, request, client_address): """Handle an error gracefully. May be overridden. The default is to print a traceback and continue. """ print '-'*40 print 'Exception happened during processing of request from', print client_address import traceback traceback.print_exc() # XXX But this goes to stderr! print '-'*40 class TCPServer(BaseServer): """Base class for various socket-based server classes. Defaults to synchronous IP stream (i.e., TCP). Methods for the caller: - __init__(server_address, RequestHandlerClass, bind_and_activate=True) - serve_forever(poll_interval=0.5) - shutdown() - handle_request() # if you don't use serve_forever() - fileno() -> int # for select() Methods that may be overridden: - server_bind() - server_activate() - get_request() -> request, client_address - handle_timeout() - verify_request(request, client_address) - process_request(request, client_address) - close_request(request) - handle_error() Methods for derived classes: - finish_request(request, client_address) Class variables that may be overridden by derived classes or instances: - timeout - address_family - socket_type - request_queue_size (only for stream sockets) - allow_reuse_address Instance variables: - server_address - RequestHandlerClass - socket """ address_family = socket.AF_INET socket_type = socket.SOCK_STREAM request_queue_size = 5 allow_reuse_address = False def __init__(self, server_address, RequestHandlerClass, bind_and_activate=True): """Constructor. May be extended, do not override.""" BaseServer.__init__(self, server_address, RequestHandlerClass) self.socket = socket.socket(self.address_family, self.socket_type) if bind_and_activate: self.server_bind() self.server_activate() def server_bind(self): """Called by constructor to bind the socket. May be overridden. """ if self.allow_reuse_address: self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self.socket.bind(self.server_address) self.server_address = self.socket.getsockname() def server_activate(self): """Called by constructor to activate the server. May be overridden. """ self.socket.listen(self.request_queue_size) def server_close(self): """Called to clean-up the server. May be overridden. """ self.socket.close() def fileno(self): """Return socket file number. Interface required by select(). """ return self.socket.fileno() def get_request(self): """Get the request and client address from the socket. May be overridden. """ return self.socket.accept() def close_request(self, request): """Called to clean up an individual request.""" request.close() class UDPServer(TCPServer): """UDP server class.""" allow_reuse_address = False socket_type = socket.SOCK_DGRAM max_packet_size = 8192 def get_request(self): data, client_addr = self.socket.recvfrom(self.max_packet_size) return (data, self.socket), client_addr def server_activate(self): # No need to call listen() for UDP. pass def close_request(self, request): # No need to close anything. pass class ForkingMixIn: """Mix-in class to handle each request in a new process.""" timeout = 300 active_children = None max_children = 40 def collect_children(self): """Internal routine to wait for children that have exited.""" if self.active_children is None: return while len(self.active_children) >= self.max_children: # XXX: This will wait for any child process, not just ones # spawned by this library. This could confuse other # libraries that expect to be able to wait for their own # children. try: pid, status = os.waitpid(0, 0) except os.error: pid = None if pid not in self.active_children: continue self.active_children.remove(pid) # XXX: This loop runs more system calls than it ought # to. There should be a way to put the active_children into a # process group and then use os.waitpid(-pgid) to wait for any # of that set, but I couldn't find a way to allocate pgids # that couldn't collide. for child in self.active_children: try: pid, status = os.waitpid(child, os.WNOHANG) except os.error: pid = None if not pid: continue try: self.active_children.remove(pid) except ValueError, e: raise ValueError('%s. x=%d and list=%r' % (e.message, pid, self.active_children)) def handle_timeout(self): """Wait for zombies after self.timeout seconds of inactivity. May be extended, do not override. """ self.collect_children() def process_request(self, request, client_address): """Fork a new subprocess to process the request.""" self.collect_children() pid = os.fork() if pid: # Parent process if self.active_children is None: self.active_children = [] self.active_children.append(pid) self.close_request(request) return else: # Child process. # This must never return, hence os._exit()! try: self.finish_request(request, client_address) os._exit(0) except: try: self.handle_error(request, client_address) finally: os._exit(1) class ThreadingMixIn: """Mix-in class to handle each request in a new thread.""" # Decides how threads will act upon termination of the # main process daemon_threads = False def process_request_thread(self, request, client_address): """Same as in BaseServer but as a thread. In addition, exception handling is done here. """ try: self.finish_request(request, client_address) self.close_request(request) except: self.handle_error(request, client_address) self.close_request(request) def process_request(self, request, client_address): """Start a new thread to process the request.""" t = threading.Thread(target = self.process_request_thread, args = (request, client_address)) if self.daemon_threads: t.setDaemon (1) t.start() class ForkingUDPServer(ForkingMixIn, UDPServer): pass class ForkingTCPServer(ForkingMixIn, TCPServer): pass class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass class ThreadingTCPServer(ThreadingMixIn, TCPServer): pass if hasattr(socket, 'AF_UNIX'): class UnixStreamServer(TCPServer): address_family = socket.AF_UNIX class UnixDatagramServer(UDPServer): address_family = socket.AF_UNIX class ThreadingUnixStreamServer(ThreadingMixIn, UnixStreamServer): pass class ThreadingUnixDatagramServer(ThreadingMixIn, UnixDatagramServer): pass class BaseRequestHandler: """Base class for request handler classes. This class is instantiated for each request to be handled. The constructor sets the instance variables request, client_address and server, and then calls the handle() method. To implement a specific service, all you need to do is to derive a class which defines a handle() method. The handle() method can find the request as self.request, the client address as self.client_address, and the server (in case it needs access to per-server information) as self.server. Since a separate instance is created for each request, the handle() method can define arbitrary other instance variariables. """ def __init__(self, request, client_address, server): self.request = request self.client_address = client_address self.server = server try: self.setup() self.handle() self.finish() finally: sys.exc_traceback = None # Help garbage collection def setup(self): pass def handle(self): pass def finish(self): pass # The following two classes make it possible to use the same service # class for stream or datagram servers. # Each class sets up these instance variables: # - rfile: a file object from which receives the request is read # - wfile: a file object to which the reply is written # When the handle() method returns, wfile is flushed properly class StreamRequestHandler(BaseRequestHandler): """Define self.rfile and self.wfile for stream sockets.""" # Default buffer sizes for rfile, wfile. # We default rfile to buffered because otherwise it could be # really slow for large data (a getc() call per byte); we make # wfile unbuffered because (a) often after a write() we want to # read and we need to flush the line; (b) big writes to unbuffered # files are typically optimized by stdio even when big reads # aren't. rbufsize = -1 wbufsize = 0 def setup(self): self.connection = self.request self.rfile = self.connection.makefile('rb', self.rbufsize) self.wfile = self.connection.makefile('wb', self.wbufsize) def finish(self): if not self.wfile.closed: self.wfile.flush() self.wfile.close() self.rfile.close() class DatagramRequestHandler(BaseRequestHandler): # XXX Regrettably, I cannot get this working on Linux; # s.recvfrom() doesn't return a meaningful client address. """Define self.rfile and self.wfile for datagram sockets.""" def setup(self): try: from cStringIO import StringIO except ImportError: from StringIO import StringIO self.packet, self.socket = self.request self.rfile = StringIO(self.packet) self.wfile = StringIO() def finish(self): self.socket.sendto(self.wfile.getvalue(), self.client_address)
Save
cmd:
run