From ab236e4c360ea53514ec83e6c8909585f237aaf5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 10 Feb 2016 20:49:42 +0300 Subject: testxml: fix validating dye palette with GIMP color names. --- testxml/testxml.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'testxml/testxml.py') diff --git a/testxml/testxml.py b/testxml/testxml.py index 70b2865..c2b5856 100755 --- a/testxml/testxml.py +++ b/testxml/testxml.py @@ -256,20 +256,22 @@ def testDye(id, color, text, src, iserr): def testDyeInternal(id, col, text, src, iserr): - if col[0] != "#": + oldPalette = col[0] == "#" + if oldPalette == False and col[0] != "@": showMsg(id, "incorrect dye colors: " + text, src, iserr) return False - paletes = dyesplit2.split(col[1:]) - for palete in paletes: - if len(palete) != 6: - showMsg(id, "incorrect dye palete: " + text, src, iserr) - return False - - for char in palete.lower(): - if (char < '0' or char > '9') and (char < 'a' or char > 'f'): + if oldPalette: + paletes = dyesplit2.split(col[1:]) + for palete in paletes: + if len(palete) != 6: showMsg(id, "incorrect dye palete: " + text, src, iserr) return False + + for char in palete.lower(): + if (char < '0' or char > '9') and (char < 'a' or char > 'f'): + showMsg(id, "incorrect dye palete: " + text, src, iserr) + return False return True -- cgit v1.2.3-70-g09d2