/
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/inspect.py
(43008B)
# -*- coding: iso-8859-1 -*- """Get useful information from live Python objects. This module encapsulates the interface provided by the internal special attributes (func_*, co_*, im_*, tb_*, etc.) in a friendlier fashion. It also provides some help for examining source code and class layout. Here are some of the useful functions provided by this module: ismodule(), isclass(), ismethod(), isfunction(), isgeneratorfunction(), isgenerator(), istraceback(), isframe(), iscode(), isbuiltin(), isroutine() - check object types getmembers() - get members of an object that satisfy a given condition getfile(), getsourcefile(), getsource() - find an object's source code getdoc(), getcomments() - get documentation on an object getmodule() - determine the module that an object came from getclasstree() - arrange classes so as to represent their hierarchy getargspec(), getargvalues(), getcallargs() - get info about function arguments formatargspec(), formatargvalues() - format an argument spec getouterframes(), getinnerframes() - get info about frames currentframe() - get the current stack frame stack(), trace() - get info about frames on the stack or in a traceback """ # This module is in the public domain. No warranties. __author__ = 'Ka-Ping Yee <ping@lfw.org>' __date__ = '1 Jan 2001' import sys import os import types import string import re import dis import imp import tokenize import linecache from operator import attrgetter from collections import namedtuple # These constants are from Include/code.h. CO_OPTIMIZED, CO_NEWLOCALS, CO_VARARGS, CO_VARKEYWORDS = 0x1, 0x2, 0x4, 0x8 CO_NESTED, CO_GENERATOR, CO_NOFREE = 0x10, 0x20, 0x40 # See Include/object.h TPFLAGS_IS_ABSTRACT = 1 << 20 # ----------------------------------------------------------- type-checking def ismodule(object): """Return true if the object is a module. Module objects provide these attributes: __doc__ documentation string __file__ filename (missing for built-in modules)""" return isinstance(object, types.ModuleType) def isclass(object): """Return true if the object is a class. Class objects provide these attributes: __doc__ documentation string __module__ name of module in which this class was defined""" return isinstance(object, (type, types.ClassType)) def ismethod(object): """Return true if the object is an instance method. Instance method objects provide these attributes: __doc__ documentation string __name__ name with which this method was defined im_class class object in which this method belongs im_func function object containing implementation of method im_self instance to which this method is bound, or None""" return isinstance(object, types.MethodType) def ismethoddescriptor(object): """Return true if the object is a method descriptor. But not if ismethod() or isclass() or isfunction() are true. This is new in Python 2.2, and, for example, is true of int.__add__. An object passing this test has a __get__ attribute but not a __set__ attribute, but beyond that the set of attributes varies. __name__ is usually sensible, and __doc__ often is. Methods implemented via descriptors that also pass one of the other tests return false from the ismethoddescriptor() test, simply because the other tests promise more -- you can, e.g., count on having the im_func attribute (etc) when an object passes ismethod().""" return (hasattr(object, "__get__") and not hasattr(object, "__set__") # else it's a data descriptor and not ismethod(object) # mutual exclusion and not isfunction(object) and not isclass(object)) def isdatadescriptor(object): """Return true if the object is a data descriptor. Data descriptors have both a __get__ and a __set__ attribute. Examples are properties (defined in Python) and getsets and members (defined in C). Typically, data descriptors will also have __name__ and __doc__ attributes (properties, getsets, and members have both of these attributes), but this is not guaranteed.""" return (hasattr(object, "__set__") and hasattr(object, "__get__")) if hasattr(types, 'MemberDescriptorType'): # CPython and equivalent def ismemberdescriptor(object): """Return true if the object is a member descriptor. Member descriptors are specialized descriptors defined in extension modules.""" return isinstance(object, types.MemberDescriptorType) else: # Other implementations def ismemberdescriptor(object): """Return true if the object is a member descriptor. Member descriptors are specialized descriptors defined in extension modules.""" return False if hasattr(types, 'GetSetDescriptorType'): # CPython and equivalent def isgetsetdescriptor(object): """Return true if the object is a getset descriptor. getset descriptors are specialized descriptors defined in extension modules.""" return isinstance(object, types.GetSetDescriptorType) else: # Other implementations def isgetsetdescriptor(object): """Return true if the object is a getset descriptor. getset descriptors are specialized descriptors defined in extension modules.""" return False def isfunction(object): """Return true if the object is a user-defined function. Function objects provide these attributes: __doc__ documentation string __name__ name with which this function was defined func_code code object containing compiled function bytecode func_defaults tuple of any default values for arguments func_doc (same as __doc__) func_globals global namespace in which this function was defined func_name (same as __name__)""" return isinstance(object, types.FunctionType) def isgeneratorfunction(object): """Return true if the object is a user-defined generator function. Generator function objects provide the same attributes as functions. See help(isfunction) for a list of attributes.""" return bool((isfunction(object) or ismethod(object)) and object.func_code.co_flags & CO_GENERATOR) def isgenerator(object): """Return true if the object is a generator. Generator objects provide these attributes: __iter__ defined to support iteration over container close raises a new GeneratorExit exception inside the generator to terminate the iteration gi_code code object gi_frame frame object or possibly None once the generator has been exhausted gi_running set to 1 when generator is executing, 0 otherwise next return the next item from the container send resumes the generator and "sends" a value that becomes the result of the current yield-expression throw used to raise an exception inside the generator""" return isinstance(object, types.GeneratorType) def istraceback(object): """Return true if the object is a traceback. Traceback objects provide these attributes: tb_frame frame object at this level tb_lasti index of last attempted instruction in bytecode tb_lineno current line number in Python source code tb_next next inner traceback object (called by this level)""" return isinstance(object, types.TracebackType) def isframe(object): """Return true if the object is a frame object. Frame objects provide these attributes: f_back next outer frame object (this frame's caller) f_builtins built-in namespace seen by this frame f_code code object being executed in this frame f_exc_traceback traceback if raised in this frame, or None f_exc_type exception type if raised in this frame, or None f_exc_value exception value if raised in this frame, or None f_globals global namespace seen by this frame f_lasti index of last attempted instruction in bytecode f_lineno current line number in Python source code f_locals local namespace seen by this frame f_restricted 0 or 1 if frame is in restricted execution mode f_trace tracing function for this frame, or None""" return isinstance(object, types.FrameType) def iscode(object): """Return true if the object is a code object. Code objects provide these attributes: co_argcount number of arguments (not including * or ** args) co_code string of raw compiled bytecode co_consts tuple of constants used in the bytecode co_filename name of file in which this code object was created co_firstlineno number of first line in Python source code co_flags bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg co_lnotab encoded mapping of line numbers to bytecode indices co_name name with which this code object was defined co_names tuple of names of local variables co_nlocals number of local variables co_stacksize virtual machine stack space required co_varnames tuple of names of arguments and local variables""" return isinstance(object, types.CodeType) def isbuiltin(object): """Return true if the object is a built-in function or method. Built-in functions and methods provide these attributes: __doc__ documentation string __name__ original name of this function or method __self__ instance to which a method is bound, or None""" return isinstance(object, types.BuiltinFunctionType) def isroutine(object): """Return true if the object is any kind of function or method.""" return (isbuiltin(object) or isfunction(object) or ismethod(object) or ismethoddescriptor(object)) def isabstract(object): """Return true if the object is an abstract base class (ABC).""" return bool(isinstance(object, type) and object.__flags__ & TPFLAGS_IS_ABSTRACT) def getmembers(object, predicate=None): """Return all members of an object as (name, value) pairs sorted by name. Optionally, only return members that satisfy a given predicate.""" results = [] for key in dir(object): try: value = getattr(object, key) except AttributeError: continue if not predicate or predicate(value): results.append((key, value)) results.sort() return results Attribute = namedtuple('Attribute', 'name kind defining_class object') def classify_class_attrs(cls): """Return list of attribute-descriptor tuples. For each name in dir(cls), the return list contains a 4-tuple with these elements: 0. The name (a string). 1. The kind of attribute this is, one of these strings: 'class method' created via classmethod() 'static method' created via staticmethod() 'property' created via property() 'method' any other flavor of method 'data' not a method 2. The class which defined this attribute (a class). 3. The object as obtained directly from the defining class's __dict__, not via getattr. This is especially important for data attributes: C.data is just a data object, but C.__dict__['data'] may be a data descriptor with additional info, like a __doc__ string. """ mro = getmro(cls) names = dir(cls) result = [] for name in names: # Get the object associated with the name, and where it was defined. # Getting an obj from the __dict__ sometimes reveals more than # using getattr. Static and class methods are dramatic examples. # Furthermore, some objects may raise an Exception when fetched with # getattr(). This is the case with some descriptors (bug #1785). # Thus, we only use getattr() as a last resort. homecls = None for base in (cls,) + mro: if name in base.__dict__: obj = base.__dict__[name] homecls = base break else: obj = getattr(cls, name) homecls = getattr(obj, "__objclass__", homecls) # Classify the object. if isinstance(obj, staticmethod): kind = "static method" elif isinstance(obj, classmethod): kind = "class method" elif isinstance(obj, property): kind = "property" elif ismethoddescriptor(obj): kind = "method" elif isdatadescriptor(obj): kind = "data" else: obj_via_getattr = getattr(cls, name) if (ismethod(obj_via_getattr) or ismethoddescriptor(obj_via_getattr)): kind = "method" else: kind = "data" obj = obj_via_getattr result.append(Attribute(name, kind, homecls, obj)) return result # ----------------------------------------------------------- class helpers def _searchbases(cls, accum): # Simulate the "classic class" search order. if cls in accum: return accum.append(cls) for base in cls.__bases__: _searchbases(base, accum) def getmro(cls): "Return tuple of base classes (including cls) in method resolution order." if hasattr(cls, "__mro__"): return cls.__mro__ else: result = [] _searchbases(cls, result) return tuple(result) # -------------------------------------------------- source code extraction def indentsize(line): """Return the indent size, in spaces, at the start of a line of text.""" expline = string.expandtabs(line) return len(expline) - len(string.lstrip(expline)) def getdoc(object): """Get the documentation string for an object. All tabs are expanded to spaces. To clean up docstrings that are indented to line up with blocks of code, any whitespace than can be uniformly removed from the second line onwards is removed.""" try: doc = object.__doc__ except AttributeError: return None if not isinstance(doc, types.StringTypes): return None return cleandoc(doc) def cleandoc(doc): """Clean up indentation from docstrings. Any whitespace that can be uniformly removed from the second line onwards is removed.""" try: lines = string.split(string.expandtabs(doc), '\n') except UnicodeError: return None else: # Find minimum indentation of any non-blank lines after first line. margin = sys.maxint for line in lines[1:]: content = len(string.lstrip(line)) if content: indent = len(line) - content margin = min(margin, indent) # Remove indentation. if lines: lines[0] = lines[0].lstrip() if margin < sys.maxint: for i in range(1, len(lines)): lines[i] = lines[i][margin:] # Remove any trailing or leading blank lines. while lines and not lines[-1]: lines.pop() while lines and not lines[0]: lines.pop(0) return string.join(lines, '\n') def getfile(object): """Work out which source or compiled file an object was defined in.""" if ismodule(object): if hasattr(object, '__file__'): return object.__file__ raise TypeError('{!r} is a built-in module'.format(object)) if isclass(object): object = sys.modules.get(object.__module__) if hasattr(object, '__file__'): return object.__file__ raise TypeError('{!r} is a built-in class'.format(object)) if ismethod(object): object = object.im_func if isfunction(object): object = object.func_code if istraceback(object): object = object.tb_frame if isframe(object): object = object.f_code if iscode(object): return object.co_filename raise TypeError('{!r} is not a module, class, method, ' 'function, traceback, frame, or code object'.format(object)) ModuleInfo = namedtuple('ModuleInfo', 'name suffix mode module_type') def getmoduleinfo(path): """Get the module name, suffix, mode, and module type for a given file.""" filename = os.path.basename(path) suffixes = map(lambda info: (-len(info[0]), info[0], info[1], info[2]), imp.get_suffixes()) suffixes.sort() # try longest suffixes first, in case they overlap for neglen, suffix, mode, mtype in suffixes: if filename[neglen:] == suffix: return ModuleInfo(filename[:neglen], suffix, mode, mtype) def getmodulename(path): """Return the module name for a given file, or None.""" info = getmoduleinfo(path) if info: return info[0] def getsourcefile(object): """Return the filename that can be used to locate an object's source. Return None if no way can be identified to get the source. """ filename = getfile(object) if string.lower(filename[-4:]) in ('.pyc', '.pyo'): filename = filename[:-4] + '.py' for suffix, mode, kind in imp.get_suffixes(): if 'b' in mode and string.lower(filename[-len(suffix):]) == suffix: # Looks like a binary file. We want to only return a text file. return None if os.path.exists(filename): return filename # only return a non-existent filename if the module has a PEP 302 loader if hasattr(getmodule(object, filename), '__loader__'): return filename # or it is in the linecache if filename in linecache.cache: return filename def getabsfile(object, _filename=None): """Return an absolute path to the source or compiled file for an object. The idea is for each object to have a unique origin, so this routine normalizes the result as much as possible.""" if _filename is None: _filename = getsourcefile(object) or getfile(object) return os.path.normcase(os.path.abspath(_filename)) modulesbyfile = {} _filesbymodname = {} def getmodule(object, _filename=None): """Return the module an object was defined in, or None if not found.""" if ismodule(object): return object if hasattr(object, '__module__'): return sys.modules.get(object.__module__) # Try the filename to modulename cache if _filename is not None and _filename in modulesbyfile: return sys.modules.get(modulesbyfile[_filename]) # Try the cache again with the absolute file name try: file = getabsfile(object, _filename) except TypeError: return None if file in modulesbyfile: return sys.modules.get(modulesbyfile[file]) # Update the filename to module name cache and check yet again # Copy sys.modules in order to cope with changes while iterating for modname, module in sys.modules.items(): if ismodule(module) and hasattr(module, '__file__'): f = module.__file__ if f == _filesbymodname.get(modname, None): # Have already mapped this module, so skip it continue _filesbymodname[modname] = f f = getabsfile(module) # Always map to the name the module knows itself by modulesbyfile[f] = modulesbyfile[ os.path.realpath(f)] = module.__name__ if file in modulesbyfile: return sys.modules.get(modulesbyfile[file]) # Check the main module main = sys.modules['__main__'] if not hasattr(object, '__name__'): return None if hasattr(main, object.__name__): mainobject = getattr(main, object.__name__) if mainobject is object: return main # Check builtins builtin = sys.modules['__builtin__'] if hasattr(builtin, object.__name__): builtinobject = getattr(builtin, object.__name__) if builtinobject is object: return builtin def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is raised if the source code cannot be retrieved.""" file = getfile(object) sourcefile = getsourcefile(object) if not sourcefile and file[:1] + file[-1:] != '<>': raise IOError('source code not available') file = sourcefile if sourcefile else file module = getmodule(object, file) if module: lines = linecache.getlines(file, module.__dict__) else: lines = linecache.getlines(file) if not lines: raise IOError('could not get source code') if ismodule(object): return lines, 0 if isclass(object): name = object.__name__ pat = re.compile(r'^(\s*)class\s*' + name + r'\b') # make some effort to find the best matching class definition: # use the one with the least indentation, which is the one # that's most probably not inside a function definition. candidates = [] for i in range(len(lines)): match = pat.match(lines[i]) if match: # if it's at toplevel, it's already the best one if lines[i][0] == 'c': return lines, i # else add whitespace to candidate list candidates.append((match.group(1), i)) if candidates: # this will sort by whitespace, and by line number, # less whitespace first candidates.sort() return lines, candidates[0][1] else: raise IOError('could not find class definition') if ismethod(object): object = object.im_func if isfunction(object): object = object.func_code if istraceback(object): object = object.tb_frame if isframe(object): object = object.f_code if iscode(object): if not hasattr(object, 'co_firstlineno'): raise IOError('could not find function definition') lnum = object.co_firstlineno - 1 pat = re.compile(r'^(\s*def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)') while lnum > 0: if pat.match(lines[lnum]): break lnum = lnum - 1 return lines, lnum raise IOError('could not find code object') def getcomments(object): """Get lines of comments immediately preceding an object's source code. Returns None when source can't be found. """ try: lines, lnum = findsource(object) except (IOError, TypeError): return None if ismodule(object): # Look for a comment block at the top of the file. start = 0 if lines and lines[0][:2] == '#!': start = 1 while start < len(lines) and string.strip(lines[start]) in ('', '#'): start = start + 1 if start < len(lines) and lines[start][:1] == '#': comments = [] end = start while end < len(lines) and lines[end][:1] == '#': comments.append(string.expandtabs(lines[end])) end = end + 1 return string.join(comments, '') # Look for a preceding block of comments at the same indentation. elif lnum > 0: indent = indentsize(lines[lnum]) end = lnum - 1 if end >= 0 and string.lstrip(lines[end])[:1] == '#' and \ indentsize(lines[end]) == indent: comments = [string.lstrip(string.expandtabs(lines[end]))] if end > 0: end = end - 1 comment = string.lstrip(string.expandtabs(lines[end])) while comment[:1] == '#' and indentsize(lines[end]) == indent: comments[:0] = [comment] end = end - 1 if end < 0: break comment = string.lstrip(string.expandtabs(lines[end])) while comments and string.strip(comments[0]) == '#': comments[:1] = [] while comments and string.strip(comments[-1]) == '#': comments[-1:] = [] return string.join(comments, '') class EndOfBlock(Exception): pass class BlockFinder: """Provide a tokeneater() method to detect the end of a code block.""" def __init__(self): self.indent = 0 self.islambda = False self.started = False self.passline = False self.last = 1 def tokeneater(self, type, token, srow_scol, erow_ecol, line): srow, scol = srow_scol erow, ecol = erow_ecol if not self.started: # look for the first "def", "class" or "lambda" if token in ("def", "class", "lambda"): if token == "lambda": self.islambda = True self.started = True self.passline = True # skip to the end of the line elif type == tokenize.NEWLINE: self.passline = False # stop skipping when a NEWLINE is seen self.last = srow if self.islambda: # lambdas always end at the first NEWLINE raise EndOfBlock elif self.passline: pass elif type == tokenize.INDENT: self.indent = self.indent + 1 self.passline = True elif type == tokenize.DEDENT: self.indent = self.indent - 1 # the end of matching indent/dedent pairs end a block # (note that this only works for "def"/"class" blocks, # not e.g. for "if: else:" or "try: finally:" blocks) if self.indent <= 0: raise EndOfBlock elif self.indent == 0 and type not in (tokenize.COMMENT, tokenize.NL): # any other token on the same indentation level end the previous # block as well, except the pseudo-tokens COMMENT and NL. raise EndOfBlock def getblock(lines): """Extract the block of code at the top of the given list of lines.""" blockfinder = BlockFinder() try: tokenize.tokenize(iter(lines).next, blockfinder.tokeneater) except (EndOfBlock, IndentationError): pass return lines[:blockfinder.last] def getsourcelines(object): """Return a list of source lines and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of the lines corresponding to the object and the line number indicates where in the original source file the first line of code was found. An IOError is raised if the source code cannot be retrieved.""" lines, lnum = findsource(object) if istraceback(object): object = object.tb_frame # for module or frame that corresponds to module, return all source lines if (ismodule(object) or (isframe(object) and object.f_code.co_name == "<module>")): return lines, 0 else: return getblock(lines[lnum:]), lnum + 1 def getsource(object): """Return the text of the source code for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a single string. An IOError is raised if the source code cannot be retrieved.""" lines, lnum = getsourcelines(object) return string.join(lines, '') # --------------------------------------------------- class tree extraction def walktree(classes, children, parent): """Recursive helper function for getclasstree().""" results = [] classes.sort(key=attrgetter('__module__', '__name__')) for c in classes: results.append((c, c.__bases__)) if c in children: results.append(walktree(children[c], children, c)) return results def getclasstree(classes, unique=0): """Arrange the given list of classes into a hierarchy of nested lists. Where a nested list appears, it contains classes derived from the class whose entry immediately precedes the list. Each entry is a 2-tuple containing a class and a tuple of its base classes. If the 'unique' argument is true, exactly one entry appears in the returned structure for each class in the given list. Otherwise, classes using multiple inheritance and their descendants will appear multiple times.""" children = {} roots = [] for c in classes: if c.__bases__: for parent in c.__bases__: if not parent in children: children[parent] = [] if c not in children[parent]: children[parent].append(c) if unique and parent in classes: break elif c not in roots: roots.append(c) for parent in children: if parent not in classes: roots.append(parent) return walktree(roots, children, None) # ------------------------------------------------ argument list extraction Arguments = namedtuple('Arguments', 'args varargs keywords') def getargs(co): """Get information about the arguments accepted by a code object. Three things are returned: (args, varargs, varkw), where 'args' is a list of argument names (possibly containing nested lists), and 'varargs' and 'varkw' are the names of the * and ** arguments or None.""" if not iscode(co): raise TypeError('{!r} is not a code object'.format(co)) nargs = co.co_argcount names = co.co_varnames args = list(names[:nargs]) step = 0 # The following acrobatics are for anonymous (tuple) arguments. for i in range(nargs): if args[i][:1] in ('', '.'): stack, remain, count = [], [], [] while step < len(co.co_code): op = ord(co.co_code[step]) step = step + 1 if op >= dis.HAVE_ARGUMENT: opname = dis.opname[op] value = ord(co.co_code[step]) + ord(co.co_code[step+1])*256 step = step + 2 if opname in ('UNPACK_TUPLE', 'UNPACK_SEQUENCE'): remain.append(value) count.append(value) elif opname in ('STORE_FAST', 'STORE_DEREF'): if opname == 'STORE_FAST': stack.append(names[value]) else: stack.append(co.co_cellvars[value]) # Special case for sublists of length 1: def foo((bar)) # doesn't generate the UNPACK_TUPLE bytecode, so if # `remain` is empty here, we have such a sublist. if not remain: stack[0] = [stack[0]] break else: remain[-1] = remain[-1] - 1 while remain[-1] == 0: remain.pop() size = count.pop() stack[-size:] = [stack[-size:]] if not remain: break remain[-1] = remain[-1] - 1 if not remain: break args[i] = stack[0] varargs = None if co.co_flags & CO_VARARGS: varargs = co.co_varnames[nargs] nargs = nargs + 1 varkw = None if co.co_flags & CO_VARKEYWORDS: varkw = co.co_varnames[nargs] return Arguments(args, varargs, varkw) ArgSpec = namedtuple('ArgSpec', 'args varargs keywords defaults') def getargspec(func): """Get the names and default values of a function's arguments. A tuple of four things is returned: (args, varargs, varkw, defaults). 'args' is a list of the argument names (it may contain nested lists). 'varargs' and 'varkw' are the names of the * and ** arguments or None. 'defaults' is an n-tuple of the default values of the last n arguments. """ if ismethod(func): func = func.im_func if not isfunction(func): raise TypeError('{!r} is not a Python function'.format(func)) args, varargs, varkw = getargs(func.func_code) return ArgSpec(args, varargs, varkw, func.func_defaults) ArgInfo = namedtuple('ArgInfo', 'args varargs keywords locals') def getargvalues(frame): """Get information about arguments passed into a particular frame. A tuple of four things is returned: (args, varargs, varkw, locals). 'args' is a list of the argument names (it may contain nested lists). 'varargs' and 'varkw' are the names of the * and ** arguments or None. 'locals' is the locals dictionary of the given frame.""" args, varargs, varkw = getargs(frame.f_code) return ArgInfo(args, varargs, varkw, frame.f_locals) def joinseq(seq): if len(seq) == 1: return '(' + seq[0] + ',)' else: return '(' + string.join(seq, ', ') + ')' def strseq(object, convert, join=joinseq): """Recursively walk a sequence, stringifying each element.""" if type(object) in (list, tuple): return join(map(lambda o, c=convert, j=join: strseq(o, c, j), object)) else: return convert(object) def formatargspec(args, varargs=None, varkw=None, defaults=None, formatarg=str, formatvarargs=lambda name: '*' + name, formatvarkw=lambda name: '**' + name, formatvalue=lambda value: '=' + repr(value), join=joinseq): """Format an argument spec from the 4 values returned by getargspec. The first four arguments are (args, varargs, varkw, defaults). The other four arguments are the corresponding optional formatting functions that are called to turn names and values into strings. The ninth argument is an optional function to format the sequence of arguments.""" specs = [] if defaults: firstdefault = len(args) - len(defaults) for i, arg in enumerate(args): spec = strseq(arg, formatarg, join) if defaults and i >= firstdefault: spec = spec + formatvalue(defaults[i - firstdefault]) specs.append(spec) if varargs is not None: specs.append(formatvarargs(varargs)) if varkw is not None: specs.append(formatvarkw(varkw)) return '(' + string.join(specs, ', ') + ')' def formatargvalues(args, varargs, varkw, locals, formatarg=str, formatvarargs=lambda name: '*' + name, formatvarkw=lambda name: '**' + name, formatvalue=lambda value: '=' + repr(value), join=joinseq): """Format an argument spec from the 4 values returned by getargvalues. The first four arguments are (args, varargs, varkw, locals). The next four arguments are the corresponding optional formatting functions that are called to turn names and values into strings. The ninth argument is an optional function to format the sequence of arguments.""" def convert(name, locals=locals, formatarg=formatarg, formatvalue=formatvalue): return formatarg(name) + formatvalue(locals[name]) specs = [] for i in range(len(args)): specs.append(strseq(args[i], convert, join)) if varargs: specs.append(formatvarargs(varargs) + formatvalue(locals[varargs])) if varkw: specs.append(formatvarkw(varkw) + formatvalue(locals[varkw])) return '(' + string.join(specs, ', ') + ')' def getcallargs(func, *positional, **named): """Get the mapping of arguments to values. A dict is returned, with keys the function argument names (including the names of the * and ** arguments, if any), and values the respective bound values from 'positional' and 'named'.""" args, varargs, varkw, defaults = getargspec(func) f_name = func.__name__ arg2value = {} # The following closures are basically because of tuple parameter unpacking. assigned_tuple_params = [] def assign(arg, value): if isinstance(arg, str): arg2value[arg] = value else: assigned_tuple_params.append(arg) value = iter(value) for i, subarg in enumerate(arg): try: subvalue = next(value) except StopIteration: raise ValueError('need more than %d %s to unpack' % (i, 'values' if i > 1 else 'value')) assign(subarg,subvalue) try: next(value) except StopIteration: pass else: raise ValueError('too many values to unpack') def is_assigned(arg): if isinstance(arg,str): return arg in arg2value return arg in assigned_tuple_params if ismethod(func) and func.im_self is not None: # implicit 'self' (or 'cls' for classmethods) argument positional = (func.im_self,) + positional num_pos = len(positional) num_total = num_pos + len(named) num_args = len(args) num_defaults = len(defaults) if defaults else 0 for arg, value in zip(args, positional): assign(arg, value) if varargs: if num_pos > num_args: assign(varargs, positional[-(num_pos-num_args):]) else: assign(varargs, ()) elif 0 < num_args < num_pos: raise TypeError('%s() takes %s %d %s (%d given)' % ( f_name, 'at most' if defaults else 'exactly', num_args, 'arguments' if num_args > 1 else 'argument', num_total)) elif num_args == 0 and num_total: if varkw: if num_pos: # XXX: We should use num_pos, but Python also uses num_total: raise TypeError('%s() takes exactly 0 arguments ' '(%d given)' % (f_name, num_total)) else: raise TypeError('%s() takes no arguments (%d given)' % (f_name, num_total)) for arg in args: if isinstance(arg, str) and arg in named: if is_assigned(arg): raise TypeError("%s() got multiple values for keyword " "argument '%s'" % (f_name, arg)) else: assign(arg, named.pop(arg)) if defaults: # fill in any missing values with the defaults for arg, value in zip(args[-num_defaults:], defaults): if not is_assigned(arg): assign(arg, value) if varkw: assign(varkw, named) elif named: unexpected = next(iter(named)) try: unicode except NameError: pass else: if isinstance(unexpected, unicode): unexpected = unexpected.encode(sys.getdefaultencoding(), 'replace') raise TypeError("%s() got an unexpected keyword argument '%s'" % (f_name, unexpected)) unassigned = num_args - len([arg for arg in args if is_assigned(arg)]) if unassigned: num_required = num_args - num_defaults raise TypeError('%s() takes %s %d %s (%d given)' % ( f_name, 'at least' if defaults else 'exactly', num_required, 'arguments' if num_required > 1 else 'argument', num_total)) return arg2value # -------------------------------------------------- stack frame extraction Traceback = namedtuple('Traceback', 'filename lineno function code_context index') def getframeinfo(frame, context=1): """Get information about a frame or traceback object. A tuple of five things is returned: the filename, the line number of the current line, the function name, a list of lines of context from the source code, and the index of the current line within that list. The optional second argument specifies the number of lines of context to return, which are centered around the current line.""" if istraceback(frame): lineno = frame.tb_lineno frame = frame.tb_frame else: lineno = frame.f_lineno if not isframe(frame): raise TypeError('{!r} is not a frame or traceback object'.format(frame)) filename = getsourcefile(frame) or getfile(frame) if context > 0: start = lineno - 1 - context//2 try: lines, lnum = findsource(frame) except IOError: lines = index = None else: start = max(start, 1) start = max(0, min(start, len(lines) - context)) lines = lines[start:start+context] index = lineno - 1 - start else: lines = index = None return Traceback(filename, lineno, frame.f_code.co_name, lines, index) def getlineno(frame): """Get the line number from a frame object, allowing for optimization.""" # FrameType.f_lineno is now a descriptor that grovels co_lnotab return frame.f_lineno def getouterframes(frame, context=1): """Get a list of records for a frame and all higher (calling) frames. Each record contains a frame object, filename, line number, function name, a list of lines of context, and index within the context.""" framelist = [] while frame: framelist.append((frame,) + getframeinfo(frame, context)) frame = frame.f_back return framelist def getinnerframes(tb, context=1): """Get a list of records for a traceback's frame and all lower frames. Each record contains a frame object, filename, line number, function name, a list of lines of context, and index within the context.""" framelist = [] while tb: framelist.append((tb.tb_frame,) + getframeinfo(tb, context)) tb = tb.tb_next return framelist if hasattr(sys, '_getframe'): currentframe = sys._getframe else: currentframe = lambda _=None: None def stack(context=1): """Return a list of records for the stack above the caller's frame.""" return getouterframes(sys._getframe(1), context) def trace(context=1): """Return a list of records for the stack below the current exception.""" return getinnerframes(sys.exc_info()[2], context)
Save
cmd:
run