mirror of https://github.com/opencv/opencv.git
Open Source Computer Vision Library
https://opencv.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
674 B
30 lines
674 B
class Argument: |
|
def __init__(self, fields): |
|
self.ty = fields[0] |
|
self.nm = fields[1] |
|
self.flags = "" |
|
self.init = None |
|
|
|
if len(fields) > 2: |
|
if fields[2][0] == '/': |
|
self.flags = fields[2][1:].split(",") |
|
else: |
|
self.init = fields[2] |
|
|
|
def reader(apifile): |
|
api = [] |
|
for l in open(apifile): |
|
if l[0] == '#': |
|
continue |
|
l = l.rstrip() |
|
f = l.split() |
|
if len(f) != 0: |
|
if l[0] != ' ': |
|
if len(f) > 1: |
|
ty = f[1] |
|
else: |
|
ty = None |
|
api.append((f[0], [], ty)) |
|
else: |
|
api[-1][1].append(Argument(f)) |
|
return dict([(a, (ins, outs)) for (a, ins, outs) in api])
|
|
|