示例#1
0
 def getDiscount(self):
     _ActionDiscountValue = namedtuple(
         '_ActionDiscountValue',
         'discountName, discountValue, discountType')
     return formatStrDiscount(
         _ActionDiscountValue(discountValue=100,
                              discountType=DISCOUNT_TYPE.PERCENT,
                              discountName='marathon'))
示例#2
0
 def getDiscount(self):
     paramName = self.discount.getParamName()
     if 'winXPFactorMode' in paramName:
         discount = self.__handleWinXPFactorMode()
     else:
         discounts = self._getPackedDiscounts()
         discount = discounts.get(paramName) if discounts else None
     return formatStrDiscount(discount) if discount else ''
 def getDiscount(self):
     """Returns string with discount or empty string if can't calculate
     Is used on red label on action cards
     """
     discount = self._getMaxDiscount()
     if discount:
         return formatStrDiscount(discount)
     return ''
示例#4
0
    def getTableData(self):
        result = []
        for item in self._sortVehicles():
            veh = item.discountName
            item = {'icon': _VEHICLE_NATION_ICON_PATH % nations.NAMES[veh.nationID],
             'additionalIcon': getTypeSmallIconPath(veh.type, veh.isPremium or veh.isElite),
             'title': ' '.join((i18n.makeString(TOOLTIPS.level(veh.level)), veh.shortUserName)),
             'discount': formatStrDiscount(item),
             'price': self._getPrice(veh, False)}
            result.append(item)

        return result
示例#5
0
    def getTableData(self):
        items = self._getPackedDiscounts()
        res = []
        for data in items.itervalues():
            c11n = data.discountName
            item = {'icon': '',
             'additionalIcon': '',
             'title': ' '.join((c11n.userType, c11n.userName)),
             'discount': formatStrDiscount(data),
             'price': self._formatPriceIcon(c11n, False)}
            res.append(item)

        return sorted(res, key=lambda x: x['discount'], reverse=True)[:3]
示例#6
0
    def getTableData(self):
        items = self._getPackedDiscounts()
        res = []
        for _, data in items.iteritems():
            optDevice = data.discountName
            item = {'icon': '',
             'additionalIcon': '',
             'title': ' '.join((icons.makeImageTag(optDevice.icon, vSpace=-3), optDevice.userName)),
             'discount': formatStrDiscount(data),
             'price': self._formatPriceIcon(optDevice, False)}
            res.append(item)

        return sorted(res, key=lambda x: x['discount'], reverse=True)[:3]
示例#7
0
    def getTableData(self):
        items = self._getPackedDiscounts()
        res = []
        for _, data in items.iteritems():
            equip = data.discountName
            item = {'icon': '',
             'additionalIcon': '',
             'title': ' '.join((icons.makeImageTag(equip.icon, vSpace=-3), equip.userName)),
             'discount': formatStrDiscount(data),
             'price': self._formatPriceIcon(equip, False)}
            res.append(item)

        return res[:3]
    def getTableData(self):
        """If card contains tabled data, format and return data
        """
        items = self._getPackedDiscounts()
        res = []
        for intCD, data in items.iteritems():
            veh = data.discountName
            item = {'icon': '',
             'additionalIcon': '',
             'title': '{} {}'.format(icons.makeImageTag(veh.icon, vSpace=-3), veh.userName),
             'discount': formatStrDiscount(data),
             'price': self._formatPriceIcon(veh, False)}
            res.append(item)

        return sorted(res, key=lambda x: x['discount'], reverse=True)[:3]
    def getTableData(self):
        """If card contains tabled data, format and return data
        """
        items = self._getPackedDiscounts()
        res = []
        for intCD, data in items.iteritems():
            equip = data.discountName
            item = {'icon': '',
             'additionalIcon': '',
             'title': '{} {}'.format(icons.makeImageTag(equip.icon, vSpace=-3), equip.userName),
             'discount': formatStrDiscount(data),
             'price': self._formatPriceIcon(equip, False)}
            res.append(item)

        return res[:3]
示例#10
0
    def getTableData(self):
        res = []
        for data in self.__sortBoosters():
            booster = data.discountName
            guiType = booster.boosterGuiType
            formatter = 'booster/{}'.format(guiType)
            busterName = i18n.makeString(QUESTS.getActionDescription(formatter))
            busterSmallIcon = RES_ICONS.getBusterSmallIcon(guiType)
            item = {'icon': busterSmallIcon,
             'additionalIcon': '',
             'title': busterName,
             'discount': formatStrDiscount(data),
             'price': self._formatPriceIcon(booster, False)}
            res.append(item)

        return res
示例#11
0
    def getTableData(self):
        """If card contains tabled data, format and return data
        """
        result = []
        for item in self._sortVehicles():
            veh = item.discountName
            if veh.isPremium or veh.isElite:
                iconFunc = RES_ICONS.maps_icons_vehicletypes_elite
            else:
                iconFunc = RES_ICONS.maps_icons_vehicletypes
            item = {'icon': _VEHICLE_NATION_ICON_PATH % nations.NAMES[veh.nationID],
             'additionalIcon': iconFunc(veh.type + '.png'),
             'title': '{} {}'.format(i18n.makeString(TOOLTIPS.level(veh.level)), veh.shortUserName),
             'discount': formatStrDiscount(item),
             'price': self._getPrice(veh, False)}
            result.append(item)

        return result
示例#12
0
 def getDiscount(self):
     discount = self._getMaxDiscount()
     return formatStrDiscount(discount) if discount else ''