lists.arthurdejong.org
RSS feed

python-stdnum branch master updated. 1.17-15-g9f79691

[Date Prev][Date Next] [Thread Prev][Thread Next]

python-stdnum branch master updated. 1.17-15-g9f79691



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-stdnum".

The branch, master has been updated
       via  9f796913ca9817936ceee9e1c74d8297ca9b6a42 (commit)
      from  a280d53af4c65ea9731ab2aa99f676114ac20ee1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://arthurdejong.org/git/python-stdnum/commit/?id=9f796913ca9817936ceee9e1c74d8297ca9b6a42

commit 9f796913ca9817936ceee9e1c74d8297ca9b6a42
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Fri Aug 12 20:07:53 2022 +0200

    Fix flake8 error
    
    This stops using not as a function and hopefully also makes the logic
    clearer.

diff --git a/stdnum/it/iva.py b/stdnum/it/iva.py
index 2670f99..5c7aecd 100644
--- a/stdnum/it/iva.py
+++ b/stdnum/it/iva.py
@@ -57,8 +57,7 @@ def validate(number):
     if len(number) != 11:
         raise InvalidLength()
     # check the province of residence
-    if not('001' <= number[7:10] <= '100') and \
-            number[7:10] not in ('120', '121', '888', '999'):
+    if not ('001' <= number[7:10] <= '100' or number[7:10] in ('120', '121', 
'888', '999')):
         raise InvalidComponent()
     luhn.validate(number)
     return number
diff --git a/update/iban.py b/update/iban.py
index 11f2742..db5f6a2 100755
--- a/update/iban.py
+++ b/update/iban.py
@@ -59,7 +59,7 @@ if __name__ == '__main__':
     # output the collected data
     for i, data in values.items():
         bban = data['BBAN structure']
-        if not(bban) or bban.lower() == 'n/a':
+        if not bban or bban.lower() == 'n/a':
             bban = data['IBAN structure']
         bban = bban.replace(' ', '')
         cc = data['IBAN prefix country code (ISO 3166)'][:2]

-----------------------------------------------------------------------

Summary of changes:
 stdnum/it/iva.py | 3 +--
 update/iban.py   | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
python-stdnum