From 1239fb9f346213a1f06d7842d5e1e4420afb941b Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Thu, 19 Mar 2020 17:36:58 +0000 Subject: [PATCH] projects.py: Support line continuation in project.conf This commit makes lines with backslashes at the end behave as if the next line was appended Signed-off-by: Jan Lindemann --- scripts/projects.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/projects.py b/scripts/projects.py index 8de62adb..984f4b3c 100644 --- a/scripts/projects.py +++ b/scripts/projects.py @@ -191,9 +191,19 @@ class Projects(object): break r += line return r if len(r) else None + lines = [] + cont_line = '' for line in f: if len(line) and line[0] == '[': - return None + break + cont_line += line.rstrip() + if len(cont_line) and cont_line[-1] == '\\': + cont_line = cont_line[0:-1] + continue + lines.append(cont_line) + cont_line = '' + for line in lines: + #self.debug(" looking for >%s< in line=>%s<" % (key, line)) rr = re.findall('^ *' + key + ' *= *(.*)', line) if len(rr) > 0: return rr[0]