mirror of
https://github.com/opencv/opencv.git
synced 2025-01-19 06:53:50 +08:00
Small fixes for documentation checking script
This commit is contained in:
parent
ddd9a99c66
commit
18a8721f49
@ -37,6 +37,11 @@ doc_signatures_whitelist = [
|
|||||||
# these are even non-template
|
# these are even non-template
|
||||||
"gpu::DeviceInfo", "gpu::GpuMat", "gpu::TargetArchs", "gpu::FeatureSet"]
|
"gpu::DeviceInfo", "gpu::GpuMat", "gpu::TargetArchs", "gpu::FeatureSet"]
|
||||||
|
|
||||||
|
defines = ["cvGraphEdgeIdx", "cvFree", "CV_Assert", "cvSqrt", "cvGetGraphVtx", "cvGraphVtxIdx",
|
||||||
|
# not a real function but behaves as function
|
||||||
|
"Mat.size"
|
||||||
|
]
|
||||||
|
|
||||||
synonims = {
|
synonims = {
|
||||||
"StarDetector" : ["StarFeatureDetector"],
|
"StarDetector" : ["StarFeatureDetector"],
|
||||||
"MSER" : ["MserFeatureDetector"],
|
"MSER" : ["MserFeatureDetector"],
|
||||||
@ -191,6 +196,8 @@ def process_module(module, path):
|
|||||||
namespaces.append(namespace)
|
namespaces.append(namespace)
|
||||||
else:
|
else:
|
||||||
funcs.append(decl)
|
funcs.append(decl)
|
||||||
|
# if "RNG" in decl[0]:
|
||||||
|
# print decl
|
||||||
|
|
||||||
clsnamespaces = []
|
clsnamespaces = []
|
||||||
# process classes
|
# process classes
|
||||||
@ -391,6 +398,8 @@ def process_module(module, path):
|
|||||||
decls = doc.get("decls")
|
decls = doc.get("decls")
|
||||||
if not decls:
|
if not decls:
|
||||||
continue
|
continue
|
||||||
|
# if "RNG" in name:
|
||||||
|
# print name, decls
|
||||||
for signature in decls:
|
for signature in decls:
|
||||||
if signature[0] == "C" or signature[0] == "C++":
|
if signature[0] == "C" or signature[0] == "C++":
|
||||||
if "template" in (signature[2][1] or ""):
|
if "template" in (signature[2][1] or ""):
|
||||||
@ -434,7 +443,11 @@ def process_module(module, path):
|
|||||||
for d in doc.get("decls", []):
|
for d in doc.get("decls", []):
|
||||||
if d[-1] != DOCUMENTED_MARKER:
|
if d[-1] != DOCUMENTED_MARKER:
|
||||||
if d[0] == "C" or d[0] =="C++" or (do_python_crosscheck and d[0].startswith("Python")):
|
if d[0] == "C" or d[0] =="C++" or (do_python_crosscheck and d[0].startswith("Python")):
|
||||||
|
if d[0][0] == 'C' and d[2][0][3:] in defines:
|
||||||
|
#TODO: need to find a way to verify #define's
|
||||||
|
continue
|
||||||
logerror(ERROR_011_UNKNOWNFUNC, d[0] + " function is documented but is not found in OpenCV headers. It is documented as:\n\t" + d[1], doc)
|
logerror(ERROR_011_UNKNOWNFUNC, d[0] + " function is documented but is not found in OpenCV headers. It is documented as:\n\t" + d[1], doc)
|
||||||
|
#print d[2][0][3:]
|
||||||
# end of process_module
|
# end of process_module
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -160,7 +160,7 @@ Sub-pixel accurate size of a rectangle.
|
|||||||
|
|
||||||
Height of the rectangle
|
Height of the rectangle
|
||||||
|
|
||||||
.. ocv:cfunction:: CvSize2D32f cvSize2D23f( float width, float height )
|
.. ocv:cfunction:: CvSize2D32f cvSize2D32f( double width, double height )
|
||||||
|
|
||||||
constructs ``CvSize2D32f`` structure.
|
constructs ``CvSize2D32f`` structure.
|
||||||
|
|
||||||
|
@ -419,6 +419,9 @@ class CppHeaderParser(object):
|
|||||||
print "Error at %d: no args in '%s'" % (self.lineno, decl_str)
|
print "Error at %d: no args in '%s'" % (self.lineno, decl_str)
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
decl_start = decl_str[:args_begin].strip()
|
decl_start = decl_str[:args_begin].strip()
|
||||||
|
# TODO: normalize all type of operators
|
||||||
|
if decl_start.endswith("()"):
|
||||||
|
decl_start = decl_start[0:-2].rstrip() + " ()"
|
||||||
|
|
||||||
# constructor/destructor case
|
# constructor/destructor case
|
||||||
if bool(re.match(r'(\w+::)*(?P<x>\w+)::~?(?P=x)', decl_start)):
|
if bool(re.match(r'(\w+::)*(?P<x>\w+)::~?(?P=x)', decl_start)):
|
||||||
|
Loading…
Reference in New Issue
Block a user