Given an object or a path to an object, get the object and its name.
(thing, forceload=0)
| 1742 | html = HTMLDoc() |
| 1743 | |
| 1744 | def resolve(thing, forceload=0): |
| 1745 | """Given an object or a path to an object, get the object and its name.""" |
| 1746 | if isinstance(thing, str): |
| 1747 | object = locate(thing, forceload) |
| 1748 | if object is None: |
| 1749 | raise ImportError('''\ |
| 1750 | No Python documentation found for %r. |
| 1751 | Use help() to get the interactive help utility. |
| 1752 | Use help(str) for help on the str class.''' % thing) |
| 1753 | return object, thing |
| 1754 | else: |
| 1755 | name = getattr(thing, '__name__', None) |
| 1756 | return thing, name if isinstance(name, str) else None |
| 1757 | |
| 1758 | def render_doc(thing, title='Python Library Documentation: %s', forceload=0, |
| 1759 | renderer=None): |
no test coverage detected