2017-05-11, 18:25
(2017-05-10, 21:02)BobCratchett Wrote:(2017-05-10, 20:42)Jeroen Wrote:(2017-05-10, 18:33)BobCratchett Wrote: Never tried, but possibly:
Code:'True' if WidgetLayout in ['value1', 'value2'] else 'False'
Guaranteed to work would be the long-hand:
Code:'True' if WidgetLayout == 'value1' else 'True' if WidgetLayout == 'value2' else 'False'
Could only get the longhand to work, but that's totally fine, this will save me yet some more blocks of code Cheers
As much as I love the fact that templates are - afaik - the first chance for skinners to use a little bit of Python, its worth saying you could probably do what you want without Python, too:
Code:<property name="layout" tag="property" attribute="name|WidgetLayout" value="value1">True</property>
<property name="layout" tag="property" attribute="name|WidgetLayout" value="value2">True</property>
<property name="layout">False</property>
The real advantage to using Python would be if you didn't always want the value to be True or False based on the same conditions every time....
Yup, that's a way I have been using too. I just saw an opportunity to take a different approach where using python seemed to come in handy. It didn't work out eventually (not because of the python bit), but it is knowledge gained that could pay out later
Apart from that, it's nice to try new things. I am planning to see if I can use Python to make the process of determining which widget uses which type of art smarter
And being able to use basic calculations is a blessing I wish we could enjoy everywhere in Kodi