improve: detailer wildcard - random seed support [SEP:R]
This commit is contained in:
@@ -2,7 +2,7 @@ import configparser
|
||||
import os
|
||||
|
||||
|
||||
version_code = [4, 65]
|
||||
version_code = [4, 65, 1]
|
||||
version = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
|
||||
|
||||
dependency_version = 20
|
||||
|
||||
@@ -401,7 +401,7 @@ class WildcardChooserDict:
|
||||
|
||||
|
||||
def split_string_with_sep(input_string):
|
||||
sep_pattern = r'\[SEP(?:\:\d+)?\]'
|
||||
sep_pattern = r'\[SEP(?:\:\w+)?\]'
|
||||
|
||||
substrings = re.split(sep_pattern, input_string)
|
||||
|
||||
@@ -412,8 +412,14 @@ def split_string_with_sep(input_string):
|
||||
if i < len(matches):
|
||||
if matches[i] == '[SEP]':
|
||||
result_list.append(None)
|
||||
elif matches[i] == '[SEP:R]':
|
||||
result_list.append(random.randint(0, 1125899906842624))
|
||||
else:
|
||||
result_list.append(int(matches[i][5:-1]))
|
||||
try:
|
||||
seed = int(matches[i][5:-1])
|
||||
except:
|
||||
seed = None
|
||||
result_list.append(seed)
|
||||
|
||||
iterable = iter(result_list)
|
||||
return list(zip(iterable, iterable))
|
||||
|
||||
Reference in New Issue
Block a user