Пример #1
0
 def format(self, message, callback):
     isSynced = yield self._waitForSyncItems()
     formatted, settings = (None, None)
     if isSynced:
         data = message.data or {}
         completedQuestIDs = self.getQuestOfThisGroup(
             data.get('completedQuestIDs', set()))
         questsData = getRewardsForQuests(
             message, self.getQuestOfThisGroup(completedQuestIDs))
         questsData['popUpRecords'] = self.getPopUps(message)
         fmt = self._achievesFormatter.formatQuestAchieves(
             questsData, asBattleFormatter=False)
         if fmt is not None:
             operationTime = message.sentTime
             if operationTime:
                 fDatetime = TimeFormatter.getLongDatetimeFormat(
                     time_utils.makeLocalServerTime(operationTime))
             else:
                 fDatetime = 'N/A'
             formatted = g_settings.msgTemplates.format(
                 self.__TEMPLATE_NAME,
                 ctx={
                     'at': fDatetime,
                     'desc': '',
                     'op': fmt
                 })
             settings = self._getGuiSettings(message, self.__TEMPLATE_NAME)
     callback([MessageData(formatted, settings)])
     return
 def __pushEnabled(self):
     expiryTime = self.__battlePassController.getSeasonFinishTime()
     SystemMessages.pushMessage(text=backport.text(R.strings.system_messages.battlePass.switch_enabled.body(), expiryTime=text_styles.titleFont(TimeFormatter.getLongDatetimeFormat(expiryTime))), type=SystemMessages.SM_TYPE.Warning)
Пример #3
0
 def __formatTime():
     operationTime = time_utils.getCurrentLocalServerTimestamp()
     return TimeFormatter.getLongDatetimeFormat(operationTime) if operationTime else 'N/A'