[bitbake-devel] [PATCH 05/10] command.py: add parseConfigurationFiles API

Xu, Dongxiao dongxiao.xu at intel.com
Wed Dec 14 00:41:14 UTC 2011


Hi Josh,

> -----Original Message-----
> From: bitbake-devel-bounces at lists.openembedded.org
> [mailto:bitbake-devel-bounces at lists.openembedded.org] On Behalf Of Joshua
> Lock
> Sent: Wednesday, December 14, 2011 12:39 AM
> To: bitbake-devel at lists.openembedded.org
> Subject: Re: [bitbake-devel] [PATCH 05/10] command.py: add
> parseConfigurationFiles API
> 
> On 11/12/11 18:20, Dongxiao Xu wrote:
> > The parseConfigurationFiles API calls the related function in
> > cooker.py to parse config files.
> >
> > Signed-off-by: Dongxiao Xu <dongxiao.xu at intel.com>
> > ---
> >  lib/bb/command.py |   10 ++++++++++
> >  1 files changed, 10 insertions(+), 0 deletions(-)
> >
> > diff --git a/lib/bb/command.py b/lib/bb/command.py index
> > 701b286..6b4a598 100644
> > --- a/lib/bb/command.py
> > +++ b/lib/bb/command.py
> > @@ -326,3 +326,13 @@ class CommandsAsync:
> >          else:
> >              command.finishAsyncCommand()
> >      compareRevisions.needcache = True
> > +
> > +    def parseConfigurationFiles(self, command, params):
> > +        """
> > +        Parse the configuration files
> > +        """
> > +        prefiles = params[0]
> > +        postfiles = params[1]
> 
> Should we be able to use this method without having prefiles and postfiles set
> in the params container?
> 
> A common pattern throughout this module is to check the size of the params
> container [using len(params)] and set appropriate (empty) defaults if all
> required parameters aren't passed.

When calling parseConfigurationFiles(), we must pass the prefiles and postfiles as parameters, although they may be empty strings, for example,

self.server.runCommand(["parseConfigurationFiles", "", ""])

Therefore it is ensured that this API accepts two variables and it is not needed to check the length of parameters.

There are many functions in command.py doing the similar thing, like buildFile, generateDepTreeEvent, etc.

Thanks,
Dongxiao

> 
> Cheers,
> Joshua
> --
> Joshua Lock
>         Yocto Project "Johannes factotum"
>         Intel Open Source Technology Centre
> 
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel




More information about the bitbake-devel mailing list