# Path: libraries/tools.py
# def get_setting(key, default=None):
#     """
#     get setting handled by ST
#     """
#     settings = load_settings("deviot.sublime-settings")
#     value = settings.get(key, default)
# 
#     try:
#         return eval(value)
#     except(NameError, SyntaxError, TypeError) as e:
#         return value
# 
# def save_setting(key, value=None, sys_options=False):
#     """
#     save setting handled by ST
#     """
#     settings = load_settings("deviot.sublime-settings")
# 
#     if(value is None):
#         settings.erase(key)
#     else:
#         settings.set(key, value)
# 
#     save_settings("deviot.sublime-settings")


from ..api import deviot
from .tools import get_setting, save_setting
from ..platformio.pio_bridge import PioBridge
from ..libraries.readconfig import ReadConfig
        from .file import File
        from .serial import serial_port_list
        from .tools import get_sysetting
            from ..platformio.compile import Compile
            from ..platformio.upload import Upload
        from .mdns.mdns import MDNSBrowser
        from .project_check import ProjectCheck
            settings.append(board_id)
        else:
            if(board_id not in settings):
                settings.append(board_id)
            else:
                settings.remove(board_id)
                try:
                    self.remove_ini_environment(board_id)
                except:
                    pass

                if(len(settings) > 0):
                    board_id = settings[-1]
                else:
                    board_id = ''

        save_setting('boards', settings)

        self.save_environment(board_id)

    def get_selected_boards(self):
        """Get Board/s

        List of all boards in the project, the list includes
        the one selected in deviot, and the one initialized in the
        platformio.ini file, they're mixed and excluding the duplicates

        Returns:
            list -- list of boards
        """

# Path: libraries/tools.py
# def get_setting(key, default=None):
#     """
#     get setting handled by ST
#     """
#     settings = load_settings("deviot.sublime-settings")
#     value = settings.get(key, default)
# 
#     try:
#         return eval(value)
#     except(NameError, SyntaxError, TypeError) as e:
#         return value
# 
# def save_setting(key, value=None, sys_options=False):
#     """
#     save setting handled by ST
#     """
#     settings = load_settings("deviot.sublime-settings")
# 
#     if(value is None):
#         settings.erase(key)
#     else:
#         settings.set(key, value)
# 
#     save_settings("deviot.sublime-settings")


# Path: libraries/preferences_bridge.py
from ..api import deviot
from .tools import get_setting, save_setting
from ..platformio.pio_bridge import PioBridge
from ..libraries.readconfig import ReadConfig
        from .file import File
        from .serial import serial_port_list
        from .tools import get_sysetting
            from ..platformio.compile import Compile
            from ..platformio.upload import Upload
        from .mdns.mdns import MDNSBrowser
        from .project_check import ProjectCheck

            settings.append(board_id)
        else:
            if(board_id not in settings):
                settings.append(board_id)
            else:
                settings.remove(board_id)
                try:
                    self.remove_ini_environment(board_id)
                except:
                    pass

                if(len(settings) > 0):
                    board_id = settings[-1]
                else:
                    board_id = ''

        save_setting('boards', settings)

        self.save_environment(board_id)

    def get_selected_boards(self):
        """Get Board/s

        List of all boards in the project, the list includes
        the one selected in deviot, and the one initialized in the
        platformio.ini file, they're mixed and excluding the duplicates

        Returns:
            list -- list of boards
        """

        settings = get_setting('boards', [])