更新输出内容格式
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
@ -21,29 +21,17 @@ modules = [NXOpen]
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
for module in modules:
|
for module in modules:
|
||||||
lw.WriteLine(f"module name: {module.__name__}")
|
lw.WriteLine(f"module name:{module.__name__}")
|
||||||
func = inspect.getmembers(module)
|
classes = inspect.getmembers(module,inspect.isclass)
|
||||||
for func_name,func_obj in func:
|
for cls_name,cls in classes:
|
||||||
# 过滤掉以双下划线开头的成员
|
lw.WriteLine(f" class:{module.__name__}.{cls_name}")
|
||||||
if not func_name.startswith('__') and not func_name.startswith('_'):
|
cls_subs = inspect.getmembers(cls,inspect.isclass)
|
||||||
lw.WriteLine(f" func name: {module.__name__}.{func_name}")
|
for cls_sub_name, cls_cls in cls_subs:
|
||||||
# 获取类的所有成员
|
if not cls_sub_name.startswith('__'):
|
||||||
member = inspect.getmembers(func_obj)
|
lw.WriteLine(f" subclass:{module.__name__}.{cls_name}.{cls_sub_name}")
|
||||||
for member_name, member_obj in member:
|
for member in dir(cls_cls):
|
||||||
# 过滤掉以双下划线开头的成员
|
if not member.startswith('__'):
|
||||||
if not member_name.startswith('__') and not member_name.startswith('_'):
|
lw.WriteLine(f" member:{member}:{type(member).__name__}")
|
||||||
#不再输出父级节点,方便缩小导出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}")
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
"#----------ban words:-----------"
|
"#----------ban words:-----------"
|
||||||
@ -54,4 +42,4 @@ if __name__ == '__main__':
|
|||||||
"builtin_function_or_method"
|
"builtin_function_or_method"
|
||||||
"-------------------------------------"
|
"-------------------------------------"
|
||||||
"#屏蔽以上内容方便API的阅读,被屏蔽掉的内容作者认为是python内置或者绑定函数,对象,成员.阅读意义不大"
|
"#屏蔽以上内容方便API的阅读,被屏蔽掉的内容作者认为是python内置或者绑定函数,对象,成员.阅读意义不大"
|
||||||
main()
|
main()
|
Loading…
Reference in New Issue
Block a user