@@ -219,7 +219,7 @@ def decode(self):
219219 # 避免空函数解析
220220 self .init_func = self .class_name
221221
222- self .functions_infor = []
222+ self .functions_info = []
223223 # Note: 未来可能在private也有函数
224224 # Note: 函数内构造函数可能解析有问题,需要后期查验
225225 self .class_function_number = len (self .class_dict ["methods" ]["public" ])
@@ -267,7 +267,7 @@ def decode(self):
267267 "param_intro"
268268 ][param_name ]
269269
270- self .functions_infor .append (
270+ self .functions_info .append (
271271 {
272272 "name" : function_name ,
273273 "doxygen" : funcs_intro ,
@@ -322,46 +322,48 @@ def create_and_write_file_cn(self, save_dir, language):
322322 )
323323 f .write (class_function_head_text )
324324
325- for fun_infor in self .functions_infor :
326- if fun_infor ["template" ] == "" :
325+ for fun_info in self .functions_info :
326+ if fun_info ["template" ] == "" :
327327 fun_name_and_intro_text = ""
328328 else :
329- fun_name_and_intro_text = f"{ fun_infor ['template' ]} \n "
329+ fun_name_and_intro_text = f"{ fun_info ['template' ]} \n "
330330 fun_name_and_intro_text += (
331- f"{ fun_infor ['name' ]} \n "
331+ f"{ fun_info ['name' ]} \n "
332332 + "'''''''''''\n "
333- + f"{ fun_infor ['doxygen' ]} \n "
333+ + f"{ fun_info ['doxygen' ]} \n "
334334 + "\n "
335335 )
336336 f .write (fun_name_and_intro_text )
337337
338- if fun_infor ["note" ] != "" :
338+ if fun_info ["note" ] != "" :
339339 fun_note_text = (
340- "..note::\n " + f"\t { fun_infor ['note' ]} \n " + "\n "
340+ "..note::\n " + f"\t { fun_info ['note' ]} \n " + "\n "
341341 )
342342 f .write (fun_note_text )
343343
344- if len (fun_infor ["parameter" ]) != 0 :
344+ if len (fun_info ["parameter" ]) != 0 :
345345 parameters_text = "**参数**\n " + "'''''''''''\n "
346346 f .write (parameters_text )
347- for param in fun_infor ["parameter" ].keys ():
347+ for param in fun_info ["parameter" ].keys ():
348348 param_text = f"\t - **{ param } **"
349- if fun_infor ["parameter" ][param ]["type" ] != "" :
350- param_text += f" ({ fun_infor ['parameter' ][param ]['type' ]} )"
351- if fun_infor ["parameter" ][param ]["intro" ] != "" :
352- param_text += f" - { fun_infor ['parameter' ][param ]['intro' ]} "
349+ if fun_info ["parameter" ][param ]["type" ] != "" :
350+ param_text += (
351+ f" ({ fun_info ['parameter' ][param ]['type' ]} )"
352+ )
353+ if fun_info ["parameter" ][param ]["intro" ] != "" :
354+ param_text += f" - { fun_info ['parameter' ][param ]['intro' ]} "
353355 param_text += "\n "
354356 f .write (param_text )
355357 f .write ("\n " )
356358
357359 if (
358- fun_infor ["returns" ] != ""
359- and "void" not in fun_infor ["returns" ]
360+ fun_info ["returns" ] != ""
361+ and "void" not in fun_info ["returns" ]
360362 ):
361363 fun_return_text = (
362364 "**返回**\n "
363365 + "'''''''''''\n "
364- + f"{ fun_infor ['returns' ]} \n "
366+ + f"{ fun_info ['returns' ]} \n "
365367 + "\n "
366368 )
367369 f .write (fun_return_text )
@@ -399,46 +401,48 @@ def create_and_write_file_en(self, save_dir, language):
399401 )
400402 f .write (class_function_head_text )
401403
402- for fun_infor in self .functions_infor :
403- if fun_infor ["template" ] == "" :
404+ for fun_info in self .functions_info :
405+ if fun_info ["template" ] == "" :
404406 fun_name_and_intro_text = ""
405407 else :
406- fun_name_and_intro_text = f"{ fun_infor ['template' ]} \n "
408+ fun_name_and_intro_text = f"{ fun_info ['template' ]} \n "
407409 fun_name_and_intro_text += (
408- f"{ fun_infor ['name' ]} \n "
410+ f"{ fun_info ['name' ]} \n "
409411 + "'''''''''''\n "
410- + f"{ fun_infor ['doxygen' ]} \n "
412+ + f"{ fun_info ['doxygen' ]} \n "
411413 + "\n "
412414 )
413415 f .write (fun_name_and_intro_text )
414416
415- if fun_infor ["note" ] != "" :
417+ if fun_info ["note" ] != "" :
416418 fun_note_text = (
417- "..note::\n " + f"\t { fun_infor ['note' ]} \n " + "\n "
419+ "..note::\n " + f"\t { fun_info ['note' ]} \n " + "\n "
418420 )
419421 f .write (fun_note_text )
420422
421- if len (fun_infor ["parameter" ]) != 0 :
423+ if len (fun_info ["parameter" ]) != 0 :
422424 parameters_text = "**Parameters**\n " + "'''''''''''\n "
423425 f .write (parameters_text )
424- for param in fun_infor ["parameter" ].keys ():
426+ for param in fun_info ["parameter" ].keys ():
425427 param_text = f"\t - **{ param } **"
426- if fun_infor ["parameter" ][param ]["type" ] != "" :
427- param_text += f" ({ fun_infor ['parameter' ][param ]['type' ]} )"
428- if fun_infor ["parameter" ][param ]["intro" ] != "" :
429- param_text += f" - { fun_infor ['parameter' ][param ]['intro' ]} "
428+ if fun_info ["parameter" ][param ]["type" ] != "" :
429+ param_text += (
430+ f" ({ fun_info ['parameter' ][param ]['type' ]} )"
431+ )
432+ if fun_info ["parameter" ][param ]["intro" ] != "" :
433+ param_text += f" - { fun_info ['parameter' ][param ]['intro' ]} "
430434 param_text += "\n "
431435 f .write (param_text )
432436 f .write ("\n " )
433437
434438 if (
435- fun_infor ["returns" ] != ""
436- and "void" not in fun_infor ["returns" ]
439+ fun_info ["returns" ] != ""
440+ and "void" not in fun_info ["returns" ]
437441 ):
438442 fun_return_text = (
439443 "**Returns**\n "
440444 + "'''''''''''\n "
441- + f"{ fun_infor ['returns' ]} \n "
445+ + f"{ fun_info ['returns' ]} \n "
442446 + "\n "
443447 )
444448 f .write (fun_return_text )
0 commit comments