本文整理匯總了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()