File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ def asset_path(asset_name):
7171 "txt" : file_empty_icon ,
7272 "toml" : file_icon ,
7373 "bmp" : file_image_icon ,
74+ "png" : file_image_icon ,
7475 "wav" : file_music_icon ,
7576 "mp3" : file_music_icon ,
7677 "mid" : file_music_icon ,
Original file line number Diff line number Diff line change @@ -165,6 +165,7 @@ def get_files_for_project(project_name):
165165
166166
167167def get_libs_for_project (project_name ):
168+ # pylint: disable=too-many-nested-blocks
168169 """Get the set of libraries for a learn project"""
169170 found_libs = set ()
170171 found_imports = []
@@ -173,12 +174,27 @@ def get_libs_for_project(project_name):
173174 if file .endswith (".py" ):
174175
175176 found_imports = findimports .find_imports (f"{ project_dir } { file } " )
176-
177177 for cur_import in found_imports :
178178 cur_lib = cur_import .name .split ("." )[0 ]
179179 if cur_lib in bundle_data or cur_lib in community_bundle_data :
180180 found_libs .add (cur_lib )
181181
182+ # findimports returns import name in the form of "foo.bar.*"
183+ if cur_import .name .endswith (".*" ):
184+ filepath = os .path .join (
185+ project_dir ,
186+ os .path .join (* cur_import .name [:- 2 ].split ("." )) + ".py" ,
187+ )
188+ if os .path .exists (filepath ):
189+ second_level_imports = findimports .find_imports (filepath )
190+ for cur_second_level_import in second_level_imports :
191+ cur_lib = cur_second_level_import .name .split ("." )[0 ]
192+ if (
193+ cur_lib in bundle_data
194+ or cur_lib in community_bundle_data
195+ ):
196+ found_libs .add (cur_lib )
197+
182198 return found_libs
183199
184200
You can’t perform that action at this time.
0 commit comments