Given an object or a path to an object, get the object and its name.
(thing, forceload=0)
| 1820 | html = HTMLDoc() |
| 1821 | |
| 1822 | def resolve(thing, forceload=0): |
| 1823 | """Given an object or a path to an object, get the object and its name.""" |
| 1824 | if isinstance(thing, str): |
| 1825 | object = locate(thing, forceload) |
| 1826 | if object is None: |
| 1827 | raise ImportError('''\ |
| 1828 | No Python documentation found for %r. |
| 1829 | Use help() to get the interactive help utility. |
| 1830 | Use help(str) for help on the str class.''' % thing) |
| 1831 | return object, thing |
| 1832 | else: |
| 1833 | name = getattr(thing, '__name__', None) |
| 1834 | return thing, name if isinstance(name, str) else None |
| 1835 | |
| 1836 | def render_doc(thing, title='Python Library Documentation: %s', forceload=0, |
| 1837 | renderer=None): |
no test coverage detected