DocumentationTools/APIGenerator.py

branch
Py2 comp.
changeset 3060
5883ce99ee12
parent 3057
10516539f238
parent 3033
58fe260e7469
child 3145
a9de05d4a22f
equal deleted inserted replaced
3058:0a02c433f52d 3060:5883ce99ee12
121 id = Editor.ClassID 121 id = Editor.ClassID
122 elif _class.isProtected(): 122 elif _class.isProtected():
123 id = Editor.ClassProtectedID 123 id = Editor.ClassProtectedID
124 else: 124 else:
125 id = Editor.ClassPrivateID 125 id = Editor.ClassPrivateID
126 self.api.append('{0}{1}?{2:d}({3})'.format( 126 self.api.append(
127 self.moduleName, _class.name, id, 127 '{0}{1}?{2:d}({3})'.format(
128 ', '.join(_class.methods['__init__'].parameters[1:]))) 128 self.moduleName, _class.name, id,
129 ', '.join(_class.methods['__init__'].parameters[1:])))
129 130
130 classNameStr = "{0}{1}.".format(self.moduleName, className) 131 classNameStr = "{0}{1}.".format(self.moduleName, className)
131 for method in methods: 132 for method in methods:
132 if not self.__isPrivate(_class.methods[method]): 133 if not self.__isPrivate(_class.methods[method]):
133 if _class.methods[method].isPublic(): 134 if _class.methods[method].isPublic():
134 id = Editor.MethodID 135 id = Editor.MethodID
135 elif _class.methods[method].isProtected(): 136 elif _class.methods[method].isProtected():
136 id = Editor.MethodProtectedID 137 id = Editor.MethodProtectedID
137 else: 138 else:
138 id = Editor.MethodPrivateID 139 id = Editor.MethodPrivateID
139 self.api.append('{0}{1}?{2:d}({3})'.format( 140 self.api.append(
140 classNameStr, method, id, 141 '{0}{1}?{2:d}({3})'.format(
141 ', '.join(_class.methods[method].parameters[1:]))) 142 classNameStr, method, id,
143 ', '.join(_class.methods[method].parameters[1:])))
142 144
143 def __addClassVariablesAPI(self, className): 145 def __addClassVariablesAPI(self, className):
144 """ 146 """
145 Private method to generate class api section for class variables. 147 Private method to generate class api section for class variables.
146 148
175 id = Editor.MethodID 177 id = Editor.MethodID
176 elif self.module.functions[funcName].isProtected(): 178 elif self.module.functions[funcName].isProtected():
177 id = Editor.MethodProtectedID 179 id = Editor.MethodProtectedID
178 else: 180 else:
179 id = Editor.MethodPrivateID 181 id = Editor.MethodPrivateID
180 self.api.append('{0}{1}?{2:d}({3})'.format( 182 self.api.append(
181 self.moduleName, self.module.functions[funcName].name, id, 183 '{0}{1}?{2:d}({3})'.format(
182 ', '.join(self.module.functions[funcName].parameters))) 184 self.moduleName, self.module.functions[funcName].name,
185 id,
186 ', '.join(self.module.functions[funcName].parameters)))

eric ide

mercurial