本文整理汇总了Python中libs.Paths.getTemplateMenuPath方法的典型用法代码示例。如果您正苦于以下问题:Python Paths.getTemplateMenuPath方法的具体用法?Python Paths.getTemplateMenuPath怎么用?Python Paths.getTemplateMenuPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libs.Paths
的用法示例。
在下文中一共展示了Paths.getTemplateMenuPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getTemplateMenu
# 需要导入模块: from libs import Paths [as 别名]
# 或者: from libs.Paths import getTemplateMenuPath [as 别名]
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: saveTemplateMenu
# 需要导入模块: from libs import Paths [as 别名]
# 或者: from libs.Paths import getTemplateMenuPath [as 别名]
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()
示例3: generateFiles
# 需要导入模块: from libs import Paths [as 别名]
# 或者: from libs.Paths import getTemplateMenuPath [as 别名]
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()