Skip to content

Commit

Permalink
Allow escaping commas in XYZ grid
Browse files Browse the repository at this point in the history
  • Loading branch information
misterandy33 authored Jun 9, 2024
1 parent feee37d commit d13e2e0
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 @@ -212,7 +212,10 @@ def list_to_csv_string(data_list):


def csv_string_to_list_strip(data_str):
return list(map(str.strip, chain.from_iterable(csv.reader(StringIO(data_str)))))
placeholder = "<<<COMMA>>>"
data_str = data_str.replace(r"\,", placeholder) # Replace escaped commas with the placeholder
values = chain.from_iterable(csv.reader(StringIO(data_str)))
return list(map(lambda s: s.replace(placeholder, ",").strip(), values))


class AxisOption:
Expand Down

0 comments on commit d13e2e0

Please sign in to comment.