Did I find the right examples for you? yes no

All Samples(988)  |  Call(942)  |  Derive(0)  |  Import(46)
Get the documentation string for an object.

All tabs are expanded to spaces.  To clean up docstrings that are
indented to line up with blocks of code, any whitespace than can be
uniformly removed from the second line onwards is removed.

        def getdoc(object):
    """Get the documentation string for an object.

    All tabs are expanded to spaces.  To clean up docstrings that are
    indented to line up with blocks of code, any whitespace than can be
    uniformly removed from the second line onwards is removed."""
    try:
        doc = object.__doc__
    except AttributeError:
        return None
    if not isinstance(doc, types.StringTypes):
        return None
    return cleandoc(doc)
        


src/m/o/modern-python-example-HEAD/lib/python2.7/site-packages/pep8.py   modern-python-example(Download)
        args = inspect.getargspec(function)[0]
        if args and args[0].startswith(argument_name):
            codes = ERRORCODE_REGEX.findall(inspect.getdoc(function) or '')
            for code in codes or ['']:
                if not code or not ignore_code(code):

src/s/a/sampledoc-HEAD/sphinxext/docscrape.py   sampledoc(Download)
    def __init__(self, func, role='func', doc=None):
        self._f = func
        self._role = role # e.g. "func" or "meth"
        if doc is None:
            doc = inspect.getdoc(func) or ''

src/c/i/circuits-3.0.0.dev/examples/web/wiki/macros/utils.py   circuits(Download)
"""
 
from inspect import getdoc
 
 
def macros(macro, environ, *args, **kwargs):
    """Return a list of available macros"""
 
    macros = environ["macros"].items()
    s = "\n".join(["== %s ==\n%s\n" % (k, getdoc(v)) for k, v in macros])

src/g/a/gae-twitter-oauth-example-HEAD/werkzeug/script.py   gae-twitter-oauth-example(Download)
def analyse_action(func):
    """Analyse a function."""
    description = inspect.getdoc(func) or 'undocumented action'
    arguments = []
    args, varargs, kwargs, defaults = inspect.getargspec(func)

src/b/e/behave.example-HEAD/bin/toxcmd.py   behave.example(Download)
    def description(self):
        return inspect.getdoc(self.func)
 
    def __call__(self, args):
        return self.func(args)
 
    # -- STEP: Build command-line parser.
    parser = argparse.ArgumentParser(description=inspect.getdoc(toxcmd_main),
                                     formatter_class=FORMATTER_CLASS)
    common_parser = parser.add_argument_group("Common options")

src/s/p/Spherebot-Host-GUI-HEAD/InkscapePortable/App/Inkscape/python/Lib/site-packages/numpy/lib/utils.py   Spherebot-Host-GUI(Download)
 
        print >> output, " " + argstr + "\n"
        print >> output, inspect.getdoc(object)
 
    elif inspect.isclass(object):
 
        print >> output, " " + argstr + "\n"
        doc1 = inspect.getdoc(object)
        if doc1 is None:
            if hasattr(object,'__init__'):
                print >> output, inspect.getdoc(object.__init__)
        else:
            print >> output, inspect.getdoc(object)
                thisobj = getattr(object, meth, None)
                if thisobj is not None:
                    methstr, other = pydoc.splitdoc(inspect.getdoc(thisobj) or "None")
                print >> output, "  %s  --  %s" % (meth, methstr)
 

src/e/i/einstein-HEAD/Python25Einstein/Lib/site-packages/numpy/lib/utils.py   einstein(Download)
 
        print >> output, " " + argstr + "\n"
        print >> output, inspect.getdoc(object)
 
    elif inspect.isclass(object):
 
        print >> output, " " + argstr + "\n"
        doc1 = inspect.getdoc(object)
        if doc1 is None:
            if hasattr(object,'__init__'):
                print >> output, inspect.getdoc(object.__init__)
        else:
            print >> output, inspect.getdoc(object)
                thisobj = getattr(object, meth, None)
                if thisobj is not None:
                    methstr, other = pydoc.splitdoc(inspect.getdoc(thisobj) or "None")
                print >> output, "  %s  --  %s" % (meth, methstr)
 

src/m/i/MissionPlanner-HEAD/Lib/site-packages/numpy/lib/utils.py   MissionPlanner(Download)
 
        print >> output, " " + argstr + "\n"
        print >> output, inspect.getdoc(object)
 
    elif inspect.isclass(object):
 
        print >> output, " " + argstr + "\n"
        doc1 = inspect.getdoc(object)
        if doc1 is None:
            if hasattr(object,'__init__'):
                print >> output, inspect.getdoc(object.__init__)
        else:
            print >> output, inspect.getdoc(object)
                thisobj = getattr(object, meth, None)
                if thisobj is not None:
                    methstr, other = pydoc.splitdoc(inspect.getdoc(thisobj) or "None")
                print >> output, "  %s  --  %s" % (meth, methstr)
 

src/n/u/nupic-linux64-HEAD/lib64/python2.6/site-packages/numpy/lib/utils.py   nupic-linux64(Download)
 
        print >> output, " " + argstr + "\n"
        print >> output, inspect.getdoc(object)
 
    elif inspect.isclass(object):
 
        print >> output, " " + argstr + "\n"
        doc1 = inspect.getdoc(object)
        if doc1 is None:
            if hasattr(object,'__init__'):
                print >> output, inspect.getdoc(object.__init__)
        else:
            print >> output, inspect.getdoc(object)
                thisobj = getattr(object, meth, None)
                if thisobj is not None:
                    methstr, other = pydoc.splitdoc(inspect.getdoc(thisobj) or "None")
                print >> output, "  %s  --  %s" % (meth, methstr)
 

src/j/i/jinja24doc-1.1.0/jinja24doc.py   jinja24doc(Download)
from jinja2 import Environment, FileSystemLoader, Undefined
from traceback import format_exception
from inspect import getargspec, getdoc, getmembers, getsource, formatargspec, \
        isfunction, ismethod, isclass, ismodule, \
        ismethoddescriptor, isgetsetdescriptor
    doc = []
    # TODO: third parameter could be tuple of author, date and version
    doc.append(('module', module.__name__, None, getdoc(module) or '' ))
    for name, item in getmembers(module):
        if isclass(item):                       # module classes
                        _str(item.__name__),                            # name
                        None,                                           # args
                        _str(getdoc(item) or '')))                      # doc
 
            for nm, it in getmembers(item):     # class members
                                        _str(it.__name__),                  # name
                            formatargspec(args, vargs, kwords, defaults),   # args
                            getdoc(it) or ''))                              # doc
                    except:
                        pass
                                        _str(nm),                           # name
                            (bool(it.fget), bool(it.fset), bool(it.fdel)),  # property info
                            getdoc(it) or ''))                              # doc
                # elif isbuiltin(it):    <- __new__, __subclasshook__
                else:

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next