Portal:Python >> TestTableTestData >> TestTableFieldTypes >> TestTable2 >> ThunderbirdInstall 

TB Wiki

Login

TestTableFieldColors in split format

This page has a test of field colors:
This page has a test of field colors:

Test simple text values [edit section]

= Test simple text values ={{{TextColorData||text||color||||yes||should be green||||no||should be red||||maybe||should be yellow||||another line||should have no color||}}}
{{{#!Tablesource_spec=#:TextColorDatafield=textcolors="""yes:greenno:redmaybe:yellow"""}}}

Test color expressions on integers [edit section]

= Test color expressions on integers ={{{IntColorData||integer||color||||5||should be light yellow||||10||should be yellow||||20||should be yellow||||50||no color||||100||no color||||600||should be red||||1000||should be red||}}}
{{{#!Tablesource_spec=#:IntColorDatafield=integercolors="""(int(value)<10):ffffd0(int(value)>=10 and int(value)<50):ffff80(int(value)>500):ffd0d0"""}}}

Test some other expressions [edit section]

= Test some other expressions =
This tests use of 'in' and 'startswith'as well as empty lines in the colors list.
This tests use of 'in' and 'startswith'as well as empty lines in the colors list.
FruitData||fruit||||apple||||banana||||avacado||}}}
{{{FruitData||fruit||||apple||||banana||||avacado||}}}
{{{#!Tablesource_spec=#:FruitDatafield=fruitcolors="""apple:red
(value in ["lemon", "banana"]):yellow
(value in ["lemon", "banana"]):yellow
(value.startswith("av")):green"""
(value.startswith("av")):green"""
}}}
}}}
TBWiki engine 1.9.3 by Tim Bird