Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/getnumlist.py
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2012-02-26 16:24:56 +0100
committerArthur de Jong <arthur@arthurdejong.org>2012-02-26 16:24:56 +0100
commitc240effada49ef10dd0ed404a07888983fcd5212 (patch)
tree50e78a605ca182c15a799d0a10713e83c51095ee /getnumlist.py
parent54b0f47b4be383e1ec1a101caf2cca1679005ad4 (diff)
also generate a list of modules for use in the Spinx documentation
git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@170 9dea7c4f-944c-4273-ac1a-574ede026edc
Diffstat (limited to 'getnumlist.py')
-rwxr-xr-xgetnumlist.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/getnumlist.py b/getnumlist.py
index a14f67f..1ac89ae 100755
--- a/getnumlist.py
+++ b/getnumlist.py
@@ -31,6 +31,13 @@ from stdnum import util
algortihms = ('stdnum.verhoeff', 'stdnum.luhn', 'stdnum.iso7064')
+def get_number_modules():
+ """Provides the number modules that are not algorithms."""
+ for module in util.get_number_modules():
+ if module.__name__ not in algortihms and \
+ not module.__name__.startswith('stdnum.iso7064'):
+ yield module
+
def get_number_name(module):
"""Return the short description of the number module."""
return pydoc.splitdoc(pydoc.getdoc(module))[0]
@@ -39,7 +46,10 @@ def get_number_name(module):
if __name__ == '__main__':
print 'Currently this package supports the following formats:'
print ''
- for module in util.get_number_modules():
- if module.__name__ not in algortihms and \
- not module.__name__.startswith('stdnum.iso7064'):
- print ' * %s' % get_number_name(module)
+ for module in get_number_modules():
+ print ' * %s' % get_number_name(module)
+ print ''
+ print 'For use in Spinx documentation:'
+ print ''
+ for module in get_number_modules():
+ print ' %s' % module.__name__.replace('stdnum.', '')