mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 11:34:53 +08:00
[0.3.x] updated : pytowiki script : new information
git-svn-id: https://pykd.svn.codeplex.com/svn@89229 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
d9dcaf3007
commit
55d6d9737b
@ -44,11 +44,12 @@ class ModuleInfo:
|
|||||||
|
|
||||||
def __init__ (self, module):
|
def __init__ (self, module):
|
||||||
self.funcs = sorted( [ item for item in module.__dict__.values() if type(item).__name__ == "function" ], key=lambda x: x.__name__ )
|
self.funcs = sorted( [ item for item in module.__dict__.values() if type(item).__name__ == "function" ], key=lambda x: x.__name__ )
|
||||||
self.classes = sorted( [ item for item in module.__dict__.values() if type(item).__name__ == "class" ], key=lambda x: x.__name__ )
|
self.classes = sorted( [ item for item in module.__dict__.values() if type(item).__name__ == "class" or type(item).__name__ == "type" ], key=lambda x: x.__name__ )
|
||||||
|
|
||||||
for cls in self.classes:
|
for cls in self.classes:
|
||||||
cls.methods = sorted( [ item for item in cls.__dict__.values() if type(item).__name__ == "function" ], key=lambda x: x.__name__ )
|
cls.methods = sorted( [ item for item in cls.__dict__.values() if type(item).__name__ == "function" ], key=lambda x: x.__name__ )
|
||||||
cls.properties = sorted( [ item for item in cls.__dict__.items() if type(item[1]).__name__ == "property" ], key=lambda x: x[0] )
|
cls.properties = sorted( [ item for item in cls.__dict__.items() if type(item[1]).__name__ == "property" ], key=lambda x: x[0] )
|
||||||
|
cls.enum = cls.__dict__.get("names", [] )
|
||||||
|
|
||||||
|
|
||||||
def buildDoc( ioStream, formatter, apiInfo ):
|
def buildDoc( ioStream, formatter, apiInfo ):
|
||||||
@ -77,6 +78,13 @@ def buildDoc( ioStream, formatter, apiInfo ):
|
|||||||
if cls.__doc__ != None:
|
if cls.__doc__ != None:
|
||||||
ioStream.write( formatter.escapeMarkup( cls.__doc__) + formatter.endl() )
|
ioStream.write( formatter.escapeMarkup( cls.__doc__) + formatter.endl() )
|
||||||
|
|
||||||
|
ioStream.write( formatter.header4( "Base classes:") )
|
||||||
|
for b in cls.__bases__:
|
||||||
|
if b in apiInfo.classes:
|
||||||
|
ioStream.write( formatter.link( b.__name__, b.__name__ ) + formatter.endl() )
|
||||||
|
else:
|
||||||
|
ioStream.write( b.__name__ + formatter.endl() )
|
||||||
|
|
||||||
if cls.properties:
|
if cls.properties:
|
||||||
ioStream.write( formatter.header4( "Properties:") )
|
ioStream.write( formatter.header4( "Properties:") )
|
||||||
for p in cls.properties:
|
for p in cls.properties:
|
||||||
@ -88,6 +96,11 @@ def buildDoc( ioStream, formatter, apiInfo ):
|
|||||||
if m.__doc__ != None:
|
if m.__doc__ != None:
|
||||||
ioStream.write( formatter.bulletItem( formatter.link( m.__name__, cls.__name__ + "." + m.__name__) ) )
|
ioStream.write( formatter.bulletItem( formatter.link( m.__name__, cls.__name__ + "." + m.__name__) ) )
|
||||||
|
|
||||||
|
if cls.enum:
|
||||||
|
ioStream.write( formatter.header4( "Values:") )
|
||||||
|
for v in cls.enum.items():
|
||||||
|
ioStream.write( formatter.bulletItem( "%s: %d" % v ) )
|
||||||
|
|
||||||
if cls.properties:
|
if cls.properties:
|
||||||
for p in cls.properties:
|
for p in cls.properties:
|
||||||
if p[1].__doc__ != None:
|
if p[1].__doc__ != None:
|
||||||
|
Loading…
Reference in New Issue
Block a user