<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=utf-8">
<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:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.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="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Okay, I can make use of scriptutils module for this.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">About that code you mentioned that implements some part of this and that it’s going into bitbake, I can make use of it
for this part but is there a place where I can track this? Does this code have a bug entry in Bugzilla?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Humberto<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><a name="_____replyseparator"></a><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> kergoth@gmail.com [mailto:kergoth@gmail.com]
<b>On Behalf Of </b>Christopher Larson<br>
<b>Sent:</b> Saturday, May 14, 2016 3:45 PM<br>
<b>To:</b> Ibarra Lopez, Humberto <humberto.ibarra.lopez@intel.com><br>
<b>Cc:</b> openembedded-architecture@lists.openembedded.org<br>
<b>Subject:</b> Re: [Openembedded-architecture] Building a common framework for all commands inside the scripts folder<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Sat, May 14, 2016 at 12:46 PM, Ibarra Lopez, Humberto <<a href="mailto:humberto.ibarra.lopez@intel.com" target="_blank">humberto.ibarra.lopez@intel.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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" target="_blank">8938</a>,
#<a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=8321" target="_blank">8321</a>, #<a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=9563" target="_blank">9563</a>, #<a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=9564" target="_blank">9564</a>,
#<a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=9634" target="_blank">9634</a>, #<a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=9635" target="_blank">9635</a> and #<a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=9636" target="_blank">9636</a>;
the first one is about reorganizing oe-selftest options while the rest are related to refactoring optparse to argparse in other commands.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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.</span><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><br>
I think this is the entire purpose of the scriptutils python module, it just doesn't have the argument parsing and command bits yet, but afaik that's supposed to hold the bits common to the various scripts.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Beyond that, this doesn't seem like a terrible idea to me, but we need to account for some slightly different use cases between the commands, and we need to account for the fact that at least some of this (specifically, plugin loading,
and soon some argparse fixes) is already going into bitbake itself, for use by bitbake-layers, so the scripts in oe-core should start leveraging that once its minimum version is bumped.<span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><br>
-- <o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">Christopher Larson<br>
clarson at kergoth dot com<br>
Founder - BitBake, OpenEmbedded, OpenZaurus<br>
Maintainer - Tslib<br>
Senior Software Engineer, Mentor Graphics<span style="color:#1F497D"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>