DocumentationTools/APIGenerator.py

changeset 2989
7efa8b8b6903
parent 2953
703452a2876f
child 3033
58fe260e7469
child 3057
10516539f238
equal deleted inserted replaced
2988:f53c03574697 2989:7efa8b8b6903
22 22
23 def genAPI(self, newStyle, basePackage, includePrivate): 23 def genAPI(self, newStyle, basePackage, includePrivate):
24 """ 24 """
25 Public method to generate the API information. 25 Public method to generate the API information.
26 26
27 @param newStyle flag indicating the api generation for QScintilla 1.7 and 27 @param newStyle flag indicating the api generation for QScintilla 1.7
28 newer (boolean) (ignored) 28 and newer (boolean) (ignored)
29 @param basePackage name of the base package (string) 29 @param basePackage name of the base package (string)
30 @param includePrivate flag indicating to include 30 @param includePrivate flag indicating to include
31 private methods/functions (boolean) 31 private methods/functions (boolean)
32 @return API information (list of strings) 32 @return API information (list of strings)
33 """ 33 """
46 46
47 def genBases(self, includePrivate): 47 def genBases(self, includePrivate):
48 """ 48 """
49 Public method to generate the base classes information. 49 Public method to generate the base classes information.
50 50
51 @param includePrivate flag indicating to include private classes (boolean) 51 @param includePrivate flag indicating to include private classes
52 (boolean)
52 @return base classes information (dictionary of list of strings) 53 @return base classes information (dictionary of list of strings)
53 """ 54 """
54 bases = {} 55 bases = {}
55 self.includePrivate = includePrivate 56 self.includePrivate = includePrivate
56 classNames = sorted(list(self.module.classes.keys())) 57 classNames = sorted(list(self.module.classes.keys()))
86 id = Editor.AttributeID 87 id = Editor.AttributeID
87 elif self.module.globals[globalName].isProtected(): 88 elif self.module.globals[globalName].isProtected():
88 id = Editor.AttributeProtectedID 89 id = Editor.AttributeProtectedID
89 else: 90 else:
90 id = Editor.AttributePrivateID 91 id = Editor.AttributePrivateID
91 self.api.append("{0}{1}?{2:d}".format(moduleNameStr, globalName, id)) 92 self.api.append("{0}{1}?{2:d}".format(
93 moduleNameStr, globalName, id))
92 94
93 def __addClassesAPI(self): 95 def __addClassesAPI(self):
94 """ 96 """
95 Private method to generate the api section for classes. 97 Private method to generate the api section for classes.
96 """ 98 """
137 139
138 def __addClassVariablesAPI(self, className): 140 def __addClassVariablesAPI(self, className):
139 """ 141 """
140 Private method to generate class api section for class variables. 142 Private method to generate class api section for class variables.
141 143
142 @param className name of the class containing the class variables (string) 144 @param className name of the class containing the class variables
145 (string)
143 """ 146 """
144 from QScintilla.Editor import Editor 147 from QScintilla.Editor import Editor
145 148
146 _class = self.module.classes[className] 149 _class = self.module.classes[className]
147 classNameStr = "{0}{1}.".format(self.moduleName, className) 150 classNameStr = "{0}{1}.".format(self.moduleName, className)
151 id = Editor.AttributeID 154 id = Editor.AttributeID
152 elif _class.globals[variable].isProtected(): 155 elif _class.globals[variable].isProtected():
153 id = Editor.AttributeProtectedID 156 id = Editor.AttributeProtectedID
154 else: 157 else:
155 id = Editor.AttributePrivateID 158 id = Editor.AttributePrivateID
156 self.api.append('{0}{1}?{2:d}'.format(classNameStr, variable, id)) 159 self.api.append('{0}{1}?{2:d}'.format(
160 classNameStr, variable, id))
157 161
158 def __addFunctionsAPI(self): 162 def __addFunctionsAPI(self):
159 """ 163 """
160 Private method to generate the api section for functions. 164 Private method to generate the api section for functions.
161 """ 165 """

eric ide

mercurial