File tree 2 files changed +15
-1
lines changed
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ def asset_path(asset_name):
71
71
"txt" : file_empty_icon ,
72
72
"toml" : file_icon ,
73
73
"bmp" : file_image_icon ,
74
+ "png" : file_image_icon ,
74
75
"wav" : file_music_icon ,
75
76
"mp3" : file_music_icon ,
76
77
"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):
165
165
166
166
167
167
def get_libs_for_project (project_name ):
168
+ # pylint: disable=too-many-nested-blocks
168
169
"""Get the set of libraries for a learn project"""
169
170
found_libs = set ()
170
171
found_imports = []
@@ -173,11 +174,23 @@ def get_libs_for_project(project_name):
173
174
if file .endswith (".py" ):
174
175
175
176
found_imports = findimports .find_imports (f"{ project_dir } { file } " )
176
-
177
177
for cur_import in found_imports :
178
178
cur_lib = cur_import .name .split ("." )[0 ]
179
179
if cur_lib in bundle_data or cur_lib in community_bundle_data :
180
180
found_libs .add (cur_lib )
181
+ if cur_import .name .endswith (".*" ):
182
+ filepath = os .path .join (
183
+ project_dir , "/" .join (cur_import .name [:- 2 ].split ("." )) + ".py"
184
+ )
185
+ if os .path .exists (filepath ):
186
+ second_level_imports = findimports .find_imports (filepath )
187
+ for cur_second_level_import in second_level_imports :
188
+ cur_lib = cur_second_level_import .name .split ("." )[0 ]
189
+ if (
190
+ cur_lib in bundle_data
191
+ or cur_lib in community_bundle_data
192
+ ):
193
+ found_libs .add (cur_lib )
181
194
182
195
return found_libs
183
196
You can’t perform that action at this time.
0 commit comments