Commit ee907684 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

add coma at the end of a add_component line

parent a1314acd
......@@ -105,13 +105,16 @@ class Workflow(threading.Thread):
for i in range(0, len(workflow_command_lines)):
line = workflow_command_lines[i]
if line.find("self.add_component") != -1 and not re.search('^\s*\#', line) :
while re.search('[\\,]\s*$', line) : # While line ends with backslash
while re.search('\\\s*$', line) or re.search(',\s*$', line): # While line ends with backslash
# Concatenate next line
i += 1
next_line = workflow_command_lines[i]
if re.search('^\s*\#', next_line) :
nex_line = "\\"
line = re.search('(.+)[\\,]\s*$', line).groups()[0] + next_line
if re.search('\\\s*$', line):
line = re.search('(.+)\\\s*$', line).groups()[0] + next_line
elif re.search(',\s*$', line):
line = re.search('(.+),\s*$', line).groups()[0] + next_line
component_prefix = "default"
component_name = line.strip().split("self.add_component")[1][1:-1].split(",")[0][1:-1]
arguments = re.search("self.add_component\s*\((.+)\)", line).groups()[0]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment