Browse Source

Extract method to allow extensions (#109)

pull/125/head
Andrea Stirpe 8 years ago
committed by Andrea
parent
commit
deb933492c
  1. 6
      account_bank_statement_import_mt940_base/mt940.py

6
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))

Loading…
Cancel
Save