made to module

This commit is contained in:
Kyattsukuro 2026-03-28 12:19:58 +01:00
parent 1e833ebc7f
commit 067afb1515
37 changed files with 18 additions and 34 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
.venv .venv
/**/*.pyc

4
.vscode/launch.json vendored
View File

@ -8,7 +8,7 @@
"name": "Rings", "name": "Rings",
"type": "debugpy", "type": "debugpy",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}/__init__.py", "module": "fledermaus_formatter",
"args": ["-i", "data/ringe_short.xlsx", "-o", "ringe_short_out.xlsx", "-t", "ring"], "args": ["-i", "data/ringe_short.xlsx", "-o", "ringe_short_out.xlsx", "-t", "ring"],
"console": "integratedTerminal" "console": "integratedTerminal"
}, },
@ -16,7 +16,7 @@
"name": "Countings", "name": "Countings",
"type": "debugpy", "type": "debugpy",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}/__init__.py", "module": "fledermaus_formatter",
"args": ["-i", "data/zählungen_short.xlsx", "-o", "zählungen_short_out.xlsx", "-t", "counting"], "args": ["-i", "data/zählungen_short.xlsx", "-o", "zählungen_short_out.xlsx", "-t", "counting"],
"console": "integratedTerminal" "console": "integratedTerminal"
} }

View File

@ -0,0 +1 @@
,someone,nixLap,28.03.2026 12:13,file:///home/someone/.config/yolk/eggs/libreoffice/4;

Binary file not shown.

View File

@ -0,0 +1 @@
,someone,nixLap,28.03.2026 12:13,file:///home/someone/.config/yolk/eggs/libreoffice/4;

View File

@ -0,0 +1,4 @@
from fledermaus_formatter.main import main
if __name__ == "__main__":
main()

View File

@ -1,10 +1,10 @@
import argparse import argparse
import os import os
from logger import logger from fledermaus_formatter.logger import logger
from table_handler.serializer import TableSerializer from fledermaus_formatter.table_handler.serializer import TableSerializer
import instructions.countings_formater as countings_formater import fledermaus_formatter.instructions.countings_formater as countings_formater
import instructions.ring_formater as ring_formater import fledermaus_formatter.instructions.ring_formater as ring_formater
from concurrent.futures import ProcessPoolExecutor, as_completed from concurrent.futures import ProcessPoolExecutor, as_completed
@ -97,7 +97,3 @@ def main():
parser.error("You must provide either input/output files or input-dir/output-dir") parser.error("You must provide either input/output files or input-dir/output-dir")
logger.info("Done") logger.info("Done")
if __name__ == "__main__":
main()

View File

@ -3,7 +3,7 @@ from openpyxl import Workbook, load_workbook
from dataclasses import dataclass from dataclasses import dataclass
from pprint import pprint as print from pprint import pprint as print
import instructions.mappings as mappings import fledermaus_formatter.instructions.mappings as mappings
from .commands.find_and_replace import FindAndReplace from .commands.find_and_replace import FindAndReplace
from .commands.regex_edit_col import RegexEditCol from .commands.regex_edit_col import RegexEditCol
@ -11,7 +11,7 @@ from .commands.regex_move_to_col import RegexMoveToCol
from .commands.copy import Copy from .commands.copy import Copy
from .commands.regex_group_valuebased_choose import RegexGroupValuebasedChoose from .commands.regex_group_valuebased_choose import RegexGroupValuebasedChoose
from .commands.row_color_to_value import RowColorToCalue from .commands.row_color_to_value import RowColorToCalue
from logger import logger from fledermaus_formatter.logger import logger
from .conditions.regex_cell import RegexCellCondition from .conditions.regex_cell import RegexCellCondition

BIN
ringe_short_out.xlsx Normal file

Binary file not shown.

23
run.sh
View File

@ -2,25 +2,6 @@
SCRIPT_DIR="$HOME/.config/fledermaus-formatter" SCRIPT_DIR="$HOME/.config/fledermaus-formatter"
to_absolute_args() {
local result=()
for arg in "$@"; do
if [ -e "$arg" ] || [ -d "$arg" ] || [ -f "$arg" ]; then
result+=("$(realpath "$arg")")
else
result+=("$arg")
fi
done
printf '%s\n' "${result[@]}"
}
ABS_ARGS=()
while IFS= read -r line; do
ABS_ARGS+=("$line")
done < <(to_absolute_args "$@")
cd $SCRIPT_DIR
source $SCRIPT_DIR/.venv/bin/activate source $SCRIPT_DIR/.venv/bin/activate
$SCRIPT_DIR/.venv/bin/python3 __init__.py "${ABS_ARGS[@]}" export PYTHONPATH=$SCRIPT_DIR:$PYTHONPATH
$SCRIPT_DIR/.venv/bin/python3 -m fledermaus_formatter "${ABS_ARGS[@]}"

BIN
zählungen_short_out.xlsx Normal file

Binary file not shown.