From 43441844ad305da83924fb022c184a0dfa636401 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 4 Aug 2024 11:36:54 -0400 Subject: [PATCH] add zip --- to_zip.sh | 12 ++++++++++++ xlsx_dir_map/spreadsheet.py | 9 +++++---- 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100755 to_zip.sh diff --git a/to_zip.sh b/to_zip.sh new file mode 100755 index 0000000..de60ebb --- /dev/null +++ b/to_zip.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -euo pipefail + +FILE="$1" +NAME="$2" +RANGE="$3" +GROUPING="$4" + +poetry run python xlsx_dir_map -i "$FILE" -o "$NAME" -r "$RANGE" "$GROUPING" +zip -r "$NAME.zip" $NAME + diff --git a/xlsx_dir_map/spreadsheet.py b/xlsx_dir_map/spreadsheet.py index c934795..03d9615 100644 --- a/xlsx_dir_map/spreadsheet.py +++ b/xlsx_dir_map/spreadsheet.py @@ -70,9 +70,10 @@ def get_names_list(filename, cellrange, column_groups): for colgroup in column_groups: path = get_value(cells, colgroup) - paths.append(path) - - if "None" not in paths: - names.append("/".join(paths)) + if "None" not in path: + paths.append(path) + + # if "None" not in paths: + names.append("/".join(filter(lambda x: x != '', paths))) return names