Skip to content

Commit

Permalink
Format files to make PR checks pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
5Ub-Z3r0 committed Aug 27, 2023
1 parent e09c905 commit 697701e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/importers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,6 @@ Import mt940 from `BCGE <https://www.bcge.ch/>`__

.. code-block:: python
from tariochbctools.importers.bcge import importer as bcge
from tariochbctools.importers.bcge import importer as bcge
CONFIG = [bcge.BCGEImporter("/\d+\.mt940", "Assets:BCGE")]
10 changes: 4 additions & 6 deletions src/tariochbctools/importers/bcge/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def strip_newline(string):
class BCGEImporter(mt940importer.Importer):
def prepare_payee(self, trxdata):
transaction_details = strip_newline(trxdata["transaction_details"])
payee = re.search(r'ORDP/([^/]+)', transaction_details)
payee = re.search(r"ORDP/([^/]+)", transaction_details)
if payee is None:
return ""
else:
Expand All @@ -19,13 +19,11 @@ def prepare_payee(self, trxdata):
def prepare_narration(self, trxdata):
transaction_details = strip_newline(trxdata["transaction_details"])
extra_details = strip_newline(trxdata["extra_details"])
beneficiary = re.search(
r'/BENM/([^/]+)', transaction_details)
remittance = re.search(
r'/REMI/([^/]+)', transaction_details)
beneficiary = re.search(r"/BENM/([^/]+)", transaction_details)
remittance = re.search(r"/REMI/([^/]+)", transaction_details)
narration = []
if beneficiary is not None:
narration.append("Beneficiary: %s" % beneficiary.group(1))
if remittance is not None:
narration.append("Remittance: %s" % remittance.group(1))
return ("%s - %s" % (extra_details, ",".join(narration)))
return "%s - %s" % (extra_details, ",".join(narration))

0 comments on commit 697701e

Please sign in to comment.