mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
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 <jan@janware.com>
This commit is contained in:
parent
e71661425c
commit
1239fb9f34
1 changed files with 11 additions and 1 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue