generated from felixm/defaultpy
Make fzf prompt more legible
This commit is contained in:
@@ -68,6 +68,7 @@ def get_transactions(csv_file: str, config: CsvConfig) -> list[Transaction]:
|
||||
|
||||
def apply_mappings(transactions: list[Transaction], mappings: dict[str, Mapping]):
|
||||
"""Apply mappings to transactions."""
|
||||
unmapped_count = 0
|
||||
for t in transactions:
|
||||
if t.key() in mappings:
|
||||
mapping = mappings[t.key()]
|
||||
@@ -76,7 +77,9 @@ def apply_mappings(transactions: list[Transaction], mappings: dict[str, Mapping]
|
||||
mapping.count -= 1
|
||||
t.mapping = mapping
|
||||
else:
|
||||
logging.warning(f"No mapping for '{t}'.")
|
||||
unmapped_count += 1
|
||||
if unmapped_count > 0:
|
||||
logging.info(f"{unmapped_count} transactions without mappings.")
|
||||
|
||||
for mapping in mappings.values():
|
||||
assert mapping.count == 0, f"{mapping} was not used as often as expected!"
|
||||
|
||||
Reference in New Issue
Block a user