mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 07:13:02 +04:00
feat: named arguments handling in Python interface
This commit is contained in:
@@ -259,6 +259,10 @@ class CppHeaderParser(object):
|
||||
if "CV_EXPORTS_W_SIMPLE" in l:
|
||||
l = l.replace("CV_EXPORTS_W_SIMPLE", "")
|
||||
modlist.append("/Simple")
|
||||
if "CV_EXPORTS_W_PARAMS" in l:
|
||||
l = l.replace("CV_EXPORTS_W_PARAMS", "")
|
||||
modlist.append("/Map")
|
||||
modlist.append("/Params")
|
||||
npos = l.find("CV_EXPORTS_AS")
|
||||
if npos < 0:
|
||||
npos = l.find('CV_WRAP_AS')
|
||||
@@ -776,7 +780,15 @@ class CppHeaderParser(object):
|
||||
var_list = [var_name1] + [i.strip() for i in var_list[1:]]
|
||||
|
||||
for v in var_list:
|
||||
class_decl[3].append([var_type, v, "", var_modlist])
|
||||
prop_definition = v.split('=')
|
||||
prop_name = prop_definition[0].strip()
|
||||
if len(prop_definition) == 1:
|
||||
# default value is not provided
|
||||
prop_default_value = ''
|
||||
else:
|
||||
prop_default_value = prop_definition[-1]
|
||||
class_decl[3].append([var_type, prop_name, prop_default_value,
|
||||
var_modlist])
|
||||
return stmt_type, "", False, None
|
||||
|
||||
# something unknown
|
||||
|
||||
Reference in New Issue
Block a user