Commit 70c91ee9 authored by Savva Golubitsky's avatar Savva Golubitsky

multiple connections with order 😎

parent e3d05036
......@@ -127,16 +127,23 @@ class Parser():
exit(-1)
def _split_multiple(self,param):
res = []
vals = {}
first=True
for s in param.__slots__:
attr = getattr(param,s)
if attr is not None and '\0' in attr:
vals = attr.split('\0')
for v in vals:
par = copy.copy(param)
setattr(par, s, v)
res.append(par)
vals[s] = attr.split('\0')
l=0
for sl in vals:
if l==0:
l=len(vals[sl])
elif l!=len(vals[sl]):
print("\tERROR: Number of multiple params do not match", l)
return -1
res = [copy.copy(param) for i in range(l)]
for sl in vals:
for i, _ in enumerate(res):
setattr(res[i], sl, vals[sl][i])
return res
#Props is line "[proFp=smth, ...]"
......
Markdown is supported
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