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()
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()
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()
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()