~gagbo/PyKonta

b46e8ed21f420f77384c425dd7e37b503a696c7e — Gerry Agbobada 1 year, 7 months ago d3ab726
Still trying
1 files changed, 6 insertions(+), 3 deletions(-)

M konta/woob_import.py
M konta/woob_import.py => konta/woob_import.py +6 -3
@@ 30,6 30,7 @@ def _get_tx_list(
    while True:
        try:
            tran = next(tx_iter)
            logging.debug(f"Checking {tran}")
            tx_date = (
                tran.rdate
                if not isinstance(tran.rdate, NotLoadedType)


@@ 58,15 59,17 @@ def import_data(min_date: dt.datetime) -> Dict[str, Dict[str, List[base.Transact
    while True:
        try:
            account = next(account_list)
            logging.info(f"Processing account {account.id}")
            logging.info(f"Processing account {account.id}: {account.label}")
            historic = w.iter_history(account)
            coming = w.iter_coming(account)
            res[account.id] = {}
            if historic is not None:
                res[account.id]["history"] = _get_tx_list(historic, min_date)
                _ = res[account.id].setdefault("history", [])
                res[account.id]["history"][len(res[account.id]["history"]):] = _get_tx_list(historic, min_date)
                logging.info(f"{account.id}: picked up {len(res[account.id]['history'])} transactions in history")
            if coming is not None:
                res[account.id]["coming"] = _get_tx_list(coming, min_date)
                _ = res[account.id].setdefault("coming", [])
                res[account.id]["coming"][len(res[account.id]["coming"]):] = _get_tx_list(coming, min_date)
                logging.info(f"{account.id}: picked up {len(res[account.id]['coming'])} transactions in coming")
        except StopIteration:
            break