10def groupBlocks(func):
11 """
12 Decorates a configSequence or function with 'seq' as a
13 arguement.
14
15 Sets groupName to the name of the decorated funtion or
16 calss plus and integer for each ConfigBlock in the configSequence.
17
18 Blocks with the same groupName can be configured together.
19 """
20 @wraps(func)
21 def wrapper(**kwargs):
22 func(**kwargs)
23 groupName = f"{func.__name__}_{randrange(10**8):08}"
24 for block in kwargs['seq']:
25 block.setOptionValue('groupName', groupName)
26 return wrapper
27