[Scons-users] ListVariables

Mats Wichmann mats at wichmann.us
Mon Jul 24 15:23:19 EDT 2017


On 07/24/2017 01:06 PM, Bill Deegan wrote:
> It looks like SCons is doing the right thing, even thought the output is
> confusing.
> Here's the __str__ method for ListVariable()
> 
> def __str__(self):
>     if len(self) == 0:
>         return 'none'
>     self.data.sort()
>     if self.data == self.allowedElems:
>         return 'all'
>     else:
>         return ','.join(self)
> 
> Note the "return all" when it detects that all allowed options are selected.

Neat. So it turns it back into none and all as part of the string
representation for printing, which obscured that the right thing
happened. Never thought of that.  Teach me to use print() for debugging :)

Thanks!



More information about the Scons-users mailing list