<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 16, 2013 at 2:46 PM, Richard Purdie <span dir="ltr"><<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">On Mon, 2013-09-16 at 14:33 +0100, Alex DAMIAN wrote:<br>
> From: Alexandru DAMIAN <<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a>><br>
><br>
> We add a new event that will be triggered by the<br>
> package-building class, containing the information<br>
> about the currently built package.<br>
><br>
> Adding an event that will passi information about the<br>
> content of each package file that gets built.<br>
><br>
> Knotty UI will ignore these events by default.<br>
><br>
> Maybe a mechanism for using a single generic event is in order ?<br>
><br>
> Signed-off-by: Alexandru DAMIAN <<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a>><br>
> ---<br>
> bitbake/lib/bb/event.py | 16 ++++++++++++++++<br>
> bitbake/lib/bb/ui/knotty.py | 2 ++<br>
> 2 files changed, 18 insertions(+)<br>
><br>
> diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py<br>
> index 67cfcea..7dd9236 100644<br>
> --- a/bitbake/lib/bb/event.py<br>
> +++ b/bitbake/lib/bb/event.py<br>
> @@ -589,6 +589,22 @@ class PackageInfo(Event):<br>
> Event.__init__(self)<br>
> self._pkginfolist = pkginfolist<br>
><br>
> +class SinglePackageInfo(Event):<br>
> + """<br>
> + Single Package Information sent on emit_pkgdata<br>
> + """<br>
> + def __init__(self, data):<br>
> + Event.__init__(self)<br>
> + self._data = data<br>
> +<br>
> +class PackageFileSizes(Event):<br>
> + """<br>
> + Event that contains information about the file sizes contained in a package.<br>
> + """<br>
> + def __init__(self, data):<br>
> + Event.__init__(self)<br>
> + self._data = data<br>
> +<br>
> class SanityCheck(Event):<br>
> """<br>
<br>
</div></div>Your explanation in the commit message isn't as detailed as it could<br>
be.<br>
<br>
I'm guessing but I suspect the problem we have is that the event cannot<br>
be rebuilt on the other side of an XMLRPC connection without having the<br>
event class in a common namespace?<br>
<br>
This is therefore a hack to allow the event to exist in all the client<br>
side namespaces.<br></blockquote><div><br></div><div>[Alex] Yep, this is an ugly hack.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Ideally we should really have an API which allows the classes themselves<br>
to declare their event formats and not require adding to event.py every<br>
time a new piece of code/event is added.<br></blockquote><div><br></div><div>[Alex] I would favor a single "GenericEvent" that will take a set of defined parameters,</div><div>that would allow "subclassing" at runtime - sort of introspection if you will.</div>
<div><br></div><div>Something like this:</div><div><span style="color:rgb(80,0,80)"><br></span></div><div><font color="#000000">class GenericInfo(Event):<br></font></div><div><font color="#000000"> def __init__(self, type, data):<br>
Event.__init__(self)</font></div><div><font color="#000000"> self._type = type<br> self._data = data<br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">with a call like</font></div>
<div><font color="#000000"><br></font></div><div><font color="#000000">bb.event.fire(bb.event.GenericInfo("PackageInfo", pkginfolist), e.data)</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">the UI handlers / anybody would subscribe to GenericInfo events, </font></div>
<div><font color="#000000">and the processing code would look like:</font></div><div><br></div><div>if isinstance(event, bb.event.GenericInfo):</div><div> if event._type == <span style="color:rgb(0,0,0)">"PackageInfo":</span></div>
<div><span style="color:rgb(0,0,0)"> savePackageInfo(event)</span></div><div><span style="color:rgb(0,0,0)"> elif event._type == "PackageFileSizes":</span></div><div><span style="color:rgb(0,0,0)"> ....</span></div>
<div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">What do you think ?</span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Presumably there is some change required to OE-Core in order for this<br>
get used to?<br></blockquote><div><br></div><div>The code using the e </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Is the PackageFileSizes not contained in the other event data?<br></blockquote><div><br></div><div>[Alex] Not that I could find.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
I appreciate we allowed PackageInfo in but I didn't like it at the time,<br>
I like it even less now I see we're just going to keep doing this :(.<br>
<div class="im"><br>
> Event to issue sanity check<br>
> diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py<br>
> index 0211b50..03baa75 100644<br>
> --- a/bitbake/lib/bb/ui/knotty.py<br>
> +++ b/bitbake/lib/bb/ui/knotty.py<br>
> @@ -477,6 +477,8 @@ def main(server, eventHandler, params, tf = TerminalFilter):<br>
><br>
> # ignore<br>
> if isinstance(event, (bb.event.BuildBase,<br>
> + bb.event.PackageFileSizes,<br>
> + bb.event.SinglePackageInfo,<br>
> bb.event.StampUpdate,<br>
> bb.event.ConfigParsed,<br>
> bb.event.RecipeParsed,<br>
<br>
<br>
</div>Given the event masking that is now in knotty, do we need to do this?<br>
Can't we remove this block?<br></blockquote><div><br></div><div>[Alex] Yep, it should get removed. I refrained from doing so since it wasn't deleted</div><div>when the subscription code got merged in.</div><div><br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Cheers,<br>
<br>
Richard<br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Alex Damian<div>Yocto Project<br></div><div>SSG / OTC </div></div>
</div></div>