Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 19ed001

Browse filesBrowse files
committed
Added lines for a proper work using pylint and an autocomplete in IDE
1 parent c50150e commit 19ed001
Copy full SHA for 19ed001

File tree

Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed

‎setup.py

Copy file name to clipboardExpand all lines: setup.py
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,18 @@ def _classify_installed_files_override(
365365

366366
print("Copying files from CMake output")
367367

368+
# lines for a proper work using pylint and an autocomplete in IDE
369+
with open("%spython/cv2/__init__.py"
370+
% cmake_install_dir, 'r') as opencv_init:
371+
opencv_init_lines = opencv_init.readlines()
372+
extra_imports = ('\nfrom .cv2 import *\nfrom . import data\n')
373+
free_line_after_imports = 5
374+
opencv_init_lines.insert(free_line_after_imports, extra_imports)
375+
376+
with open("%spython/cv2/__init__.py"
377+
% cmake_install_dir, 'w') as opencv_final_init:
378+
opencv_final_init.writelines(opencv_init_lines)
379+
368380
# add lines from the old __init__.py file to the config file
369381
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'scripts', '__init__.py'), 'r') as custom_init:
370382
custom_init_data = custom_init.read()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.