* accessing variables
@ 2012-02-01 18:15 Andreas Müller
2012-02-01 18:16 ` Otavio Salvador
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Andreas Müller @ 2012-02-01 18:15 UTC (permalink / raw)
To: openembedded-core
another stupid question from my side:
do
bb.data.getVar('foo', d, 1)
and
d.getVar('foo', 1)
access the same data?
Thanks in advance
Andreas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: accessing variables
2012-02-01 18:15 accessing variables Andreas Müller
@ 2012-02-01 18:16 ` Otavio Salvador
2012-02-01 22:40 ` Chris Larson
2012-02-01 18:18 ` Joshua Lock
2012-02-01 18:24 ` Martin Jansa
2 siblings, 1 reply; 6+ messages in thread
From: Otavio Salvador @ 2012-02-01 18:16 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 506 bytes --]
On Wed, Feb 1, 2012 at 16:15, Andreas Müller
<schnitzeltony@googlemail.com>wrote:
> another stupid question from my side:
>
> do
>
> bb.data.getVar('foo', d, 1)
>
> and
>
> d.getVar('foo', 1)
>
> access the same data?
>
It does but the later is supported on recent bitbake versions only.
--
Otavio Salvador O.S. Systems
E-mail: otavio@ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
[-- Attachment #2: Type: text/html, Size: 1001 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: accessing variables
2012-02-01 18:15 accessing variables Andreas Müller
2012-02-01 18:16 ` Otavio Salvador
@ 2012-02-01 18:18 ` Joshua Lock
2012-02-01 18:24 ` Martin Jansa
2 siblings, 0 replies; 6+ messages in thread
From: Joshua Lock @ 2012-02-01 18:18 UTC (permalink / raw)
To: openembedded-core
On 01/02/12 10:15, Andreas Müller wrote:
> another stupid question from my side:
>
> do
>
> bb.data.getVar('foo', d, 1)
>
> and
>
> d.getVar('foo', 1)
>
> access the same data?
Yes.
The first is calling the class method and passing in an instance of a
data object, the second is calling the method on the object directly.
Either way you're using the same data object, d.
The latter is more pythonic and we've been slowly moving the code
towards that style.
Also for stylistic reasons please use True/False rather than 1/0 for the
final parameter.
Cheers,
Joshua
--
Joshua Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: accessing variables
2012-02-01 18:15 accessing variables Andreas Müller
2012-02-01 18:16 ` Otavio Salvador
2012-02-01 18:18 ` Joshua Lock
@ 2012-02-01 18:24 ` Martin Jansa
2012-02-01 18:56 ` Andreas Müller
2 siblings, 1 reply; 6+ messages in thread
From: Martin Jansa @ 2012-02-01 18:24 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 686 bytes --]
On Wed, Feb 01, 2012 at 07:15:19PM +0100, Andreas Müller wrote:
> another stupid question from my side:
>
> do
>
> bb.data.getVar('foo', d, 1)
>
> and
>
> d.getVar('foo', 1)
>
> access the same data?
Should be and later is preferred AFAIK, see:
http://git.openembedded.org/openembedded-core/commit/?id=b22831fd63164c4db9c0b72934d7d734a6585251
Cheers,
>
> Thanks in advance
>
> Andreas
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: accessing variables
2012-02-01 18:24 ` Martin Jansa
@ 2012-02-01 18:56 ` Andreas Müller
0 siblings, 0 replies; 6+ messages in thread
From: Andreas Müller @ 2012-02-01 18:56 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Wed, Feb 1, 2012 at 7:24 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
> On Wed, Feb 01, 2012 at 07:15:19PM +0100, Andreas Müller wrote:
>> another stupid question from my side:
>>
>> do
>>
>> bb.data.getVar('foo', d, 1)
>>
>> and
>>
>> d.getVar('foo', 1)
>>
>> access the same data?
>
> Should be and later is preferred AFAIK, see:
> http://git.openembedded.org/openembedded-core/commit/?id=b22831fd63164c4db9c0b72934d7d734a6585251
>
> Cheers,
>
>>
>> Thanks in advance
>>
>> Andreas
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
> --
> Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
>
Thank you for details helping me understanding what's going on :)
Andreas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: accessing variables
2012-02-01 18:16 ` Otavio Salvador
@ 2012-02-01 22:40 ` Chris Larson
0 siblings, 0 replies; 6+ messages in thread
From: Chris Larson @ 2012-02-01 22:40 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Wed, Feb 1, 2012 at 11:16 AM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> On Wed, Feb 1, 2012 at 16:15, Andreas Müller <schnitzeltony@googlemail.com>
> wrote:
>>
>> another stupid question from my side:
>>
>> do
>>
>> bb.data.getVar('foo', d, 1)
>>
>> and
>>
>> d.getVar('foo', 1)
>>
>> access the same data?
>
>
> It does but the later is supported on recent bitbake versions only.
This is wrong. It's been supported since the first checkin of
data_smart.py in 2005. We just used the other one as a potential
separation of public api and private implementation. We have since
changed our minds and realized that we could just as easily replace
the object with something else which conforms to this API.
--
Christopher Larson
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-02-01 22:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-01 18:15 accessing variables Andreas Müller
2012-02-01 18:16 ` Otavio Salvador
2012-02-01 22:40 ` Chris Larson
2012-02-01 18:18 ` Joshua Lock
2012-02-01 18:24 ` Martin Jansa
2012-02-01 18:56 ` Andreas Müller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.