aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorWon-Kyu Park <wkpark@gmail.com>2023-09-15 17:10:01 +0900
committerWon-Kyu Park <wkpark@gmail.com>2023-09-15 17:30:36 +0900
commitafd06245876004710007fa1abd0a1b4b2564c181 (patch)
tree084b13f79aeb1041e773b540766b5b3f780abe35 /scripts
parent102b6617dacffdcc89c56badcaae6c5e83c3ff21 (diff)
xyz_grid: add prepare option to AxisOption
Diffstat (limited to 'scripts')
-rw-r--r--scripts/xyz_grid.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/xyz_grid.py b/scripts/xyz_grid.py
index 939d8605..ce5a1a19 100644
--- a/scripts/xyz_grid.py
+++ b/scripts/xyz_grid.py
@@ -205,13 +205,14 @@ def csv_string_to_list_strip(data_str):
class AxisOption:
- def __init__(self, label, type, apply, format_value=format_value_add_label, confirm=None, cost=0.0, choices=None):
+ def __init__(self, label, type, apply, format_value=format_value_add_label, confirm=None, cost=0.0, choices=None, prepare=None):
self.label = label
self.type = type
self.apply = apply
self.format_value = format_value
self.confirm = confirm
self.cost = cost
+ self.prepare = prepare
self.choices = choices
@@ -536,6 +537,8 @@ class Script(scripts.Script):
if opt.choices is not None and not csv_mode:
valslist = vals_dropdown
+ elif opt.prepare is not None:
+ valslist = opt.prepare(vals)
else:
valslist = csv_string_to_list_strip(vals)