Where are bitbake python functions documented

ELO picture ELO · Jul 16, 2014 · Viewed 11.2k times · Source

I'm trying to find documentation for "bb.utils.contains". I found the code in pokey/bitbake/lib/utils.py, but that code is poorly documented. For instance, it takes a parameter named "d". What is "d"? How do you even get started with a short non-descriptive name like that?

I've downloaded and searched all the yocto and poky documents, and performed a number of web searches, to no avail.

Does anybody know of a good reference to the built in bitbake python utilities?

Answer

Fl0v0 picture Fl0v0 · Sep 7, 2016

The best documentation i could find were the docstrings in the code itself. See here: https://github.com/openembedded/bitbake/blob/master/lib/bb/utils.py#L974

def contains(variable, checkvalues, truevalue, falsevalue, d):
    """Check if a variable contains all the values specified.
      Arguments:
        variable -- the variable name. This will be fetched and expanded (using
          d.getVar(variable, True)) and then split into a set().
        checkvalues -- if this is a string it is split on whitespace into a set(),
          otherwise coerced directly into a set().
        truevalue -- the value to return if checkvalues is a subset of variable.
        falsevalue -- the value to return if variable is empty or if checkvalues is
          not a subset of variable.
        d -- the data store.
    """