Skip to content

Commit

Permalink
Merge pull request #3 from hidden-moss/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
endaye authored Mar 19, 2024
2 parents 9901674 + ff451f1 commit d91ce62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
11 changes: 6 additions & 5 deletions tool_xls2gd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d91ce62

Please sign in to comment.