Split a doc string into a synopsis line (if any) and the rest.
(doc)
| 189 | return result and re.sub('^ *\n', '', result.rstrip()) or '' |
| 190 | |
| 191 | def splitdoc(doc): |
| 192 | """Split a doc string into a synopsis line (if any) and the rest.""" |
| 193 | lines = doc.strip().split('\n') |
| 194 | if len(lines) == 1: |
| 195 | return lines[0], '' |
| 196 | elif len(lines) >= 2 and not lines[1].rstrip(): |
| 197 | return lines[0], '\n'.join(lines[2:]) |
| 198 | return '', '\n'.join(lines) |
| 199 | |
| 200 | def classname(object, modname): |
| 201 | """Get a class name and qualify it with a module name if necessary.""" |