lists.arthurdejong.org
RSS feed

python-stdnum commit: r98 - python-stdnum/stdnum/nl

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

python-stdnum commit: r98 - python-stdnum/stdnum/nl



Author: arthur
Date: Sat Feb  4 20:11:10 2012
New Revision: 98
URL: http://arthurdejong.org/viewvc/python-stdnum?revision=98&view=revision

Log:
rename calc_checksum() to checksum() for consistency

Modified:
   python-stdnum/stdnum/nl/bsn.py
   python-stdnum/stdnum/nl/onderwijsnummer.py

Modified: python-stdnum/stdnum/nl/bsn.py
==============================================================================
--- python-stdnum/stdnum/nl/bsn.py      Sat Feb  4 20:06:53 2012        (r97)
+++ python-stdnum/stdnum/nl/bsn.py      Sat Feb  4 20:11:10 2012        (r98)
@@ -39,7 +39,7 @@
     return (9 - len(number)) * '0' + number
 
 
-def calc_checksum(number):
+def checksum(number):
     """Calculate the checksum over the number."""
     return (sum((9 - i) * int(number[i]) for i in range(8)) -
             int(number[8])) % 11
@@ -55,7 +55,7 @@
     return len(number) == 9 and \
            number.isdigit() and \
            int(number) > 0 and \
-           calc_checksum(number) == 0
+           checksum(number) == 0
 
 
 def format(number):

Modified: python-stdnum/stdnum/nl/onderwijsnummer.py
==============================================================================
--- python-stdnum/stdnum/nl/onderwijsnummer.py  Sat Feb  4 20:06:53 2012        
(r97)
+++ python-stdnum/stdnum/nl/onderwijsnummer.py  Sat Feb  4 20:11:10 2012        
(r98)
@@ -28,7 +28,7 @@
 '123456782'
 """
 
-from stdnum.nl.bsn import compact, calc_checksum
+from stdnum.nl.bsn import compact, checksum
 
 
 def is_valid(number):
@@ -42,5 +42,5 @@
     return len(number) == 9 and \
            number.isdigit() and \
            int(number) > 0 and \
-           calc_checksum(number) == 5 and \
+           checksum(number) == 5 and \
            number.startswith('10')
-- 
To unsubscribe send an email to
python-stdnum-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/python-stdnum-commits/