Re: [yocto] Inline Python function name define

2016-02-10 Thread Christopher Larson
def foo(d):
# Do something

FOO = "${@foo(d)}"

On Wed, Feb 10, 2016 at 12:02 PM Xi Zhou Zhou 
wrote:

> Hi,
>
> I want to manipulate a variable with inline python function in a recipe.
> The code is something like this.
>
> python newpv() {
> return 999
> }
>
> PV = "${@newpv()}"
>
>
> The error is "name 'newpv' is not defined"
>
> ERROR: ExpansionError during parsing /home/joelz/poky/build/
> ../meta-test/recipes-bsp/mytest/mytest.bb: Failure expanding variable PV,
> expression was ${@newpv()} which triggered exception NameError: name
> 'newpv' is not defined
>
>
> What's the right way to create inline python function in Yocto recipe?
>
>
> Thanks,
> Joel
> --
> ___
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] Inline Python function name define

2016-02-10 Thread Xi Zhou Zhou
Hi,

I want to manipulate a variable with inline python function in a recipe.
The code is something like this.

python newpv() {
return 999
}

PV = "${@newpv()}"


The error is "name 'newpv' is not defined"

ERROR: ExpansionError during parsing /home/joelz/poky/build/
../meta-test/recipes-bsp/mytest/mytest.bb: Failure expanding variable PV,
expression was ${@newpv()} which triggered exception NameError: name 'newpv'
is not defined


What's the right way to create inline python function in Yocto recipe?


Thanks,
Joel
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] Inline Python function name define

2016-02-10 Thread Xi Zhou Zhou
The code works for me.


Thanks,
Joel

On Wed, Feb 10, 2016 at 2:04 PM, Christopher Larson 
wrote:

> def foo(d):
> # Do something
>
> FOO = "${@foo(d)}"
>
> On Wed, Feb 10, 2016 at 12:02 PM Xi Zhou Zhou 
> wrote:
>
>> Hi,
>>
>> I want to manipulate a variable with inline python function in a recipe.
>> The code is something like this.
>>
>> python newpv() {
>> return 999
>> }
>>
>> PV = "${@newpv()}"
>>
>>
>> The error is "name 'newpv' is not defined"
>>
>> ERROR: ExpansionError during parsing /home/joelz/poky/build/
>> ../meta-test/recipes-bsp/mytest/mytest.bb: Failure expanding variable
>> PV, expression was ${@newpv()} which triggered exception NameError: name
>> 'newpv' is not defined
>>
>>
>> What's the right way to create inline python function in Yocto recipe?
>>
>>
>> Thanks,
>> Joel
>> --
>> ___
>> yocto mailing list
>> yocto@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
>>
>
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto