更新输出内容格式
This commit is contained in:
parent
99f53e2ae1
commit
a776026403
File diff suppressed because it is too large
Load Diff
15446
nxopen_api_know/nxopen.txt
Normal file
15446
nxopen_api_know/nxopen.txt
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
22652
nxopen_api_know/nxopen_cam.txt
Normal file
22652
nxopen_api_know/nxopen_cam.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -22,28 +22,16 @@ modules = [NXOpen]
|
||||
def main():
|
||||
for module in modules:
|
||||
lw.WriteLine(f"module name:{module.__name__}")
|
||||
func = inspect.getmembers(module)
|
||||
for func_name,func_obj in func:
|
||||
# 过滤掉以双下划线开头的成员
|
||||
if not func_name.startswith('__') and not func_name.startswith('_'):
|
||||
lw.WriteLine(f" func name: {module.__name__}.{func_name}")
|
||||
# 获取类的所有成员
|
||||
member = inspect.getmembers(func_obj)
|
||||
for member_name, member_obj in member:
|
||||
# 过滤掉以双下划线开头的成员
|
||||
if not member_name.startswith('__') and not member_name.startswith('_'):
|
||||
#不再输出父级节点,方便缩小导出API的体积
|
||||
#lw.WriteLine(f" member name: {module.__name__}.{func_name}.{member_name}")
|
||||
lw.WriteLine(f" member name:{member_name}")
|
||||
#过滤掉影响阅读的成员
|
||||
if not (type(member_obj).__name__).startswith('method_descriptor') \
|
||||
and not (type(member_obj).__name__).startswith('getset_descriptor') \
|
||||
and not (type(member_obj).__name__).startswith('builtin_function_or_method') \
|
||||
and not (type(member_obj).__name__).startswith('type'):
|
||||
lw.WriteLine(f" member type name: {type(member_obj).__name__}")
|
||||
for attr in dir(member_obj):
|
||||
if not attr.startswith('__') and not attr.startswith('_'):
|
||||
lw.WriteLine(f" attr type: {attr}")
|
||||
classes = inspect.getmembers(module,inspect.isclass)
|
||||
for cls_name,cls in classes:
|
||||
lw.WriteLine(f" class:{module.__name__}.{cls_name}")
|
||||
cls_subs = inspect.getmembers(cls,inspect.isclass)
|
||||
for cls_sub_name, cls_cls in cls_subs:
|
||||
if not cls_sub_name.startswith('__'):
|
||||
lw.WriteLine(f" subclass:{module.__name__}.{cls_name}.{cls_sub_name}")
|
||||
for member in dir(cls_cls):
|
||||
if not member.startswith('__'):
|
||||
lw.WriteLine(f" member:{member}:{type(member).__name__}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
"#----------ban words:-----------"
|
||||
|
Loading…
Reference in New Issue
Block a user