DocumentationTools/APIGenerator.py

changeset 12
1d8dd9706f46
parent 0
de9c2efb9d02
child 13
1af94a91f439
equal deleted inserted replaced
11:b0996e4a289e 12:1d8dd9706f46
83 83
84 def __addClassesAPI(self): 84 def __addClassesAPI(self):
85 """ 85 """
86 Private method to generate the api section for classes. 86 Private method to generate the api section for classes.
87 """ 87 """
88 classNames = self.module.classes.keys() 88 classNames = sorted(list(self.module.classes.keys()))
89 classNames.sort()
90 for className in classNames: 89 for className in classNames:
91 if not self.__isPrivate(self.module.classes[className]): 90 if not self.__isPrivate(self.module.classes[className]):
92 self.__addClassVariablesAPI(className) 91 self.__addClassVariablesAPI(className)
93 self.__addMethodsAPI(className) 92 self.__addMethodsAPI(className)
94 93
97 Private method to generate the api section for class methods. 96 Private method to generate the api section for class methods.
98 97
99 @param classname Name of the class containing the method. (string) 98 @param classname Name of the class containing the method. (string)
100 """ 99 """
101 _class = self.module.classes[className] 100 _class = self.module.classes[className]
102 methods = _class.methods.keys() 101 methods = sorted(list(_class.methods.keys()))
103 methods.sort()
104
105 # first do the constructor
106 if '__init__' in methods: 102 if '__init__' in methods:
107 methods.remove('__init__') 103 methods.remove('__init__')
108 if _class.isPublic(): 104 if _class.isPublic():
109 id = Editor.ClassID 105 id = Editor.ClassID
110 elif _class.isProtected(): 106 elif _class.isProtected():
154 150
155 def __addFunctionsAPI(self): 151 def __addFunctionsAPI(self):
156 """ 152 """
157 Private method to generate the api section for functions. 153 Private method to generate the api section for functions.
158 """ 154 """
159 funcNames = self.module.functions.keys() 155 funcNames = sorted(list(self.module.functions.keys()))
160 funcNames.sort()
161 for funcName in funcNames: 156 for funcName in funcNames:
162 if not self.__isPrivate(self.module.functions[funcName]): 157 if not self.__isPrivate(self.module.functions[funcName]):
163 if self.module.functions[funcName].isPublic(): 158 if self.module.functions[funcName].isPublic():
164 id = Editor.MethodID 159 id = Editor.MethodID
165 elif self.module.functions[funcName].isProtected(): 160 elif self.module.functions[funcName].isProtected():

eric ide

mercurial