Skip to content

Conversation

@asenyaev
Copy link
Contributor

@asenyaev asenyaev commented Nov 11, 2021

Tested in my fork repo:

Comment on lines 368 to 378
# lines for a proper work using pylint and an autocomplete in IDE
with open("%spython/cv2/__init__.py"
% cmake_install_dir, 'r') as opencv_init:
opencv_init_lines = opencv_init.readlines()
extra_imports = ('\nfrom .cv2 import *\nfrom . import data\n')
free_line_after_imports = 5
opencv_init_lines.insert(free_line_after_imports, extra_imports)

with open("%spython/cv2/__init__.py"
% cmake_install_dir, 'w') as opencv_final_init:
opencv_final_init.writelines(opencv_init_lines)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same logic as in #579, but we have here only two imports.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.path.join should be better than string substitution.

Copy link
Contributor Author

@asenyaev asenyaev Nov 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it in the latest commit.

@asenyaev asenyaev requested a review from asmorkalov November 11, 2021 13:53
@asenyaev asenyaev merged commit 824a3b2 into opencv:3.4 Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants