diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-09-10 20:14:28 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-09-10 20:14:28 +0200 |
| commit | 5264b28126ed66a4236103f99d55f2eb425b0e6c (patch) | |
| tree | 5f5db87a552c6347e4b22c0529b8cb36213bcb94 | |
| parent | c73fc04ddb23b064c6ea30bc738bb852c057a6a5 (diff) | |
Improve range parsing
| -rw-r--r-- | esds/helpers/platform.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/esds/helpers/platform.py b/esds/helpers/platform.py index ec776ab..119537a 100644 --- a/esds/helpers/platform.py +++ b/esds/helpers/platform.py @@ -6,14 +6,15 @@ class UnitsParser: def range(r,limit): if r == "all": return(range(0,limit)) - elt=r.replace("@",str(limit-1)).split("-") + r=r.replace("@",str(limit-1)) + elt=r.split("-") if len(elt) == 2: min = int(elt[0]) max = int(elt[1]) # TODO: Check min/max return(range(min,max)) else: - return([int(elt[0])]) + return(list(map(int, r.split(",")))) def bandwidth(bw): for i,c in enumerate(bw): |
