_doc.py 583 Bytes
Newer Older
1
#!/usr/bin/env python
2

3 4 5 6 7
'''
Scans current directory for *.py files and reports
ones with missing __doc__ string.
'''

8 9 10
# Python 2/3 compatibility
from __future__ import print_function

11 12 13
from glob import glob

if __name__ == '__main__':
14
    print('--- undocumented files:')
15 16
    for fn in glob('*.py'):
        loc = {}
17
        try:
18 19 20 21 22
            try:
                execfile(fn, loc)           # Python 2
            except NameError:
                exec(open(fn).read(), loc)  # Python 3
        except Exception:
23
            pass
24
        if '__doc__' not in loc:
25
            print(fn)