Adds a Notes section to an existing docstring.
(initialdoc, note)
| 113 | |
| 114 | |
| 115 | def doc_note(initialdoc, note): |
| 116 | """ |
| 117 | Adds a Notes section to an existing docstring. |
| 118 | |
| 119 | """ |
| 120 | if initialdoc is None: |
| 121 | return |
| 122 | if note is None: |
| 123 | return initialdoc |
| 124 | |
| 125 | notesplit = re.split(r'\n\s*?Notes\n\s*?-----', inspect.cleandoc(initialdoc)) |
| 126 | notedoc = "\n\nNotes\n-----\n%s\n" % inspect.cleandoc(note) |
| 127 | |
| 128 | return ''.join(notesplit[:1] + [notedoc] + notesplit[1:]) |
| 129 | |
| 130 | |
| 131 | def get_object_signature(obj): |