Files @ 76f2707aacf7
Branch filter:

Location: NPO-Accounting/import2ledger/tests/__init__.py

Brett Smith
hooks.ledger_entry: New hook to output Ledger entries.

This is roughly the smallest diff necessary to move output to a hook.
There's a lot of code reorganization that should still happen to bring it
better in line with this new structure.
import decimal
import pathlib
import re

from import2ledger import __main__ as i2lmain

decimal.setcontext(i2lmain.decimal_context())

DATA_DIR = pathlib.Path(__file__).with_name('data')

def normalize_whitespace(s):
    return re.sub(r'(\t| {3,})', '  ', s)