python-stdnum branch master updated. 0.7-10-ga655e82
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
python-stdnum branch master updated. 0.7-10-ga655e82
- 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
- Subject: python-stdnum branch master updated. 0.7-10-ga655e82
- Date: Fri, 7 Jun 2013 19:10:06 +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 a655e8272c8318f82be7db265d29ebf60a3d3dbf (commit)
via 37a2afd6f970c73680209e212cb425ac2c92dbec (commit)
from 90b7c4af1c48a74f15c4dff9fcf959fc69da7aac (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 -----------------------------------------------------------------
http://arthurdejong.org/git/python-stdnum/commit/?id=a655e8272c8318f82be7db265d29ebf60a3d3dbf
commit a655e8272c8318f82be7db265d29ebf60a3d3dbf
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Fri Jun 7 19:07:18 2013 +0200
Documentation consistency improvements
diff --git a/docs/conf.py b/docs/conf.py
index b10a97d..27938fd 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -27,7 +27,10 @@ import stdnum
# Add any Sphinx extension module names here, as strings. They can be
extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo',
'sphinx.ext.coverage', 'sphinx.ext.autosummary']
+extensions = [
+ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo',
+ 'sphinx.ext.coverage', 'sphinx.ext.autosummary'
+]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -43,7 +46,7 @@ master_doc = 'index'
# General information about the project.
project = u'python-stdnum'
-copyright = u'2012, Arthur de Jong'
+copyright = u'2013, Arthur de Jong'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
diff --git a/docs/index.rst b/docs/index.rst
index d1ec703..dc82fbe 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -11,6 +11,7 @@ or some common formatting is eligible for inclusion in this
library.
http://arthurdejong.org/python-stdnum/
+
Common Interface
----------------
@@ -18,26 +19,29 @@ Most of the number format modules implement the following
functions:
.. function:: is_valid(number)
- Returns either True or False depending on whether the passed number is
+ Return either True or False depending on whether the passed number is
in any supported and valid form and passes all embedded checks of the
- number.
+ number. This function should never raise an exception.
.. function:: compact(number)
- Returns a compact representation of the number or code. This function
+ Return a compact representation of the number or code. This function
generally does not do validation but may raise exceptions for wildly
invalid numbers.
.. function:: format(number)
- Returns a formatted version of the number in the preferred format.
- This function generally expects to be passed a valid number or code.
+ Return a formatted version of the number in the preferred format.
+ This function generally expects to be passed a valid number or code and
+ may raise exceptions for invalid numbers.
The check digit modules generally also provide the following functions:
.. function:: checksum(number)
- Calculate the checksum over the provided number.
+ Calculate the checksum over the provided number. This is generally a
+ number that can be used to determine whether the provided number is
+ valid. It depends on the algorithm which checksum is considered valid.
.. function:: calc_check_digit(number)
@@ -57,6 +61,7 @@ Generic check digit algorithms
luhn
verhoeff
+
Available formats
-----------------
http://arthurdejong.org/git/python-stdnum/commit/?id=37a2afd6f970c73680209e212cb425ac2c92dbec
commit 37a2afd6f970c73680209e212cb425ac2c92dbec
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Fri Jun 7 18:24:14 2013 +0200
The robustness test were moved to the general tests
diff --git a/tests/test_iso7064.doctest b/tests/test_iso7064.doctest
index 7ccbda2..58e2adb 100644
--- a/tests/test_iso7064.doctest
+++ b/tests/test_iso7064.doctest
@@ -66,19 +66,3 @@ These normal tests of Mod 37, 2 should just work
>>> mod_37_2.calc_check_digit('G123498654321')
'H'
-
-
-Furthermore the is_valid() method should be fairly robust against invalid
-junk passed:
-
->>> testvalues = ( None, '*&^%$', False, object() )
->>> [ x for x in testvalues if mod_11_10.is_valid(x) ]
-[]
->>> [ x for x in testvalues if mod_11_2.is_valid(x) ]
-[]
->>> [ x for x in testvalues if mod_37_2.is_valid(x) ]
-[]
->>> [ x for x in testvalues if mod_37_36.is_valid(x) ]
-[]
->>> [ x for x in testvalues if mod_97_10.is_valid(x) ]
-[]
-----------------------------------------------------------------------
Summary of changes:
docs/conf.py | 7 +++++--
docs/index.rst | 17 +++++++++++------
tests/test_iso7064.doctest | 16 ----------------
3 files changed, 16 insertions(+), 24 deletions(-)
hooks/post-receive
--
python-stdnum
--
To unsubscribe send an email to
python-stdnum-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/python-stdnum-commits/
- python-stdnum branch master updated. 0.7-10-ga655e82,
Commits of the python-stdnum project