python-stdnum branch master updated. 1.16-15-gdcdb5c9
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
python-stdnum branch master updated. 1.16-15-gdcdb5c9
- From: Commits of the python-stdnum project <python-stdnum-commits [at] lists.arthurdejong.org>
- To: python-stdnum-commits [at] lists.arthurdejong.org
- Reply-to: python-stdnum-users [at] lists.arthurdejong.org, python-stdnum-commits [at] lists.arthurdejong.org
- Subject: python-stdnum branch master updated. 1.16-15-gdcdb5c9
- Date: Tue, 10 Aug 2021 14:12:04 +0200 (CEST)
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 dcdb5c9bdd20da7fdd5f7fcc9806a2b3c1d0c7ab (commit)
via abda03733949edfb45c746dfb09e409c40cc2e97 (commit)
via c69b4f680781283e4b3a2ca7c01d39dd7d6a2966 (commit)
from 45167482aa50efa62595be7d1895de8144b49cfd (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=dcdb5c9bdd20da7fdd5f7fcc9806a2b3c1d0c7ab
commit dcdb5c9bdd20da7fdd5f7fcc9806a2b3c1d0c7ab
Author: Dimitri Papadopoulos
<3234522+DimitriPapadopoulos@users.noreply.github.com>
Date: Sat Aug 7 23:13:26 2021 +0200
Explicilty define exported exceptions
LGTM alert: Import pollutes the enclosing namespace
See: https://lgtm.com/rules/3980091/
Closes https://github.com/arthurdejong/python-stdnum/pull/270
diff --git a/stdnum/exceptions.py b/stdnum/exceptions.py
index 1ffd21a..0cb8f12 100644
--- a/stdnum/exceptions.py
+++ b/stdnum/exceptions.py
@@ -25,6 +25,10 @@ when validation of the number fails.
"""
+__all__ = ['ValidationError', 'InvalidFormat', 'InvalidChecksum',
+ 'InvalidLength', 'InvalidComponent']
+
+
class ValidationError(Exception):
"""Top-level error for validating numbers.
https://arthurdejong.org/git/python-stdnum/commit/?id=abda03733949edfb45c746dfb09e409c40cc2e97
commit abda03733949edfb45c746dfb09e409c40cc2e97
Author: Dimitri Papadopoulos
<3234522+DimitriPapadopoulos@users.noreply.github.com>
Date: Sat Aug 7 22:59:14 2021 +0200
Simplify range checking in Norwegian birth numbers
LGTM alert: Test is always true
See: https://lgtm.com/rules/900073/
Closes https://github.com/arthurdejong/python-stdnum/pull/270
diff --git a/stdnum/no/fodselsnummer.py b/stdnum/no/fodselsnummer.py
index 50d27b6..ccdf1ad 100644
--- a/stdnum/no/fodselsnummer.py
+++ b/stdnum/no/fodselsnummer.py
@@ -96,9 +96,9 @@ def get_birth_date(number):
month -= 40
if individual_digits < 500:
year += 1900
- elif 500 <= individual_digits < 750 and year >= 54:
+ elif individual_digits < 750 and year >= 54:
year += 1800
- elif 500 <= individual_digits < 1000 and year < 40:
+ elif individual_digits < 1000 and year < 40:
year += 2000
elif 900 <= individual_digits < 1000 and year >= 40:
year += 1900
https://arthurdejong.org/git/python-stdnum/commit/?id=c69b4f680781283e4b3a2ca7c01d39dd7d6a2966
commit c69b4f680781283e4b3a2ca7c01d39dd7d6a2966
Author: Dimitri Papadopoulos
<3234522+DimitriPapadopoulos@users.noreply.github.com>
Date: Sat Aug 7 22:54:13 2021 +0200
Fix handling of empty worksheet in Belgian bank download
LGTM alert: Call to next() in a generator
See: https://lgtm.com/rules/11000086/
Closes https://github.com/arthurdejong/python-stdnum/pull/270
diff --git a/update/be_banks.py b/update/be_banks.py
index 890bfbe..3a59a60 100755
--- a/update/be_banks.py
+++ b/update/be_banks.py
@@ -62,8 +62,11 @@ def get_values(sheet):
"""Return values (from, to, bic, bank_name) from the worksheet."""
rows = sheet.get_rows()
# skip first two rows
- next(rows)
- next(rows)
+ try:
+ next(rows)
+ next(rows)
+ except StopIteration:
+ pass # ignore empty worksheet
# go over rows with values
for row in rows:
row = [clean(column.value) for column in row]
-----------------------------------------------------------------------
Summary of changes:
stdnum/exceptions.py | 4 ++++
stdnum/no/fodselsnummer.py | 4 ++--
update/be_banks.py | 7 +++++--
3 files changed, 11 insertions(+), 4 deletions(-)
hooks/post-receive
--
python-stdnum
- python-stdnum branch master updated. 1.16-15-gdcdb5c9,
Commits of the python-stdnum project