From c240effada49ef10dd0ed404a07888983fcd5212 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sun, 26 Feb 2012 15:24:56 +0000 Subject: 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 --- getnumlist.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'getnumlist.py') 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.', '') -- cgit v1.2.3