Skip to content

Commit

Permalink
using ** for unpacking the dict of dicts (not working)
Browse files Browse the repository at this point in the history
  • Loading branch information
romangrothausmann committed Nov 10, 2017
1 parent 146aa35 commit 3b309cc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pvsm-multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ def main():
reprs= pvs.GetRepresentations() # dict of objects (entries in pipeline browser)
newreprs= [ repr for repr in reprs.values() if repr not in set(oldreprs)] # https://stackoverflow.com/questions/3462143/get-difference-between-two-lists#3462202
for repr in newreprs: # list of newly added objects
reppro.append(repr.ListProperties()) # dict of object properties
# GetProperty(repr, props[0]) # values of property
d = {}
for props in repr.ListProperties():
d[props] = pvs.GetProperty(repr, props[0]) # values of property
reppro.append(d) # dict of object properties

oldreprs = reprs # save current list, to exclude after next load of state file (as these will be reset)

## use current dict of objects (after last LoadState)
for i, repr in enumerate(reprs.values()):
pvs.SetProperties(repr, reppro[i]);
print reppro[i]
pvs.SetProperties(repr, **reppro[i]);


if args.output:
Expand Down

0 comments on commit 3b309cc

Please sign in to comment.