Skip to content
Snippets Groups Projects
Commit 670d3d29 authored by Stefan Froehlich's avatar Stefan Froehlich
Browse files

Task #9058 Its possible to have this functionality when remembering the order...

Task #9058 Its possible to have this functionality when remembering the order of the replacement keys. Not a very elegant solution but it should work.
parent 45a823e3
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ import os
import sys
import copy
import re
from collections import OrderedDict
from lofarpipe.support.parset import Parset
from lofarpipe.support.control import control
......@@ -504,7 +505,7 @@ class GenericPipeline(control):
steplist = []
def _replace_values(self):
replacedict = {}
replacedict = OrderedDict()
for check in self.parset.keywords():
if str(check).startswith('!'):
replacedict[str(check).lstrip('!').lstrip(' ')] = str(self.parset[check])
......@@ -512,7 +513,7 @@ class GenericPipeline(control):
replacedict[str(check).replace('pipeline.replace.', '').lstrip(' ')] = str(self.parset[check])
#print 'REPLACEDICT: ',replacedict
for check in self.parset.keywords():
for k, v in replacedict.iteritems():
for k, v in reversed(replacedict.items()):
if '{{ '+k+' }}' in str(self.parset[check]):
replacestring = str(self.parset[check]).replace('{{ '+k+' }}',v)
self.parset.replace(check,replacestring)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment