~gagbo/PyKonta

c181e20eec1ad9afc1845b5f2bdf8dc5dc991828 — Gerry Agbobada 6 months ago b46e8ed
Allow finding payees by prefix or suffix
1 files changed, 9 insertions(+), 0 deletions(-)

M konta/config.py
M konta/config.py => konta/config.py +9 -0
@@ 86,6 86,15 @@ class Config:

    def get_payee(self, label: str) -> Payee:
        """Get the payee for given transaction label."""
        if label in self._payees:
            return self._payees[label]

        for key, value in self._payees.items():
            if label.startswith(key):
                return value
            if label.endswith(key):
                return value

        return self._payees.get(label, Payee(label, None, self._default_cat))

    def get_exising_input_paths(self) -> Optional[List[pathlib.Path]]: