本文整理汇总了Python中libs.Tools.updateMenuLibs方法的典型用法代码示例。如果您正苦于以下问题:Python Tools.updateMenuLibs方法的具体用法?Python Tools.updateMenuLibs怎么用?Python Tools.updateMenuLibs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libs.Tools
的用法示例。
在下文中一共展示了Tools.updateMenuLibs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: removeLibrary
# 需要导入模块: from libs import Tools [as 别名]
# 或者: from libs.Tools import updateMenuLibs [as 别名]
def removeLibrary(self, selected):
"""
Run a CLI command with the ID of the library to uninstall,
also remove the reference of the ID in the preferences file.
Arguments:
selected {int}
position of the option selected in the quick panel.
"""
list = self.getLibrary('quick_list.json')
lib_id = list[selected][2]
lib_name = list[selected][0]
self.message_queue.startPrint()
self.message_queue.put('[ Deviot {0} ]\\n', version)
time.sleep(0.01)
# uninstall Library with CLI
command = ['lib', 'uninstall', lib_id]
self.Commands.runCommand(command, extra_message=lib_name)
# remove from preferences
if (not self.Commands.error_running):
installed = self.Preferences.get('user_libraries', '')
if(installed):
if(lib_id in installed):
self.Preferences.data.setdefault(
'user_libraries', []).remove(lib_id)
self.Preferences.saveData()
# update menu
Tools.updateMenuLibs()
示例2: installLibrary
# 需要导入模块: from libs import Tools [as 别名]
# 或者: from libs.Tools import updateMenuLibs [as 别名]
def installLibrary(self, selected):
"""
Install the selected library
Arguments:
selected {int}
position in dict of the library selected
"""
list = self.getLibrary('quick_list.json')
lib_id = list[selected][2]
lib_name = list[selected][0]
self.message_queue.startPrint()
self.message_queue.put('[ Deviot {0} ]\\n', version)
time.sleep(0.01)
# Install Library with CLI
command = ['lib', 'install', lib_id]
self.Commands.runCommand(command, extra_message=lib_name)
# update list of libraries installed in the preference file
self.getInstalledList(ids=True)
# update menu
Tools.updateMenuLibs()