Re: default variables in a python task/function

Hello Chris,

On Fri, 2012-06-22 at 18:28 -0700, Chris Larson wrote:
'bb' and 'os' are always imported, automatically, by bitbake itself,
and as such are available in all python contexts. 'd' is available in
python tasks and anonymous python functions and in inline python
snippets, but *not* in event handlers. event handlers get their event
passed as 'e'.
Unlike 'bb' and 'os', 'd' is not available in def'd python functions,
only in tasks and anonymous functions and in inline python snippets.
As such, it needs to be passed in by the caller.


def foo(d):
# do something with d

FOO = "${@foo(d)}"
Thanks for your detailed explanation.

IMHO, this information should be added in the main documentation. It
would be definitely helpful for others too.

Joshua Immanuel
HiPro IT Solutions Private Limited

Join to automatically receive all group messages.