All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: Steffen Sledz <sledz@dresearch-fe.de>
Cc: openembedded-devel@lists.openembedded.org
Subject: Re: Use python in variable assigment of a recipe
Date: Tue, 28 Feb 2012 13:28 +0000	[thread overview]
Message-ID: <19009938.gXoWXZHh4x@helios> (raw)
In-Reply-To: <4F4CC45C.8010501@dresearch-fe.de>

On Tuesday 28 February 2012 13:11:08 Steffen Sledz wrote:
> Because i'm working with oe-classic i tried this (found in some other
> examples):
> 
>   MYVAR = "${@my_func()}"
> 
>   def my_func():
>       bbpath = os.path.dirname(bb.data.getVar('FILE',d,1))
>       ...
> 
> But this leads to an error:
> 
>   NameError: global name 'd' is not defined

If you pass in d it should work, i.e.:

   MYVAR = "${@my_func(d)}"
 
   def my_func(d):
       bbpath = os.path.dirname(bb.data.getVar('FILE',d,1))

BTW, d.getVar() should work fine in OE-Classic (or to be fully correct, it 
should work fine with older versions of bitbake).

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



  reply	other threads:[~2012-02-28 13:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-28  9:26 Use python in variable assigment of a recipe Steffen Sledz
2012-02-28  9:55 ` Paul Eggleton
2012-02-28 12:11   ` Steffen Sledz
2012-02-28 13:28     ` Paul Eggleton [this message]
2012-02-28 13:33     ` Phil Blundell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19009938.gXoWXZHh4x@helios \
    --to=paul.eggleton@linux.intel.com \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=sledz@dresearch-fe.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.