From 092a54ca23367c845f796f753fa8ff43746b844a Mon Sep 17 00:00:00 2001 From: Alberto Planas Date: Thu, 27 Feb 2014 16:35:13 +0100 Subject: [PATCH] Fix _unexpanded_macros for array values --- TagsCheck.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/TagsCheck.py b/TagsCheck.py index c6f5dda..712d4e0 100644 --- a/TagsCheck.py +++ b/TagsCheck.py @@ -533,13 +533,20 @@ class TagsCheck(AbstractCheck.AbstractCheck): AbstractCheck.AbstractCheck.__init__(self, 'TagsCheck') def _unexpanded_macros(self, pkg, tagname, value, is_url=False): + def _check_value(value): + for match in AbstractCheck.macro_regex.findall(value): + # Do not warn about %XX URL escapes + if is_url and re.match('^%[0-9A-F][0-9A-F]$', match, re.I): + continue + printWarning(pkg, 'unexpanded-macro', tagname, match) + if not value: return - for match in AbstractCheck.macro_regex.findall(value): - # Do not warn about %XX URL escapes - if is_url and re.match('^%[0-9A-F][0-9A-F]$', match, re.I): - continue - printWarning(pkg, 'unexpanded-macro', tagname, match) + if isinstance(value, list): + for single_value in value: + _check_value(single_value) + else: + _check_value(value) def check(self, pkg): -- 1.9.0