Regexp for evaluated commands

This commit is contained in:
Anthony Scemama 2021-06-01 14:50:33 +02:00
parent ccee52d00c
commit ed1df9f3c1
1 changed files with 2 additions and 2 deletions

View File

@ -49,8 +49,8 @@ for group in list(groups.keys()):
command_py = command
dims_py = str(dims)
for g in list(groups.keys()):
command_py = command_py.replace(g,'self.'+g)
dims_py = dims_py.replace(g,'self.'+g)
command_py = re.sub("(\W)"+g, r"\1self."+g, command_py)
dims_py = dims_py.replace("(\W)"+g,r'\1self.'+g)
var = var.lower()
group = group.lower()
strdims = tuple(['('+str(x)+')' for x in dims])