import os, sys, cdms2, vcs, vcs.testing.regression as regression

dataset = cdms2.open(os.path.join(vcs.sample_data,"clt.nc"))
data = dataset("clt")
canvas = regression.init()
isoline = canvas.createisoline()
isoline.label="y"
texts=[]
colors = []
for i in range(10):
    text = canvas.createtext()
    text.color = 50 + 12 * i
    text.height = 12
    colors.append(100 + 12 * i)
    if i%2 == 0:
      texts.append(text.name)
    else:
      texts.append(text)
isoline.text = texts

# First test using isoline.text[...].color
canvas.plot(data, isoline, bg=1)

baseline = os.path.splitext(sys.argv[1])
baselineImage = "%s%s"%baseline
ret = regression.run_wo_terminate(canvas, "test_vcs_isoline_labels.png", baselineImage)

# Now set isoline.linecolors and test again.
canvas.clear()
isoline.linecolors = colors
canvas.plot(data, isoline, bg=1)
baselineImage = "%s%d%s"%(baseline[0], 2, baseline[1])
testImage = os.path.abspath("test_vcs_isoline_labels2.png")
ret += regression.run_wo_terminate(canvas, testImage, baselineImage)

# Now set isoline.textcolors and test again.
canvas.clear()
isoline.textcolors = colors
canvas.plot(data, isoline, bg=1)

baselineImage = "%s%d%s"%(baseline[0], 3, baseline[1])
testImage = os.path.abspath("test_vcs_isoline_labels3.png")
ret += regression.run_wo_terminate(canvas, testImage, baselineImage)

sys.exit(ret)

[((5, 9, 5, 26), 'vcs.testing.regression.init', 'regression.init', ({}, {}), '()', True, 'import os, sys, cdms2, vcs, vcs.testing.regression as regression\n'), ((24, 11, 24, 40), 'os.path.splitext', 'os.path.splitext', ({(24, 28, 24, 39): 'sys.argv[1]'}, {}), '(sys.argv[1])', False, 'import os, sys, cdms2, vcs, vcs.testing.regression as regression\n'), ((26, 6, 26, 87), 'vcs.testing.regression.run_wo_terminate', 'regression.run_wo_terminate', ({(26, 34, 26, 40): 'canvas', (26, 42, 26, 71): '"""test_vcs_isoline_labels.png"""', (26, 73, 26, 86): 'baselineImage'}, {}), "(canvas, 'test_vcs_isoline_labels.png',\n    baselineImage)", True, 'import os, sys, cdms2, vcs, vcs.testing.regression as regression\n'), ((33, 12, 33, 59), 'os.path.abspath', 'os.path.abspath', ({(33, 28, 33, 58): '"""test_vcs_isoline_labels2.png"""'}, {}), "('test_vcs_isoline_labels2.png')", False, 'import os, sys, cdms2, vcs, vcs.testing.regression as regression\n'), ((34, 7, 34, 68), 'vcs.testing.regression.run_wo_terminate', 'regression.run_wo_terminate', ({(34, 35, 34, 41): 'canvas', (34, 43, 34, 52): 'testImage', (34, 54, 34, 67): 'baselineImage'}, {}), '(canvas, testImage, baselineImage)', True, 'import os, sys, cdms2, vcs, vcs.testing.regression as regression\n'), ((42, 12, 42, 59), 'os.path.abspath', 'os.path.abspath', ({(42, 28, 42, 58): '"""test_vcs_isoline_labels3.png"""'}, {}), "('test_vcs_isoline_labels3.png')", False, 'import os, sys, cdms2, vcs, vcs.testing.regression as regression\n'), ((43, 7, 43, 68), 'vcs.testing.regression.run_wo_terminate', 'regression.run_wo_terminate', ({(43, 35, 43, 41): 'canvas', (43, 43, 43, 52): 'testImage', (43, 54, 43, 67): 'baselineImage'}, {}), '(canvas, testImage, baselineImage)', True, 'import os, sys, cdms2, vcs, vcs.testing.regression as regression\n'), ((45, 0, 45, 13), 'sys.exit', 'sys.exit', ({(45, 9, 45, 12): 'ret'}, {}), '(ret)', False, 'import os, sys, cdms2, vcs, vcs.testing.regression as regression\n'), ((3, 21, 3, 59), 'os.path.join', 'os.path.join', ({(3, 34, 3, 49): 'vcs.sample_data', (3, 50, 3, 58): '"""clt.nc"""'}, {}), "(vcs.sample_data, 'clt.nc')", False, 'import os, sys, cdms2, vcs, vcs.testing.regression as regression\n')]