예제 #1
0
    def getTemplateMenu(self, file_name, user_path=False):
        """
        Get the template menu file to be modified by the different methods

        Arguments
        file_name {string} -name of the file including the extension
        user_path {boolean} -- True: get file from Packages/Deviot/Preset
                            --False: get file from Packages/User/Deviot/Preset
                              (Defaul:False)
        """
        file_path = Paths.getTemplateMenuPath(file_name, user_path)
        preset_file = JSONFile(file_path)
        preset_data = preset_file.getData()
        return preset_data
예제 #2
0
파일: Menu.py 프로젝트: goolic/Deviot
    def getTemplateMenu(self, file_name, user_path=False):
        """
        Get the template menu file to be modified by the different methods

        Arguments
        file_name {string} -name of the file including the extension
        user_path {boolean} -- True: get file from Packages/Deviot/Preset
                            --False: get file from Packages/User/Deviot/Preset
                              (Defaul:False)
        """
        file_path = Paths.getTemplateMenuPath(file_name, user_path)
        preset_file = JSONFile(file_path)
        preset_data = preset_file.getData()
        return preset_data
예제 #3
0
    def saveTemplateMenu(self, data, file_name, user_path=False):
        """
        Save the menu template in json format

        Arguments:
        data {json} -- st json object with the data of the menu
        file_name {string} -- name of  the file including the extension
        user_path {boolean} -- True: save file in Packages/Deviot/Preset
                            --False: save file in Packages/User/Deviot/Preset
                              (Defaul:False)
        """
        file_path = Paths.getTemplateMenuPath(file_name, user_path)
        preset_file = JSONFile(file_path)
        preset_file.setData(data)
        preset_file.saveData()
예제 #4
0
파일: Menu.py 프로젝트: goolic/Deviot
    def saveTemplateMenu(self, data, file_name, user_path=False):
        """
        Save the menu template in json format

        Arguments:
        data {json} -- st json object with the data of the menu
        file_name {string} -- name of  the file including the extension
        user_path {boolean} -- True: save file in Packages/Deviot/Preset
                            --False: save file in Packages/User/Deviot/Preset
                              (Defaul:False)
        """
        file_path = Paths.getTemplateMenuPath(file_name, user_path)
        preset_file = JSONFile(file_path)
        preset_file.setData(data)
        preset_file.saveData()
예제 #5
0
def generateFiles(install=False):
    # Creates new menu
    api_boards = Paths.getTemplateMenuPath('platformio_boards.json',
                                           user_path=True)
    # create main files
    PlatformioCLI().saveAPIBoards(install=install)
    Menu().createMainMenu()

    Tools.createCompletions()
    Tools.createSyntaxFile()
    Menu().createLibraryImportMenu()
    Menu().createLibraryExamplesMenu()

    # Run serial port listener
    Serial = SerialListener(func=Menu().createSerialPortsMenu)
    Serial.start()
예제 #6
0
def generateFiles(install=False):
    # Creates new menu
    api_boards = Paths.getTemplateMenuPath('platformio_boards.json',
                                           user_path=True)
    # create main files
    PlatformioCLI().saveAPIBoards(install=install)
    Menu().createMainMenu()

    Tools.createCompletions()
    Tools.createSyntaxFile()
    Menu().createLibraryImportMenu()
    Menu().createLibraryExamplesMenu()

    # Run serial port listener
    Serial = SerialListener(func=Menu().createSerialPortsMenu)
    Serial.start()