diff --git a/budgets/Budget-Vorlage-2024.xlsx b/budgets/Budget-Vorlage-2024.xlsx index 8716c78..cc6366f 100644 Binary files a/budgets/Budget-Vorlage-2024.xlsx and b/budgets/Budget-Vorlage-2024.xlsx differ diff --git a/superx_budget/budget.py b/superx_budget/budget.py index 3907070..7ac322f 100644 --- a/superx_budget/budget.py +++ b/superx_budget/budget.py @@ -16,6 +16,8 @@ EXPECTED_TABLE_HEADERS = [ "Rest", ] +EXCEL_LINES_TO_IGNORE = {"stand:", "stand"} + NUM_EXPECTED_HEADERS = len(EXPECTED_TABLE_HEADERS) ExcelRow = namedtuple("ExcelRow", ["row", "data"]) @@ -47,16 +49,20 @@ def _check_table_header(xl_row): raise BudgetParserError(msg) -def _skip_empty_lines(rows): +def _skip_some_lines(rows): for xl_row in rows: first_cell = xl_row.data[0] if is_empty_excel_value(first_cell): continue + if isinstance(first_cell, str): + value = first_cell.strip().lower() + if value in EXCEL_LINES_TO_IGNORE: + continue yield xl_row def _parse_data_table(rows): - for xl_row in _skip_empty_lines(rows): + for xl_row in _skip_some_lines(rows): data = [ strip_excel_value(value) for value in xl_row.data[:NUM_EXPECTED_HEADERS] diff --git a/superx_budget/pyramid/templates/overview.jinja2 b/superx_budget/pyramid/templates/overview.jinja2 index a3dc499..64af997 100644 --- a/superx_budget/pyramid/templates/overview.jinja2 +++ b/superx_budget/pyramid/templates/overview.jinja2 @@ -25,7 +25,6 @@ {% for budget in overview %} - {{budget.budget_data.project_name}} diff --git a/tests/test_budget_parser.py b/tests/test_budget_parser.py index 74edb9d..93a5feb 100644 --- a/tests/test_budget_parser.py +++ b/tests/test_budget_parser.py @@ -12,7 +12,7 @@ def test_check_table_header_raises_error(): def test_skip_empty_lines(): - from superx_budget.budget import ExcelRow, _skip_empty_lines + from superx_budget.budget import ExcelRow, _skip_some_lines rows = [ ExcelRow(0, [""]), @@ -23,7 +23,7 @@ def test_skip_empty_lines(): ExcelRow(5, [""]), ] - result = _skip_empty_lines(rows) + result = _skip_some_lines(rows) assert list(result) == [(1, ["one"]), (4, ["two"])]