_doc.py 573 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 11 12
# Python 2/3 compatibility
from __future__ import print_function
import sys
PY3 = sys.version_info[0] == 3

13 14 15
from glob import glob

if __name__ == '__main__':
16
    print('--- undocumented files:')
17 18
    for fn in glob('*.py'):
        loc = {}
19 20 21 22 23 24 25
        try:
            if PY3:
                exec(open(fn).read(), loc)
            else:
                execfile(fn, loc)
        except:
            pass
26
        if '__doc__' not in loc:
27
            print(fn)