# Path: ledgerbil/ledgerbilexceptions.py
# class LdgReconcilerError(LdgException):
#     pass


import re
from collections import namedtuple
from . import util
from .ledgerbilexceptions import LdgReconcilerError
                continue

            if re.search(self.rec_account, posting.account):
                m = re.match(r"^\s+[!*]?\s*(.*)$", line)
                assert m
                # going to use a standard 4 space indent; alternatively
                # could try to be smart about preserving what is there
                remainder = m.groups()[0]
                lines_out.append(f"  {current_status} {remainder}")
            else:
                lines_out.append(line)

        return list(lines_out)

    @staticmethod
    def is_new_thing(line):
        # currently, is_new_thing == is_transaction_start, but this
        # could change in future
        return LedgerThing.is_transaction_start(line)

    @staticmethod
    def is_transaction_start(line):
        match = re.match(TOP_LINE_REGEX, line)
        if match:
            return util.is_valid_date(match.groups()[0])
        else:
            return False

    def assert_only_one_status(self, statuses):
        if len(set(statuses)) > 1:

# Path: ledgerbil/ledgerbilexceptions.py
# class LdgReconcilerError(LdgException):
#     pass


# Path: ledgerbil/ledgerthing.py
import re
from collections import namedtuple
from . import util
from .ledgerbilexceptions import LdgReconcilerError

                continue

            if re.search(self.rec_account, posting.account):
                m = re.match(r"^\s+[!*]?\s*(.*)$", line)
                assert m
                # going to use a standard 4 space indent; alternatively
                # could try to be smart about preserving what is there
                remainder = m.groups()[0]
                lines_out.append(f"  {current_status} {remainder}")
            else:
                lines_out.append(line)

        return list(lines_out)

    @staticmethod
    def is_new_thing(line):
        # currently, is_new_thing == is_transaction_start, but this
        # could change in future
        return LedgerThing.is_transaction_start(line)

    @staticmethod
    def is_transaction_start(line):
        match = re.match(TOP_LINE_REGEX, line)
        if match:
            return util.is_valid_date(match.groups()[0])
        else:
            return False

    def assert_only_one_status(self, statuses):
        if len(set(statuses)) > 1:

            raise LdgReconcilerError(