@@ -317,7 +317,17 @@ def get_dependencies(libraries):
317
317
lib_name = libraries_to_check [0 ]
318
318
del libraries_to_check [0 ]
319
319
320
- lib_obj = bundle_data [lib_name ]
320
+ try :
321
+ lib_obj = bundle_data [lib_name ]
322
+ except KeyError :
323
+ # Library isn't in bundle, so we don't know about its
324
+ # dependencies.
325
+ if "." in lib_name :
326
+ file_list .add (lib_name )
327
+ else :
328
+ package_list .add (lib_name )
329
+ continue
330
+
321
331
for dep_name in lib_obj ["dependencies" ]:
322
332
libraries_to_check .append (dep_name )
323
333
dep_obj = bundle_data [dep_name ]
@@ -377,6 +387,29 @@ def make_sd_dir(position):
377
387
triangle_icon = right_triangle ,
378
388
)
379
389
390
+ def filter_custom_project_libs (project_file_set ):
391
+ """
392
+ Find and remove the custom project lib folder.
393
+ Returns a tuple with the contents of the custom project lib folder
394
+ which will in turn get included in the libraries list that the
395
+ tool uses to generate the "main" lib folder in the screenshot.
396
+ """
397
+ _custom_libs = None
398
+ remove_files = []
399
+ for file in project_file_set :
400
+ if not isinstance (file , tuple ):
401
+ continue
402
+ if file [0 ] == "lib" :
403
+ _custom_libs = file [1 ]
404
+ remove_files .append (file )
405
+ for file in remove_files :
406
+ project_file_set .remove (file )
407
+ return _custom_libs
408
+
409
+ custom_libs = filter_custom_project_libs (project_files )
410
+ libs_list = list (libs )
411
+ libs_list .extend (custom_libs )
412
+ libs = set (libs_list )
380
413
final_list_to_render = sort_libraries (libs )
381
414
if settings_required (final_list_to_render ):
382
415
context ["added_settings_toml" ] = True
0 commit comments