diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-05-23 15:33:31 +0200 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-05-23 15:33:31 +0200 |
commit | c6bd5614cb7a1453ddd1862ad17fb693c87f2e82 (patch) | |
tree | a521e3569f543d408be9fb538bdc5faf10ebca18 /lib/cli.py | |
parent | 0c09f3486fa4db0e2f4f5ee415b846107cceace6 (diff) |
--export-csv-dialec: add excel-lf (excel with LF rather than CRLF)
Diffstat (limited to 'lib/cli.py')
-rw-r--r-- | lib/cli.py | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -361,6 +361,16 @@ def export_dot(model, dot_prefix): def export_csv_unparam(model, csv_prefix, dialect="excel"): import csv + class ExcelLF(csv.Dialect): + delimiter = "," + quotechar = '"' + doublequote = True + skipinitialspace = False + lineterminator = "\n" + quoting = 0 + + csv.register_dialect("excel-lf", ExcelLF) + for name in sorted(model.names): filename = f"{csv_prefix}{name}.csv" with open(filename, "w") as f: @@ -482,7 +492,7 @@ def add_standard_arguments(parser): "--export-csv-dialect", metavar="DIALECT", type=str, - choices=["excel", "excel-tab", "unix"], + choices=["excel", "excel-lf", "excel-tab", "unix"], default="excel", help="CSV dialect to use for --export-csv-unparam", ) |