Did I find the right examples for you? yes no

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
Generate an HTML representation of a docstring in a really boring
way.

        def boringDocstring(doc):
    """Generate an HTML representation of a docstring in a really boring
    way."""
    # inspect.getdoc requires an object with a __doc__ attribute, not
    # just a string :-(
    if doc is None or not doc.strip():
        return '
Undocumented
' def crappit(): pass crappit.__doc__ = doc return '
%s
' % inspect.getdoc(crappit)


src/p/y/pydoctor-0.5/pydoctor/test/test_formatting.py   pydoctor(Download)
def test_boringDocstring():
    assert html.boringDocstring('Woot\nYeah') == '<pre>Woot\nYeah</pre>'
 
def test_reallyBoringDocstring():
    undocced = '<pre class="undocumented">Undocumented</pre>'
    assert html.boringDocstring('') == undocced
    assert html.boringDocstring(None) == undocced