Hi Cristopher,

On Mon, Jun 29, 2015 at 02:48:30PM -0700, Christopher Larson wrote:
> On Mon, Jun 29, 2015 at 12:10 PM, Ed Bartosh <[email protected]>
> wrote:
> 
> > +    global _BITBAKE_VARS
> > +
> > +    if image not in _BITBAKE_VARS:
> >
> 
> In general, I’d suggest using a cache class/object rather than globals,
> similar to how it’s handled in bb.checksum, or a transparent LRU. Whenever
> a cache is involved, it’s best to consider what its lifetime is.
> Admittedly, wic isn’t long-running, but best not to get into bad habits.

Thank you for your comment.

I thought about using a cache class and decided not to do it to keep the
code consistent with the rest of the module. As it was global variable
in the old code my implementation doesn't make the code worse I hope.

As far as I'm happy with test coverage I'll do more serious refactoring
and hopefully implement something better than that.

--
Regards,
Ed
-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to