mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
Extract method to allow extensions (#109)
This commit is contained in:
committed by
Stefan Rijnhart (Opener)
parent
e0c8a9126c
commit
842ced8ee0
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user