139 @type FunctionInfo |
140 @type FunctionInfo |
140 @param docstringType kind of docstring to be generated |
141 @param docstringType kind of docstring to be generated |
141 @return list of docstring lines |
142 @return list of docstring lines |
142 @rtype str |
143 @rtype str |
143 """ |
144 """ |
144 if docstringType == "ericdoc": |
145 generatorModuleMapping = { |
145 from .EricdocGenerator import generateEricDoc # __IGNORE_WARNING_I101__ |
146 "ericdoc": "EricdocGenerator", |
146 |
147 "numpydoc": "NumpydocGenerator", |
147 return generateEricDoc(functionInfo) |
148 "goodledoc": "GoogledocGenerator", |
148 elif docstringType == "numpydoc": |
149 "sphinxdoc": "SphinxdocGenerator", |
149 from .NumpydocGenerator import generateNumpyDoc # __IGNORE_WARNING_I101__ |
150 } |
150 |
151 if docstringType in generatorModuleMapping: |
151 return generateNumpyDoc(functionInfo) |
152 mod = importlib.import_module( |
152 elif docstringType == "googledoc": |
153 "eric7.QScintilla.DocstringGenerator.{0}".format( |
153 from .GoogledocGenerator import generateGoogleDoc # __IGNORE_WARNING_I101__ |
154 generatorModuleMapping[docstringType] |
154 |
155 ) |
155 return generateGoogleDoc(functionInfo, self.editor) |
156 ) |
156 elif docstringType == "sphinxdoc": |
157 return mod.generateDoc(functionInfo, self.editor) |
157 from .SphinxdocGenerator import generateSphinxDoc # __IGNORE_WARNING_I101__ |
158 |
158 |
159 return [] |
159 return generateSphinxDoc(functionInfo) |
|
160 else: |
|
161 return [] |
|
162 |
160 |
163 |
161 |
164 class FunctionInfo: |
162 class FunctionInfo: |
165 """ |
163 """ |
166 Class implementing an object to store function information. |
164 Class implementing an object to store function information. |