Produce text documentation for a data object.
(self, object, name=None, mod=None, parent=None, *ignored,
maxlen=None, doc=None)
| 1655 | docproperty = docdata |
| 1656 | |
| 1657 | def docother(self, object, name=None, mod=None, parent=None, *ignored, |
| 1658 | maxlen=None, doc=None): |
| 1659 | """Produce text documentation for a data object.""" |
| 1660 | repr = self.repr(object) |
| 1661 | if maxlen: |
| 1662 | line = (name and name + ' = ' or '') + repr |
| 1663 | chop = maxlen - len(line) |
| 1664 | if chop < 0: repr = repr[:chop] + '...' |
| 1665 | line = (name and self.bold(name) + ' = ' or '') + repr |
| 1666 | if not doc: |
| 1667 | doc = getdoc(object) |
| 1668 | if doc: |
| 1669 | line += '\n' + self.indent(str(doc)) + '\n' |
| 1670 | return line |
| 1671 | |
| 1672 | class _PlainTextDoc(TextDoc): |
| 1673 | """Subclass of TextDoc which overrides string styling""" |