From 0eccd6515ff0a0c69a93d63feedea8bd58b6d8b9 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Fri, 20 Jan 2023 02:45:47 -0600 Subject: [PATCH] In plot.py/plotmpl.py, allowed escaped commas in certain comma-separated fields --- scripts/plot.py | 21 +++++++++++++-------- scripts/plotmpl.py | 28 +++++++++++++++++----------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/scripts/plot.py b/scripts/plot.py index 72c496c0..4a34f415 100755 --- a/scripts/plot.py +++ b/scripts/plot.py @@ -1410,6 +1410,7 @@ def main(csv_paths, *, if __name__ == "__main__": import sys import argparse + import re parser = argparse.ArgumentParser( description="Plot CSV files in terminal.", allow_abbrev=False) @@ -1476,8 +1477,10 @@ if __name__ == "__main__": help="Characters to use for lines.") parser.add_argument( '--labels', - type=lambda x: [x.strip() for x in x.split(',')], - help="Comma-separated legend labels.") + type=lambda x: [x.strip().replace('\,',',') + for x in re.split(r'(?