fava
fava copied to clipboard
Sort importable files by date and account name
The list of importable files on /beancount/import/
is sorted by file name. I find it much more useful if they are sorted by date and then by account name.
I added the following code to the function def import_data(self) -> list[FileImporters]
in ingest.py
just before the return to sort them.
# Sort ret by the date and account attribute of infos[0] if it exists
ret = sorted(
ret,
key=lambda x: (
x.importers[0].date is None,
x.importers[0].date,
x.importers[0].account
) if x.importers
else (True, None, None)
)