Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/samples/python/_doc.py
16337 views
1
#!/usr/bin/env python
2
3
'''
4
Scans current directory for *.py files and reports
5
ones with missing __doc__ string.
6
'''
7
8
# Python 2/3 compatibility
9
from __future__ import print_function
10
11
from glob import glob
12
13
if __name__ == '__main__':
14
print('--- undocumented files:')
15
for fn in glob('*.py'):
16
loc = {}
17
try:
18
try:
19
execfile(fn, loc) # Python 2
20
except NameError:
21
exec(open(fn).read(), loc) # Python 3
22
except Exception:
23
pass
24
if '__doc__' not in loc:
25
print(fn)
26
27