def exchange(self, cmd): exchangeResults = {} for currencyType, currencyValue in cmd.currencies.iteritems(): result = yield _EXCHANGER[currencyType](currencyValue).request() exchangeResults[currencyType] = { 'success': result.success, 'message': result.userMsg } pushMessagesFromResult(result) yield exchangeResults
def __launchOptDeviceRemoving(self, slotIndex): installedDevice = self.__vehicle.optDevices.installed[slotIndex] if installedDevice is not None: result = yield _CmpOptDeviceRemover(self.__vehicle, installedDevice, slotIndex).request() if result.success: self.__notifyViews('onOptDeviceUpdated') else: pushMessagesFromResult(result) return
def installComponent(self, newId): newComponentItem = self.itemsCache.items.getItemByCD(newId) Waiting.show('applyModule', overlapsUI=False) conflictedEqs = newComponentItem.getConflictedEquipments(self.item) result = yield getPreviewInstallerProcessor(self.item, newComponentItem, conflictedEqs).request() pushMessagesFromResult(result) Waiting.hide('applyModule') if result.success: if self.__vehAppearance is not None: self.__vehAppearance.refreshVehicle(self.item) self.onComponentInstalled() return