Merge branch 'szhublox-range'

This commit is contained in:
hnmr293
2023-04-08 13:29:21 +09:00
+10 -3
View File
@@ -350,7 +350,14 @@ class KSamplerXYZ:
def parse(self, input: str, cont: Union[Callable[[str],Any],None]): def parse(self, input: str, cont: Union[Callable[[str],Any],None]):
vs = [ x.strip() for x in input.split(',') ] vs = [ x.strip() for x in input.split(',') ]
if cont is not None: if cont is not None:
vs = [cont(v) for v in vs ] new_vs = []
for v in vs:
new_v = cont(v)
if isinstance(new_v, list):
new_vs += new_v
else:
new_vs.append(new_v)
vs = new_vs
return vs return vs
def parse_int(self, input: str): def parse_int(self, input: str):
@@ -365,8 +372,8 @@ class KSamplerXYZ:
start, end, step = m.group(1), m.group(2), m.group(3) start, end, step = m.group(1), m.group(2), m.group(3)
if step is None: if step is None:
step = 1 step = 1
return list(range(int(start), int(end), int(step))) return list(range(int(start), int(end) + 1, int(step)))
def parse_float(self, input: str): def parse_float(self, input: str):
m = re_float.fullmatch(input) m = re_float.fullmatch(input)