_doc.py 583 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env python
  2. '''
  3. Scans current directory for *.py files and reports
  4. ones with missing __doc__ string.
  5. '''
  6. # Python 2/3 compatibility
  7. from __future__ import print_function
  8. from glob import glob
  9. if __name__ == '__main__':
  10. print('--- undocumented files:')
  11. for fn in glob('*.py'):
  12. loc = {}
  13. try:
  14. try:
  15. execfile(fn, loc) # Python 2
  16. except NameError:
  17. exec(open(fn).read(), loc) # Python 3
  18. except Exception:
  19. pass
  20. if '__doc__' not in loc:
  21. print(fn)