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

multiple connections with order 😎

parent e3d05036
...@@ -127,16 +127,23 @@ class Parser(): ...@@ -127,16 +127,23 @@ class Parser():
exit(-1) exit(-1)
def _split_multiple(self,param): def _split_multiple(self,param):
res = [] vals = {}
first=True first=True
for s in param.__slots__: for s in param.__slots__:
attr = getattr(param,s) attr = getattr(param,s)
if attr is not None and '\0' in attr: if attr is not None and '\0' in attr:
vals = attr.split('\0') vals[s] = attr.split('\0')
for v in vals: l=0
par = copy.copy(param) for sl in vals:
setattr(par, s, v) if l==0:
res.append(par) 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 return res
#Props is line "[proFp=smth, ...]" #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