Skip to content

Commit

Permalink
xyz_grid: add prepare option to AxisOption
Browse files Browse the repository at this point in the history
  • Loading branch information
wkpark committed Sep 15, 2023
1 parent 102b661 commit afd0624
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/xyz_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -536,6 +537,8 @@ def process_axis(opt, vals, vals_dropdown):

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)

Expand Down

0 comments on commit afd0624

Please sign in to comment.