Files @ b41a7a99af17
Branch filter:

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

Brett Smith
hooks: Filter entries by setting entry_data['_hook_cancel'] to True.

The current method only works for plain dicts and other simple mappings.
Mapping that may still contain items after .clear(), like ChainMap, can't
rely on the old method.
1
2
3
4
5
6
7
import pathlib
import re

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

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