def __onBSListReceived(self, sessions):
        result = []
        for bs in sessions:
            result.append({'prbID': bs.prbID,
             'prbType': bs.prbType,
             'descr': formatters.getPrebattleFullDescription(bs.description),
             'opponents': formatters.getPrebattleOpponentsString(bs.description),
             'startTime': formatters.getBattleSessionStartTimeString(bs.startTime)})

        self.as_refreshListS(result)
示例#2
0
    def __onBSListReceived(self, sessions):
        result = []
        for bs in sessions:
            result.append({'prbID': bs.prbID,
             'prbType': bs.prbType,
             'descr': formatters.getPrebattleFullDescription(bs.description),
             'opponents': formatters.getPrebattleOpponentsString(bs.description),
             'startTime': formatters.getBattleSessionStartTimeString(bs.startTime)})

        self.as_refreshListS(result)
示例#3
0
    def __onBSListReceived(self, sessions):
        result = []
        clanDBID = self.__webCtrl.getClanDbID()
        for bs in sessions:
            detachment, vehicleLvl, _ = formatters.getBattleSessionDetachment(bs.description, clanDBID)
            if bs.prbType == PREBATTLE_TYPE.CLAN:
                startTime = self.__getClanBattleStartTime(bs)
            else:
                startTime = formatters.getBattleSessionStartTimeString(bs.startTime)
            result.append({'prbID': bs.prbID,
             'prbType': bs.prbType,
             'descr': formatters.getPrebattleFullDescription(bs.description),
             'opponents': formatters.getPrebattleOpponentsString(bs.description),
             'startTime': startTime,
             'unitName': detachment,
             'vehicleLevel': vehicleLvl})

        self.as_refreshListS(result)
 def __addNotification(self, invite):
     formatted = g_settings.htmlTemplates.format(
         'inviteToSpecialBattle',
         ctx={
             'icon':
             self.NOTIFICATION_ICON.get(invite.prbType,
                                        self.NOTIFICATION_ICON_DEFAULT),
             'text':
             u'%s, %s' %
             (unicode(getPrebattleFullDescription(invite.description),
                      'utf-8'),
              unicode(getBattleSessionStartTimeString(invite.startTime),
                      'utf-8'))
         })
     self.__notifications.append(formatted)
     if self._activated:
         if self._view:
             self._view.as_addMessageS(formatted)
     else:
         events_dispatcher.notifyCarousel(self._channel.getClientID())
示例#5
0
 def getText(self, invite):
     return u'%s, %s' % (unicode(
         getPrebattleFullDescription(invite.description), 'utf-8'
     ), unicode(getBattleSessionStartTimeString(invite.startTime), 'utf-8'))
示例#6
0
 def getText(self, invite):
     return u'%s, %s' % (unicode(getPrebattleFullDescription(invite.description), 'utf-8'), unicode(getBattleSessionStartTimeString(invite.startTime), 'utf-8'))
 def __addNotification(self, invite):
     formatted = g_settings.htmlTemplates.format('inviteToSpecialBattle', ctx={'icon': self.NOTIFICATION_ICON.get(invite.prbType, self.NOTIFICATION_ICON_DEFAULT),
      'text': u'%s, %s' % (unicode(getPrebattleFullDescription(invite.description), 'utf-8'), unicode(getBattleSessionStartTimeString(invite.startTime), 'utf-8'))})
     self.__notifications.append(formatted)
     if self._activated:
         if self._view:
             self._view.as_addMessageS(formatted)
     else:
         events_dispatcher.notifyCarousel(self._channel.getClientID())