mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +02:00
fixed hostname not split (+) in python
This commit is contained in:
@ -260,4 +260,21 @@ def merge_args(*args):
|
||||
return (ret,)
|
||||
|
||||
else:
|
||||
raise ValueError("Multiple dictionaries passes cannot merge args")
|
||||
raise ValueError("Multiple dictionaries passes cannot merge args")
|
||||
|
||||
|
||||
def hostname_list(args):
|
||||
"""
|
||||
Generates a list from a hostname string
|
||||
* Lists are passed through
|
||||
* as are tuples (conversion in pybind11 to vector)
|
||||
* if + is found it splits the string
|
||||
"""
|
||||
if isinstance(args, (list, tuple)):
|
||||
return args
|
||||
elif(isinstance(args, str)):
|
||||
hosts = args.split('+')
|
||||
hosts = [it for it in hosts if len(it)]
|
||||
return hosts
|
||||
else:
|
||||
raise ValueError("hostname needs to be string or list of strings")
|
||||
|
Reference in New Issue
Block a user