Skip to content

Commit 9a8c176

Browse files
author
Hong-Thai Nguyen
authored
Merge pull request #13 from thaichat04/skip-prefix-comment
Skip prefix comment
2 parents aed29bb + 129ada0 commit 9a8c176

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

cfonb/parser/statement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def parse(self, file_obj):
4949
break
5050
else:
5151
row.update(new_row)
52-
comment = line[46:].strip()
52+
comment = line[46+2:].strip()
5353
if comment:
5454
row['comment'] = row.get('comment', '') + (BR_LINE if row.get('comment', '') else '') + comment
5555
elif line[0:2] == '07':

cfonb/tests/test_statement.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ def test_parse_with_original_content(self):
4949
assert_true(result[0].lines[0].get('origin').startswith('0415589 29701EUR2E01717651230B1230620 220620PRLV AAAAAA 0 0000000000315}VOTRE ABONNEMENT'))
5050
assert_true(result[0].lines[0].get('origin').endswith('0515589 29701EUR2E01717651230B1230620 LIBPRELEVEMENTS SEPA DOMICILIES '))
5151
assert_true(len(result[0].lines[0].get('origin').splitlines()) == 5)
52-
assert_true(len(result[0].lines[0].get('comment').splitlines()) == 4)
52+
comments = result[0].lines[0].get('comment').splitlines()
53+
assert_true(len(comments) == 4)
54+
assert_equal(comments[0], 'XXXXXX')
55+
assert_equal(comments[1], 'VOTRE ABONNEMENT FIXE 02XXXXX896 (FACTURE: XXXXX8960E2) - P')
5356

5457

5558
def suite():

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from setuptools import setup, find_packages
22

3-
version = '2.7'
3+
version = '2.8'
44

55
long_description = open('README.rst').read()
66

@@ -14,7 +14,7 @@
1414
author='Dhatim',
1515
author_email='[email protected]',
1616
url='https://github.com/dhatim/python-cfonb',
17-
download_url = 'https://github.com/dhatim/python-cfonb/archive/2.7.tar.gz',
17+
download_url = 'https://github.com/dhatim/python-cfonb/archive/2.8.tar.gz',
1818
license='LGPL',
1919
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
2020
include_package_data=True,

0 commit comments

Comments
 (0)