Split a doc string into a synopsis line (if any) and the rest.
(doc)
| 140 | return result and re.sub('^ *\n', '', result.rstrip()) or '' |
| 141 | |
| 142 | def splitdoc(doc): |
| 143 | """Split a doc string into a synopsis line (if any) and the rest.""" |
| 144 | lines = doc.strip().split('\n') |
| 145 | if len(lines) == 1: |
| 146 | return lines[0], '' |
| 147 | elif len(lines) >= 2 and not lines[1].rstrip(): |
| 148 | return lines[0], '\n'.join(lines[2:]) |
| 149 | return '', '\n'.join(lines) |
| 150 | |
| 151 | def _getargspec(object): |
| 152 | try: |