[yocto] default variables in a python task/function
Joshua Immanuel
josh at hipro.co.in
Sun Jun 24 23:18:24 PDT 2012
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.
>
> E.g.
>
> 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.
Regards
--
Joshua Immanuel
HiPro IT Solutions Private Limited
http://hipro.co.in
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20120625/e8222055/attachment.pgp>
More information about the yocto
mailing list