From 1cb6956f0f412467d4d98aa6ed0033fe09d96704 Mon Sep 17 00:00:00 2001 From: Andrea Stirpe Date: Wed, 17 May 2017 10:12:19 +0200 Subject: [PATCH] Extract method to allow extensions (#109) --- account_bank_statement_import_mt940_base/mt940.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/account_bank_statement_import_mt940_base/mt940.py b/account_bank_statement_import_mt940_base/mt940.py index 3c36f42..22dc5a6 100644 --- a/account_bank_statement_import_mt940_base/mt940.py +++ b/account_bank_statement_import_mt940_base/mt940.py @@ -153,7 +153,7 @@ class MT940(object): self.handle_header(line, iterator) line = iterator.next() if not self.is_tag(line) and not self.is_footer(line): - record_line += line + record_line = self.add_record_line(line, record_line) continue if record_line: self.handle_record(record_line) @@ -172,6 +172,10 @@ class MT940(object): self.current_statement = None return self.statements + def add_record_line(self, line, record_line): + record_line += line + return record_line + def is_footer(self, line): """determine if a line is the footer of a statement""" return line and bool(re.match(self.footer_regex, line))