From f01c0512a8d749f76ac37a7038cfacc377d45335 Mon Sep 17 00:00:00 2001 From: endaye Date: Wed, 20 Mar 2024 01:13:33 +0800 Subject: [PATCH 1/2] fix: a bug --- tool_xls2gd.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tool_xls2gd.py b/tool_xls2gd.py index fed400c..4da1d72 100644 --- a/tool_xls2gd.py +++ b/tool_xls2gd.py @@ -225,11 +225,12 @@ def make_table(filename): elif type_dict[title] == TRANSLATE and vtype == xlrd.XL_CELL_TEXT: v = str(value) v = v.replace("\n", "\\n") - if key_v1 and key_v2 and key_v3: + key_csv = "" + if key_v1 is not None and key_v2 is not None and key_v3 is not None: key_csv = f"{sheet_name}_{title}_{key_v1}_{key_v2}_{key_v3}" - elif key_v1 and key_v2: + elif key_v1 is not None and key_v2 is not None: key_csv = f"{sheet_name}_{title}_{key_v1}_{key_v2}" - elif key_v1: + elif key_v1 is not None: key_csv = f"{sheet_name}_{title}_{key_v1}" key_csv = key_csv.replace(" ", "_").upper() t_csv[key_csv] = str(v) @@ -661,7 +662,7 @@ def write_to_csv(sheet, sheet_name, output_csv_path, xls_file): # write new csv with open(csv_file_fullpath, "w", encoding="utf-8", newline="") as f: - w = csv.DictWriter(f, filenames) + w = csv.DictWriter(f, filenames, quotechar='"') w.writeheader() for row in data_csv.values(): w.writerow(row) From ff451f188ec93e8dcf65f739ecdf21ca49275b64 Mon Sep 17 00:00:00 2001 From: endaye Date: Wed, 20 Mar 2024 03:07:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?release:=20launche=20v1.2.2=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gui.py | 2 +- tool_xls2gd.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gui.py b/gui.py index 1d8b48b..b87c3d1 100644 --- a/gui.py +++ b/gui.py @@ -19,7 +19,7 @@ __copyright__ = "Copyright 2024, Hidden Moss" __credits__ = ["Yuancheng Zhang"] __license__ = "MIT" -__version__ = "v1.2.1" +__version__ = "v1.2.2" __maintainer__ = "Yuancheng Zhang" __status__ = "Production" diff --git a/tool_xls2gd.py b/tool_xls2gd.py index 4da1d72..ff9bdfe 100644 --- a/tool_xls2gd.py +++ b/tool_xls2gd.py @@ -22,7 +22,7 @@ __copyright__ = "Copyright 2024, Hidden Moss" __credits__ = ["Yuancheng Zhang"] __license__ = "MIT" -__version__ = "v1.2.1" +__version__ = "v1.2.2" __maintainer__ = "Yuancheng Zhang" __status__ = "Development"