Skip to content

Commit

Permalink
Evision.__enabled_modules__/0 => Evision.enabled_modules/0
Browse files Browse the repository at this point in the history
  • Loading branch information
cocoa-xu committed Jan 12, 2023
1 parent 086ca23 commit 57b0812
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions py_src/gen2.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def gen_enabled_modules(self):
]
}

num_total_modules = sum([len(compoents) for s, compoents in all_modules.items()])
num_total_modules = sum([len(components) for s, components in all_modules.items()])
self.code_funcs.write("static ERL_NIF_TERM evision_cv_enabled_modules(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]){\n")
self.code_funcs.write(f""" const size_t num_total_modules = {num_total_modules};
size_t index = 0;
Expand All @@ -491,10 +491,10 @@ def gen_enabled_modules(self):
ERL_NIF_TERM values[num_total_modules];
""")

for _, compoents in all_modules.items():
for compoent in compoents:
self.code_funcs.write(f""" keys[index] = evision::nif::atom(env, "{compoent}");
#ifdef HAVE_OPENCV_{compoent.upper()}
for _, components in all_modules.items():
for component in components:
self.code_funcs.write(f""" keys[index] = evision::nif::atom(env, "{component}");
#ifdef HAVE_OPENCV_{component.upper()}
values[index] = evision::nif::atom(env, "true");
#else
values[index] = evision::nif::atom(env, "false");
Expand Down

0 comments on commit 57b0812

Please sign in to comment.