1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Various Python samples updated for Python 2/3 compatibility.

This commit is contained in:
Adam Gibson
2015-09-14 00:00:22 +08:00
parent 190d00ea3e
commit b57be28920
34 changed files with 288 additions and 99 deletions
+11 -3
View File
@@ -5,12 +5,20 @@ Scans current directory for *.py files and reports
ones with missing __doc__ string.
'''
# Python 2/3 compatibility
from __future__ import print_function
import sys
PY3 = sys.version_info[0] == 3
from glob import glob
if __name__ == '__main__':
print '--- undocumented files:'
print('--- undocumented files:')
for fn in glob('*.py'):
loc = {}
execfile(fn, loc)
if PY3:
exec(open(fn).read(), loc)
else:
execfile(fn, loc)
if '__doc__' not in loc:
print fn
print(fn)