lists.arthurdejong.org
RSS feed

python-stdnum branch master updated. 1.10-10-g4cb44aa

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

python-stdnum branch master updated. 1.10-10-g4cb44aa



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  4cb44aa747c9674222fefb4f696e6c7db33260c9 (commit)
      from  3f4a08a7c1317c7147e17b4f97c9ae6ab7818ccd (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=4cb44aa747c9674222fefb4f696e6c7db33260c9

commit 4cb44aa747c9674222fefb4f696e6c7db33260c9
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Tue Jan 29 19:55:33 2019 +0100

    Call compact in get_birth_date() functions
    
    This ensures that formatting characters are also removed when formatted
    numbers are passed to the get_birth_date() functions.
    
    Closes https://github.com/arthurdejong/python-stdnum/issues/94

diff --git a/stdnum/bg/egn.py b/stdnum/bg/egn.py
index 56837b4..5ee9819 100644
--- a/stdnum/bg/egn.py
+++ b/stdnum/bg/egn.py
@@ -1,7 +1,7 @@
 # egn.py - functions for handling Bulgarian national identification numbers
 # coding: utf-8
 #
-# Copyright (C) 2012-2015 Arthur de Jong
+# Copyright (C) 2012-2019 Arthur de Jong
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -62,6 +62,7 @@ def calc_check_digit(number):
 
 def get_birth_date(number):
     """Split the date parts from the number and return the birth date."""
+    number = compact(number)
     year = int(number[0:2]) + 1900
     month = int(number[2:4])
     day = int(number[4:6])
diff --git a/stdnum/cz/rc.py b/stdnum/cz/rc.py
index 603f7ee..c86f00a 100644
--- a/stdnum/cz/rc.py
+++ b/stdnum/cz/rc.py
@@ -1,7 +1,7 @@
 # rc.py - functions for handling Czech birth numbers
 # coding: utf-8
 #
-# Copyright (C) 2012, 2013 Arthur de Jong
+# Copyright (C) 2012-2019 Arthur de Jong
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -61,6 +61,7 @@ def compact(number):
 
 def get_birth_date(number):
     """Split the date parts from the number and return the birth date."""
+    number = compact(number)
     year = 1900 + int(number[0:2])
     # females have 50 added to the month value, 20 is added when the serial
     # overflows (since 2004)
diff --git a/stdnum/dk/cpr.py b/stdnum/dk/cpr.py
index 54117fa..841c0e9 100644
--- a/stdnum/dk/cpr.py
+++ b/stdnum/dk/cpr.py
@@ -1,6 +1,6 @@
 # cpr.py - functions for handling Danish CPR numbers
 #
-# Copyright (C) 2012-2015 Arthur de Jong
+# Copyright (C) 2012-2019 Arthur de Jong
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -73,6 +73,7 @@ def checksum(number):
 
 def get_birth_date(number):
     """Split the date parts from the number and return the birth date."""
+    number = compact(number)
     day = int(number[0:2])
     month = int(number[2:4])
     year = int(number[4:6])
diff --git a/stdnum/lv/pvn.py b/stdnum/lv/pvn.py
index fbf81cb..b874dd8 100644
--- a/stdnum/lv/pvn.py
+++ b/stdnum/lv/pvn.py
@@ -1,7 +1,7 @@
 # pvn.py - functions for handling Latvian PVN (VAT) numbers
 # coding: utf-8
 #
-# Copyright (C) 2012-2017 Arthur de Jong
+# Copyright (C) 2012-2019 Arthur de Jong
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -76,6 +76,7 @@ def calc_check_digit_pers(number):
 
 def get_birth_date(number):
     """Split the date parts from the number and return the birth date."""
+    number = compact(number)
     day = int(number[0:2])
     month = int(number[2:4])
     year = int(number[4:6])
diff --git a/stdnum/ro/cnp.py b/stdnum/ro/cnp.py
index be815a2..46e034e 100644
--- a/stdnum/ro/cnp.py
+++ b/stdnum/ro/cnp.py
@@ -1,7 +1,7 @@
 # cnp.py - functions for handling Romanian CNP numbers
 # coding: utf-8
 #
-# Copyright (C) 2012-2015 Arthur de Jong
+# Copyright (C) 2012-2019 Arthur de Jong
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -62,6 +62,7 @@ def calc_check_digit(number):
 
 def get_birth_date(number):
     """Split the date parts from the number and return the birth date."""
+    number = compact(number)
     centuries = {
         '1': 1900, '2': 1900, '3': 1800, '4': 1800, '5': 2000, '6': 2000,
     }  # we assume 1900 for the others in order to try to construct a date

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

Summary of changes:
 stdnum/bg/egn.py | 3 ++-
 stdnum/cz/rc.py  | 3 ++-
 stdnum/dk/cpr.py | 3 ++-
 stdnum/lv/pvn.py | 3 ++-
 stdnum/ro/cnp.py | 3 ++-
 5 files changed, 10 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
python-stdnum
-- 
To unsubscribe send an email to
python-stdnum-commits-unsubscribe@lists.arthurdejong.org or see
https://lists.arthurdejong.org/python-stdnum-commits/