Hello,

Considering the following code snippet variants of a recipe which does
the same job, I would like to clarify certain doubts regarding this.

python __anonymous () {
        pn_split = d.getVar('PN', True).split('-')
        ...
}

python __anonymous () {
        import bb
        pn_split = bb.data.getVar('PN', d, True).split('-')
        ...
}

In some .bbclass, 'bb' library is used without importing it. I find that
the 'd' variable is an instance of DataSmart class in the bitbake
library. Will this 'bb' and 'd' variables be available to all python
tasks and functions? 

I also find that in global python functions such as 'get_imagecmds'
defined in image_types.bbclass 'd' is got as a parameter. Can someone
explain when the 'd' will be initialized? Will the instance of DataSmart
(i.e the variable 'd') in bbclass differ from that of the recipe which
inherited that class? In bitbake manual, example of global python
functions are shown as accepting 'bb' and 'd' variables as its
parameters. Can someone explain the right way of doing this.

Thank you

-- 
Joshua Immanuel
HiPro IT Solutions Private Limited
http://hipro.co.in

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to