pykd
1#
2#
3#
4
5import sys
6import pykd
7
8from pykd import dprintln
9
10
11def getFuncs():
12
13funcs = sorted( [ item for item in pykd.__dict__.values() if type(item).__name__ == "function" ],
14key=lambda x: x.__name__ )
15
16return funcs
17
18def getClasses():
19
20classes = sorted( [ item for item in pykd.__dict__.values() if type(item).__name__ == "class" ],
21key=lambda x: x.__name__ )
22
23return classes
24
25
26
27def printContent():
28
29dprintln( "\nPYKD API Help\n")
30
31
32funcs = getFuncs()
33
34dprintln( "\n<u>FUNCTIONS</u>\n", True )
35
36for f in funcs:
37dprintln( "<link cmd=\"!py help %s\">%s</link>" %( f.__name__, f.__name__ ), True )
38
39classes = getClasses()
40
41dprintln( "\n<u>CLASSES</u>\n", True )
42
43for c in classes:
44dprintln( "<link cmd=\"!py help %s\">%s</link>" %( c.__name__, c.__name__ ), True )
45
46
47def printDetail( name ):
48
49if name in pykd.__dict__:
50help( "pykd.%s" % name )
51
52dprintln( "\n\n<link cmd=\"!py help\">View content</link>", True )
53
54
55
56if __name__ == "__main__":
57if len(sys.argv)<=1:
58printContent()
59if len(sys.argv)==2:
60printDetail(sys.argv[1])
61
62