mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12:27:14 +02:00
more set_using_dict
This commit is contained in:
@ -189,4 +189,22 @@ def lhex(iterable):
|
||||
|
||||
|
||||
def lpath(iterable):
|
||||
return [Path(item) for item in iterable]
|
||||
return [Path(item) for item in iterable]
|
||||
|
||||
def add_argument_before(a, args):
|
||||
"""Add a before the other arguments. Also works with
|
||||
dict that holds args to several modules. Always puts the
|
||||
args in a dict to be compatible with set_using_dict"""
|
||||
print(f'{args=}')
|
||||
if isinstance(args, tuple):
|
||||
return (a, *args)
|
||||
elif isinstance(args, dict):
|
||||
ret = {}
|
||||
for key, value in args.items():
|
||||
if isinstance(value, tuple):
|
||||
ret[key] = (a, *value)
|
||||
else:
|
||||
ret[key] = (a, value)
|
||||
return (ret,)
|
||||
return a, args
|
||||
|
Reference in New Issue
Block a user