diff --git a/piker/accounting/_mktinfo.py b/piker/accounting/_mktinfo.py index 046195ca..2d2ebccd 100644 --- a/piker/accounting/_mktinfo.py +++ b/piker/accounting/_mktinfo.py @@ -121,7 +121,7 @@ class Asset(Struct, frozen=True): # NOTE: additional info optionally packed in by the backend, but # should not be explicitly required in our generic API. - info: dict = {} # make it frozen? + info: dict | None = None # TODO? # _to_dict_skip = {'info'} diff --git a/piker/accounting/cli.py b/piker/accounting/cli.py index c655d8b5..0b18a3eb 100644 --- a/piker/accounting/cli.py +++ b/piker/accounting/cli.py @@ -34,6 +34,7 @@ from ..service import ( open_piker_runtime, ) from ..clearing._messages import BrokerdPosition +from ..config import load_ledger from ..calc import humanize @@ -169,14 +170,18 @@ def sync( ): try: assert len(accounts) == 1 - if ( - not pp_msg_table - and account == 'paper' - ): + if not pp_msg_table: + ld, fpath = load_ledger(brokername, account) + assert not ld, f'WTF did we fail to parse ledger:\n{ld}' + console.print( - '[yellow underline]' - f'No pps found for `{brokername}.paper` account!\n' - 'Do you even have any paper ledger files?' + '[yellow]' + 'No pps found for ' + f'`{brokername}.{account}` ' + 'account!\n\n' + '[/][underline]' + 'None of the following ledger files exist:\n\n[/]' + f'{fpath.as_uri()}\n' ) return