<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ES-MX" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">I write this because I am working in a few bugs that might be better with a higher implementation. The bugs are #<a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=8938">8938</a>, #<a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=8321">8321</a>,
#<a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=9563">9563</a>, #<a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=9564">9564</a>, #<a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=9634">9634</a>, #<a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=9635">9635</a>
and #<a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=9636">9636</a>; the first one is about reorganizing oe-selftest options while the rest are related to refactoring optparse to argparse in other commands.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:ES-MX"><br>
<br>
</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Regards</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Humberto Ibarra</span><span style="color:windowtext"><o:p></o:p></span></p>
</div>
</body>
</html>