A simple class to contain function details. Composed of a "keyword", a possibly empty "header" string, and a possibly empty list of key-value pair "items".
| 509 | |
| 510 | |
| 511 | class _FunctionDetail( |
| 512 | collections.namedtuple('_FunctionDetail', ['keyword', 'header', 'items'])): |
| 513 | """A simple class to contain function details. |
| 514 | |
| 515 | Composed of a "keyword", a possibly empty "header" string, and a possibly |
| 516 | empty |
| 517 | list of key-value pair "items". |
| 518 | """ |
| 519 | __slots__ = [] |
| 520 | |
| 521 | def __str__(self): |
| 522 | """Return the original string that represents the function detail.""" |
| 523 | parts = [self.keyword + ':\n'] |
| 524 | parts.append(self.header) |
| 525 | for key, value in self.items: |
| 526 | parts.append(' ' + key + ': ') |
| 527 | parts.append(value) |
| 528 | |
| 529 | return ''.join(parts) |
| 530 | |
| 531 | |
| 532 | def _parse_function_details(docstring): |
no outgoing calls
no test coverage detected