[Openembedded-architecture] Building a common framework for all commands inside the scripts folder
Ibarra Lopez, Humberto
humberto.ibarra.lopez at intel.com
Sat May 14 19:46:29 UTC 2016
Hi,
I write this because I am working in a few bugs that might be better with a higher implementation. The bugs are #8938<https://bugzilla.yoctoproject.org/show_bug.cgi?id=8938>, #8321<https://bugzilla.yoctoproject.org/show_bug.cgi?id=8321>, #9563<https://bugzilla.yoctoproject.org/show_bug.cgi?id=9563>, #9564<https://bugzilla.yoctoproject.org/show_bug.cgi?id=9564>, #9634<https://bugzilla.yoctoproject.org/show_bug.cgi?id=9634>, #9635<https://bugzilla.yoctoproject.org/show_bug.cgi?id=9635> and #9636<https://bugzilla.yoctoproject.org/show_bug.cgi?id=9636>; the first one is about reorganizing oe-selftest options while the rest are related to refactoring optparse to argparse in other commands.
I have gone through these problems and I noticed that there doesn't seem to be a common ground in implementing commands in the scripts folder. I mean, some of them use scripts/lib/argparse_oe but not all of them, most of the commands work with subcommands but they have different implementations of this. Even if yocto-bsp and oe-selftest don't have much in common they can still use the same framework to implement subcommands and argument handling.
What I think would be the best way to go, is to have a command.py inside scripts/lib to handle all of this. This command.py could make use of the already existing scripts/lib/argparse_oe.py. At the end , the goal would be not only to have all python commands in scripts/ to implement command.py but to have solid guidelines; in this way every time someone wants to add a new command in this folder he/she doesn't end re-implementing the whole thing again.
Bitbake already does something similar with bitbake/lib/bb/command.py, and even when the scripts folder can't use the same file, it can pretty much have its own framework that solves its own needs.
About the guidelines part, not sure how to make everyone aware of things like this, there doesn't seem to be a place that fulfills this need other than the wiki. Unfortunately, not everyone is going to look at the wiki before adding a new command. Probably this requires a different thread to be discussed.
That would be all I had to ask. If a common framework for commands inside scripts folder makes sense we can move forward with it, otherwise I could just go on a solve these defects on a command by command basis. Thanks, and I'll wait for your opinion on this.
Regards
Humberto Ibarra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-architecture/attachments/20160514/9728b19a/attachment-0002.html>
More information about the Openembedded-architecture
mailing list