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
cbf2b51e
Commit
cbf2b51e
authored
Aug 28, 2017
by
Alexander Alekhin
Committed by
Alexander Alekhin
Nov 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bindings(py): fix handling of 'isalgorithm'
parent
f071a48e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
gen2.py
modules/python/src2/gen2.py
+19
-1
No files found.
modules/python/src2/gen2.py
View file @
cbf2b51e
...
...
@@ -1027,10 +1027,28 @@ class PythonWrapperGenerator(object):
print
(
"Generator error: unable to resolve base
%
s for
%
s"
%
(
classinfo
.
base
,
classinfo
.
name
))
sys
.
exit
(
-
1
)
base_instance
=
self
.
classes
[
base
]
classinfo
.
base
=
base
classinfo
.
isalgorithm
|=
self
.
classes
[
base
]
.
isalgorithm
classinfo
.
isalgorithm
|=
base_instance
.
isalgorithm
# wrong processing of 'isalgorithm' flag:
# doesn't work for trees(graphs) with depth > 2
self
.
classes
[
name
]
=
classinfo
# tree-based propagation of 'isalgorithm'
processed
=
dict
()
def
process_isalgorithm
(
classinfo
):
if
classinfo
.
isalgorithm
or
classinfo
in
processed
:
return
classinfo
.
isalgorithm
res
=
False
if
classinfo
.
base
:
res
=
process_isalgorithm
(
self
.
classes
[
classinfo
.
base
])
#assert not (res == True or classinfo.isalgorithm is False), "Internal error: " + classinfo.name + " => " + classinfo.base
classinfo
.
isalgorithm
|=
res
res
=
classinfo
.
isalgorithm
processed
[
classinfo
]
=
True
return
res
for
name
,
classinfo
in
self
.
classes
.
items
():
process_isalgorithm
(
classinfo
)
# step 2: generate code for the classes and their methods
classlist
=
list
(
self
.
classes
.
items
())
classlist
.
sort
()
...
...
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