From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Alex DAMIAN <alexandru.damian@intel.com>
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH 5/7] bitbake: cooker, command: add a command to return global data
Date: Mon, 16 Sep 2013 14:54:25 +0100 [thread overview]
Message-ID: <1379339665.3484.307.camel@ted> (raw)
In-Reply-To: <6614ca8b4786486ae3a58e78ca0c40b131c6ff57.1379338189.git.alexandru.damian@intel.com>
On Mon, 2013-09-16 at 14:33 +0100, Alex DAMIAN wrote:
> From: Alexandru DAMIAN <alexandru.damian@intel.com>
>
> Adding the 'getAllKeysWithFlags' read-only command that will
> return a dump of the global data state, together with specified
> flags for each key. The flag list is passed in as the first
> parameter to the command.
>
> This will be used by UI clients to get the build configuration.
>
> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
> ---
> bitbake/lib/bb/command.py | 8 ++++++++
> bitbake/lib/bb/cooker.py | 15 +++++++++++++++
> 2 files changed, 23 insertions(+)
>
> diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
> index f1abaf7..5d359e7 100644
> --- a/bitbake/lib/bb/command.py
> +++ b/bitbake/lib/bb/command.py
> @@ -145,6 +145,14 @@ class CommandsSync:
> """
> command.cooker.shutdown(True)
>
> + def getAllKeysWithFlags(self, command, params):
> + """
> + Returns a dump of the global state. Call with
> + variable flags to be retrieved as params.
> + """
> + return command.cooker.getAllKeysWithFlags(params[0])
> + getAllKeysWithFlags.readonly = True
Please match the style of the other commands, i.e.:
+ flaglist = params[0]
+
+ return command.cooker.getAllKeysWithFlags(flaglist)
which then indicates what params[0] actually is. We spell this out in
the functions so people can look at the commands and get some idea of
how to use them without having to look at the code itself.
> def getVariable(self, command, params):
> """
> Read the value of a variable from data
> diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
> index cb0e3e5..981379b 100644
> --- a/bitbake/lib/bb/cooker.py
> +++ b/bitbake/lib/bb/cooker.py
> @@ -1134,6 +1134,21 @@ class BBCooker:
>
> self.configuration.server_register_idlecallback(buildTargetsIdle, rq)
>
> +
> + def getAllKeysWithFlags(self, flaglist):
> + dump = {}
> + for k in self.data.keys():
> + try:
> + v = self.data.getVar(k, True)
> + if not k.startswith("__") and not bool(self.data.getVarFlag(k, 'func')) and not isinstance(v, bb.data_smart.DataSmart):
Please get rid of the "not bool(self.data.getVarFlag(k, 'func')" and
filter your results on the other side of the connection if you need to
do that (you can request the func flag too).
> + dump[k] = { 'v' : v }
> + for d in flaglist:
> + dump[k][d] = self.data.getVarFlag(k, d)
> + except:
which exceptions are we worried about here? Lets be specific please.
> + pass
> + return dump
> +
> +
> def generateNewImage(self, image, base_image, package_queue, timestamp, description):
> '''
> Create a new image with a "require"/"inherit" base_image statement
next prev parent reply other threads:[~2013-09-16 13:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-16 13:32 [PATCH v3 0/7] webhob related changes in bitbake, version 3 Alex DAMIAN
2013-09-16 13:33 ` [PATCH 1/7] bitbake: cooker: clean up code and avoid duplication Alex DAMIAN
2013-09-16 13:33 ` [PATCH 2/7] bitbake: event: send the task dependency tree to UI Alex DAMIAN
2013-09-16 15:32 ` Richard Purdie
2013-09-16 13:33 ` [PATCH 3/7] bitbake: runqueue: add runQueueTaskSkipped event Alex DAMIAN
2013-09-16 14:24 ` Richard Purdie
2013-09-16 14:32 ` Damian, Alexandru
2013-09-16 15:23 ` Richard Purdie
2013-09-16 13:33 ` [PATCH 4/7] bitbake: cooker: add extra recipe information Alex DAMIAN
2013-09-16 14:10 ` Richard Purdie
2013-09-16 13:33 ` [PATCH 5/7] bitbake: cooker, command: add a command to return global data Alex DAMIAN
2013-09-16 13:54 ` Richard Purdie [this message]
2013-09-16 13:33 ` [PATCH 6/7] bitbake: event: adding events to allow bbclasses to push custom info Alex DAMIAN
2013-09-16 13:46 ` Richard Purdie
2013-09-16 13:56 ` Damian, Alexandru
2013-09-16 15:20 ` Richard Purdie
2013-09-16 13:33 ` [PATCH 7/7] bitbake: runqueue: add task hash to Queue events Alex DAMIAN
-- strict thread matches above, loose matches on Subject: below --
2013-09-18 12:15 [PATCH 1/7] bitbake: cooker, xmlrpc, servers: implement CookerFeatures Alex DAMIAN
2013-09-18 12:15 ` [PATCH 0/7] Adding Bitbake support for WebHob Alex DAMIAN
2013-09-18 12:15 ` [PATCH 5/7] bitbake: cooker, command: add a command to return global data Alex DAMIAN
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=1379339665.3484.307.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=alexandru.damian@intel.com \
--cc=bitbake-devel@lists.openembedded.org \
/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.