]> git.ipfire.org Git - thirdparty/python-fints.git/commitdiff
Fix bugs found by linter
authorRaphael Michel <mail@raphaelmichel.de>
Thu, 29 Nov 2018 17:45:21 +0000 (18:45 +0100)
committerRaphael Michel <mail@raphaelmichel.de>
Mon, 3 Dec 2018 18:35:36 +0000 (19:35 +0100)
fints/client.py
fints/dialog.py

index 21d8893b1b7ecd1af2e1e40b52cd42ba6cc72e0b..0e0ebc42b18625c323c8c30b241e5983a2737dab 100644 (file)
@@ -315,7 +315,7 @@ class FinTS3Client:
     def _log_response(self, segment, response):
         if response.code[0] in ('0', '1'):
             log_target = logger.info
-        elif response.code[0] in ('3'):
+        elif response.code[0] in ('3',):
             log_target = logger.warning
         else:
             log_target = logger.error
@@ -947,7 +947,7 @@ class NeedTANResponse(NeedRetryResponse):
             self.challenge_html = bleach.clean(
                 self.challenge,
                 tags=['br', 'p', 'b', 'i', 'u', 'ul', 'ol', 'li'],
-                attributes=[],
+                attributes={},
             )
         else:
             self.challenge_html = bleach.clean(self.challenge, tags=[])
@@ -1040,8 +1040,8 @@ class FinTS3PinTanClient(FinTS3Client):
         if tan_process == '1':
             seg.segment_type = orig_seg.header.type
             account_ = getattr(orig_seg, 'account', None)
-            if isinstance(account, KTI1):
-                seg.account = account
+            if isinstance(account_, KTI1):
+                seg.account = account_
             raise NotImplementedError("TAN-Process 1 not implemented")
 
         if tan_process in ('1', '3', '4') and \
index eef17fd2b9d8e85dd6ea6ffd65681bf37a64f572..ef43fdfc413161a4bde8ade91ff11450b3bea727 100644 (file)
@@ -18,11 +18,11 @@ DATA_BLOB_MAGIC = b'python-fints_DIALOG_DATABLOB'
 
 
 class FinTSDialog:
-    def __init__(self, client=None, lazy_init=False, enc_mechanism=None, auth_mechanisms=[]):
+    def __init__(self, client=None, lazy_init=False, enc_mechanism=None, auth_mechanisms=None):
         self.client = client
-        self.next_message_number = dict((v, 1) for v in  MessageDirection)
+        self.next_message_number = dict((v, 1) for v in MessageDirection)
         self.messages = dict((v, {}) for v in MessageDirection)
-        self.auth_mechanisms = auth_mechanisms
+        self.auth_mechanisms = auth_mechanisms or []
         self.enc_mechanism = enc_mechanism
         self.open = False
         self.need_init = True