On Wed, 2018-09-05 at 16:11 +0800, Robert Yang wrote: > On 09/05/2018 03:33 PM, Peter Kjellerstedt wrote: > > > > > Put it together with ifelse() and conditional() instead, where it > > better > > belongs. > > > > You can also implement it as: > > > > def vartrue(var, iftrue, iffalse, d): > > import oe.types > > return oe.utils.ifelse(oe.types.boolean(d.getVar(var), iftrue, > > iffalse): > > Then we need import oe.utils, and I don't think that it's easier to > read than: > > + > +def vartrue(var, iftrue, iffalse, d): > + import oe.types > + if oe.types.boolean(d.getVar(var)): > + return iftrue > + else: > + return iffalse
I think Robert's version is easier to read, the addition of the other function doesn't really add much. It probably should live alongside the other varients in the file though. Cheers, Richard -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core