Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
006d5ac0
Commit
006d5ac0
authored
Dec 14, 2015
by
flp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapted for py2/py3 compatibility
parent
aee03cd5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
_doc.py
samples/python2/_doc.py
+14
-3
No files found.
samples/python2/_doc.py
View file @
006d5ac0
...
...
@@ -5,12 +5,23 @@ 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
)
try
:
if
PY3
:
exec
(
open
(
fn
)
.
read
(),
loc
)
else
:
execfile
(
fn
,
loc
)
except
:
pass
if
'__doc__'
not
in
loc
:
print
fn
print
(
fn
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment