Skip to content

Commit 2dc4bdf

Browse files
committed
List the available libraries based in the current environment (platform) selected
1 parent 19dbe13 commit 2dc4bdf

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

libraries/preferences_bridge.py

+21
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,27 @@ def get_environment(self):
9191

9292
return settings
9393

94+
def get_platform(self):
95+
"""Get Platform
96+
97+
Gets the platform from the current selected environment (board)
98+
99+
Returns:
100+
str -- platform name
101+
"""
102+
from .file import File
103+
from .paths import getBoardsFileDataPath
104+
105+
environment = self.get_environment()
106+
107+
boards_path = getBoardsFileDataPath()
108+
boards_file = File(boards_path)
109+
boards = boards_file.read_json()
110+
111+
for board in boards:
112+
if(board['id'] == environment):
113+
return board['platform']
114+
94115
def get_ports_list(self):
95116
"""Ports List
96117

libraries/quick_menu.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ def libraries_list(self, example_list=False):
433433
"""
434434
from re import search
435435

436-
libraries_folders = self.get_libraries_folders()
436+
platform = self.get_platform()
437+
libraries_folders = self.get_libraries_folders(platform)
437438

438439
quick_list = []
439440
check_list = []

0 commit comments

Comments
 (0)