eric7/DocumentationTools/ModuleDocumentor.py

branch
eric7
changeset 8761
f05818ae6431
parent 8598
0460087da31b
child 8881
54e42bc2437a
equal deleted inserted replaced
8760:8f3ee84ae342 8761:f05818ae6431
231 Private method to generate the section listing all classes of the 231 Private method to generate the section listing all classes of the
232 module. 232 module.
233 233
234 @return The classes list section. (string) 234 @return The classes list section. (string)
235 """ 235 """
236 names = sorted(list(self.module.classes.keys())) 236 names = sorted(self.module.classes.keys())
237 if names: 237 if names:
238 self.empty = False 238 self.empty = False
239 s = self.__genListSection(names, self.module.classes) 239 s = self.__genListSection(names, self.module.classes)
240 else: 240 else:
241 s = TemplatesListsStyleCSS.listEntryNoneTemplate 241 s = TemplatesListsStyleCSS.listEntryNoneTemplate
246 Private method to generate the section listing all modules of the file 246 Private method to generate the section listing all modules of the file
247 (Ruby only). 247 (Ruby only).
248 248
249 @return The modules list section. (string) 249 @return The modules list section. (string)
250 """ 250 """
251 names = sorted(list(self.module.modules.keys())) 251 names = sorted(self.module.modules.keys())
252 if names: 252 if names:
253 self.empty = False 253 self.empty = False
254 s = self.__genListSection(names, self.module.modules) 254 s = self.__genListSection(names, self.module.modules)
255 else: 255 else:
256 s = TemplatesListsStyleCSS.listEntryNoneTemplate 256 s = TemplatesListsStyleCSS.listEntryNoneTemplate
261 Private method to generate the section listing all functions of the 261 Private method to generate the section listing all functions of the
262 module. 262 module.
263 263
264 @return The functions list section. (string) 264 @return The functions list section. (string)
265 """ 265 """
266 names = sorted(list(self.module.functions.keys())) 266 names = sorted(self.module.functions.keys())
267 if names: 267 if names:
268 self.empty = False 268 self.empty = False
269 s = self.__genListSection(names, self.module.functions) 269 s = self.__genListSection(names, self.module.functions)
270 else: 270 else:
271 s = TemplatesListsStyleCSS.listEntryNoneTemplate 271 s = TemplatesListsStyleCSS.listEntryNoneTemplate
276 Private method to generate the document section with details about 276 Private method to generate the document section with details about
277 classes. 277 classes.
278 278
279 @return The classes details section. (string) 279 @return The classes details section. (string)
280 """ 280 """
281 classNames = sorted(list(self.module.classes.keys())) 281 classNames = sorted(self.module.classes.keys())
282 classes = [] 282 classes = []
283 for className in classNames: 283 for className in classNames:
284 _class = self.module.classes[className] 284 _class = self.module.classes[className]
285 supers = _class.super 285 supers = _class.super
286 supers = ', '.join(supers) if len(supers) > 0 else "None" 286 supers = ', '.join(supers) if len(supers) > 0 else "None"
443 Private method to generate the document section with details about 443 Private method to generate the document section with details about
444 Ruby modules. 444 Ruby modules.
445 445
446 @return The Ruby modules details section. (string) 446 @return The Ruby modules details section. (string)
447 """ 447 """
448 rbModulesNames = sorted(list(self.module.modules.keys())) 448 rbModulesNames = sorted(self.module.modules.keys())
449 rbModules = [] 449 rbModules = []
450 for rbModuleName in rbModulesNames: 450 for rbModuleName in rbModulesNames:
451 rbModule = self.module.modules[rbModuleName] 451 rbModule = self.module.modules[rbModuleName]
452 globalsList = self.__genGlobalsListSection(rbModule) 452 globalsList = self.__genGlobalsListSection(rbModule)
453 methList, methBodies = self.__genMethodSection( 453 methList, methBodies = self.__genMethodSection(
487 @param obj Reference to the object being formatted. 487 @param obj Reference to the object being formatted.
488 @param modName Name of the Ruby module containing the classes. (string) 488 @param modName Name of the Ruby module containing the classes. (string)
489 @return The classes list and classes details section. 489 @return The classes list and classes details section.
490 (tuple of two string) 490 (tuple of two string)
491 """ 491 """
492 classNames = sorted(list(obj.classes.keys())) 492 classNames = sorted(obj.classes.keys())
493 classes = [] 493 classes = []
494 for className in classNames: 494 for className in classNames:
495 _class = obj.classes[className] 495 _class = obj.classes[className]
496 supers = _class.super 496 supers = _class.super
497 supers = ', '.join(supers) if len(supers) > 0 else "None" 497 supers = ', '.join(supers) if len(supers) > 0 else "None"
560 functions. 560 functions.
561 561
562 @return The functions details section. (string) 562 @return The functions details section. (string)
563 """ 563 """
564 funcBodies = [] 564 funcBodies = []
565 funcNames = sorted(list(self.module.functions.keys())) 565 funcNames = sorted(self.module.functions.keys())
566 for funcName in funcNames: 566 for funcName in funcNames:
567 try: 567 try:
568 funcBody = TemplatesListsStyleCSS.functionTemplate.format( 568 funcBody = TemplatesListsStyleCSS.functionTemplate.format(
569 **{'Anchor': funcName, 569 **{'Anchor': funcName,
570 'Function': self.module.functions[funcName].name, 570 'Function': self.module.functions[funcName].name,
680 list section. 680 list section.
681 @param template The template to be used for the list. (string) 681 @param template The template to be used for the list. (string)
682 @return The list section. (string) 682 @return The list section. (string)
683 """ 683 """
684 lst = [] 684 lst = []
685 keys = sorted(list(dictionary.keys())) 685 keys = sorted(dictionary.keys())
686 for key in keys: 686 for key in keys:
687 lst.append(template.format( 687 lst.append(template.format(
688 **{'Name': key, 688 **{'Name': key,
689 'Description': html_uencode('\n'.join(dictionary[key])), 689 'Description': html_uencode('\n'.join(dictionary[key])),
690 })) 690 }))

eric ide

mercurial