Use a list for storing converted requires
@@ -82,11 +82,10 @@ def read(path, makefile, nitrate, purpose):
r'echo "TestTime:\s*(.*)"', content).group(1)
echo(style('duration: ', fg='green') + data['duration'])
# Requires and RhtsRequires (optional)
- requires_list = re.findall(r'echo "(?:Rhts)?Requires:\s*(.*)"', content)
- requires_str = ' '.join(requires_list)
- if requires_str != '':
- data['requires'] = requires_str
- echo(style('requires: ', fg='green') + data['requires'])
+ requires = re.findall(r'echo "(?:Rhts)?Requires:\s*(.*)"', content)
+ if requires:
+ data['requires'] = requires
+ echo(style('requires: ', fg='green') + ' '.join(data['requires']))
# Purpose (extract everything after the header as a description)
if purpose:
