From 4e265e1cd3a8e13d62105b931ebcf1fe1b8dce3e Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 15 Aug 2013 11:20:28 +0000 Subject: [PATCH] Added check for color. git-svn-id: http://www.winterrodeln.org/svn/wrpylib/trunk@1518 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- wrpylib/wrmwmarkup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wrpylib/wrmwmarkup.py b/wrpylib/wrmwmarkup.py index c968b20..142512e 100644 --- a/wrpylib/wrmwmarkup.py +++ b/wrpylib/wrmwmarkup.py @@ -450,7 +450,8 @@ def parse_wrmap(wikitext): if len(wrong_properties) > 0: raise RuntimeError("The attribute '{}' is not allowed at <{}>.".format(list(wrong_properties)[0], feature.tag)) if feature.attrib.has_key('farbe'): - # TODO: check value + if not re.match('#[0-9a-fA-F]{6}$', feature.attrib['farbe']): + raise RuntimeError('The attribute "farbe" has to have a format like "#a0bb43".') properties['strokeColor'] = feature.attrib['farbe'] # e.g. #a200b7 if feature.attrib.has_key('dicke'): try: -- 2.30.2