137 extracted function information. |
138 extracted function information. |
138 |
139 |
139 @param functionInfo reference to the function info object |
140 @param functionInfo reference to the function info object |
140 @type FunctionInfo |
141 @type FunctionInfo |
141 @param docstringType kind of docstring to be generated |
142 @param docstringType kind of docstring to be generated |
|
143 @type str |
142 @return list of docstring lines |
144 @return list of docstring lines |
143 @rtype str |
145 @rtype str |
144 """ |
146 """ |
145 generatorModuleMapping = { |
147 generatorModuleMapping = { |
146 "ericdoc": ".EricdocGenerator", |
148 "ericdoc": ".EricdocGenerator", |
147 "numpydoc": ".NumpydocGenerator", |
149 "numpydoc": ".NumpydocGenerator", |
148 "goodledoc": ".GoogledocGenerator", |
150 "goodledoc": ".GoogledocGenerator", |
149 "sphinxdoc": ".SphinxdocGenerator", |
151 "sphinxdoc": ".SphinxdocGenerator", |
150 } |
152 } |
151 if docstringType in generatorModuleMapping: |
153 with contextlib.suppress(KeyError): |
152 mod = importlib.import_module( |
154 mod = importlib.import_module( |
153 generatorModuleMapping[docstringType], __package__ |
155 generatorModuleMapping[docstringType], __package__ |
154 ) |
156 ) |
155 return mod.generateDoc(functionInfo, self.editor) |
157 return mod.generateDoc(functionInfo, self.editor) |
156 |
158 |