python-stdnum commit: r6 - in python-stdnum/stdnum: . isbn
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
python-stdnum commit: r6 - in python-stdnum/stdnum: . isbn
- 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 commit: r6 - in python-stdnum/stdnum: . isbn
- Date: Sun, 25 Jul 2010 11:21:26 +0200 (CEST)
Author: arthur
Date: Sun Jul 25 11:21:25 2010
New Revision: 6
URL: http://arthurdejong.org/viewvc/python-stdnum?view=rev&revision=6
Log:
spelling check an extra doctest and a simplification
Modified:
python-stdnum/stdnum/bsn.py
python-stdnum/stdnum/isbn/__init__.py
python-stdnum/stdnum/isbn/ranges.py
python-stdnum/stdnum/issn.py
Modified: python-stdnum/stdnum/bsn.py
==============================================================================
--- python-stdnum/stdnum/bsn.py Fri Jul 23 21:13:39 2010 (r5)
+++ python-stdnum/stdnum/bsn.py Sun Jul 25 11:21:25 2010 (r6)
@@ -18,7 +18,7 @@
# 02110-1301 USA
"""Module for handling BSNs (Burgerservicenummer), the
-Ducth national identification number.
+Dutch national identification number.
>>> validate('111222333')
True
Modified: python-stdnum/stdnum/isbn/__init__.py
==============================================================================
--- python-stdnum/stdnum/isbn/__init__.py Fri Jul 23 21:13:39 2010
(r5)
+++ python-stdnum/stdnum/isbn/__init__.py Sun Jul 25 11:21:25 2010
(r6)
@@ -17,8 +17,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
-"""Module for handling ISBNs. This module handles both numbers in ISBN10
-(10-digit) and ISB13 (13-digit) format.
+"""Module for handling ISBNs (International Standard Book Number). This
+module handles both numbers in ISBN10 (10-digit) and ISBN13 (13-digit)
+format.
>>> validate('978-9024538270')
True
@@ -28,6 +29,8 @@
'1857982185'
>>> format('9780471117094')
'978-0-471-11709-4'
+>>> format('1857982185')
+'1-85798-218-5'
>>> isbn_type('1-85798-218-5')
'ISBN10'
>>> isbn_type('978-0-471-11709-4')
@@ -100,7 +103,7 @@
def split(number):
"""Split the specified ISBN into an EAN.UCC prefix, a group prefix, a
- registrant, an item number and a check-digit. If the number is in ISNB10
+ registrant, an item number and a check-digit. If the number is in ISBN10
format the returned EAN.UCC prefix is '978'."""
import ranges
# clean up number
Modified: python-stdnum/stdnum/isbn/ranges.py
==============================================================================
--- python-stdnum/stdnum/isbn/ranges.py Fri Jul 23 21:13:39 2010 (r5)
+++ python-stdnum/stdnum/isbn/ranges.py Sun Jul 25 11:21:25 2010 (r6)
@@ -301,7 +301,7 @@
def load(fp):
"""Loads the data from the specified file descriptor. The provided file
should match the format of the RangeMessage.xml file."""
- # this is inline to avoid importing xml.sax for normal use
+ # this is in-line to avoid importing xml.sax for normal use
import xml.sax
# initialise data
global _prefixes
@@ -379,10 +379,9 @@
except NameError:
headerprinted = False
# print the actual prefixes
- prefixes = _prefixes.keys()
+ prefixes = _prefixes.items()
prefixes.sort()
- for prefix in prefixes:
- ranges = _prefixes[prefix]
+ for prefix, ragnes in prefixes:
for line in _wrap(' '.join(r[1] + '-' + r[2] for r in ranges), 77 -
len(prefix)):
fp.write('%s %s\n' % ( prefix, line ) )
# print the footer if the header was printed
Modified: python-stdnum/stdnum/issn.py
==============================================================================
--- python-stdnum/stdnum/issn.py Fri Jul 23 21:13:39 2010 (r5)
+++ python-stdnum/stdnum/issn.py Sun Jul 25 11:21:25 2010 (r6)
@@ -18,7 +18,7 @@
# 02110-1301 USA
"""Module for handling ISSNs (International Standard Serial Number), the
-standard internation code to identify serial publications.
+standard code to identify serial publications.
>>> validate('0024-9319')
True
--
To unsubscribe send an email to
python-stdnum-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/python-stdnum-commits
- python-stdnum commit: r6 - in python-stdnum/stdnum: . isbn,
Commits of the python-stdnum project.