def getMessage(self): formatArgs = {'reason': '', 'expiryTime': ''} if self.reason: formatArgs['reason'] = i18n.makeString( DIALOGS.DISCONNECTED_REASON, i18n.makeString(self.reason)) if self.expiryTime: expiryTime = time_utils.makeLocalServerTime(int(self.expiryTime)) formatArgs['expiryTime'] = '%s %s' % (backport.getLongDateFormat( expiryTime), backport.getLongTimeFormat(expiryTime)) key = DIALOGS.DISCONNECTED_MESSAGEKICK if self.isBan: key = DIALOGS.DISCONNECTED_MESSAGEBANPERIOD if self.expiryTime else DIALOGS.DISCONNECTED_MESSAGEBAN return i18n.makeString(key, **formatArgs)
def getMessageLongDatetimeFormat(cls, time): return '({0:>s} {1:>s}) '.format( backport.getShortDateFormat(time), backport.getLongTimeFormat(time)).decode('utf-8', 'ignore')
def getLongDatetimeFormat(cls, time): return '{0:>s} {1:>s}'.format(backport.getShortDateFormat(time), backport.getLongTimeFormat(time))
def getLongTimeFormat(cls, time): return '{0:>s}'.format(backport.getLongTimeFormat(time))
def getDateTimeFormat(cls, value): return cls._makeLocalTimeString( value, lambda localTime: '{0:>s} {1:>s}'.format( backport.getShortDateFormat(value), backport.getLongTimeFormat(value)))
def getPrebattleStartTimeString(startTime): startTimeString = backport.getLongTimeFormat(startTime) if startTime - time.time() > 86400: startTimeString = '{0:>s} {1:>s}'.format( backport.getLongDateFormat(startTime), startTimeString) return startTimeString
def _getValue(self, value): value = self._getLocalTime(value) return '{0:>s} {1:>s}'.format(backport.getShortDateFormat(value), backport.getLongTimeFormat(value))
def _getValue(self, value): return backport.getLongTimeFormat(self._getLocalTime(value))
def getMessage(self): formatArgs = {'reason': '', 'expiryTime': ''} if self.reason: formatArgs['reason'] = i18n.makeString(DIALOGS.DISCONNECTED_REASON, i18n.makeString(self.reason)) if self.expiryTime: expiryTime = time_utils.makeLocalServerTime(int(self.expiryTime)) formatArgs['expiryTime'] = '%s %s' % (backport.getLongDateFormat(expiryTime), backport.getLongTimeFormat(expiryTime)) key = DIALOGS.DISCONNECTED_MESSAGEKICK if self.kickReasonType in ACCOUNT_KICK_REASONS.BAN_RANGE: if IS_CHINA and self.kickReasonType == ACCOUNT_KICK_REASONS.CURFEW_BAN: return i18n.makeString(self.reason) key = DIALOGS.DISCONNECTED_MESSAGEBANPERIOD if self.expiryTime else DIALOGS.DISCONNECTED_MESSAGEBAN return i18n.makeString(key, **formatArgs)
def getTimeLongStr(value): return _UNAVAILABLE_SYMBOL if _getValueOrUnavailable( value) == _UNAVAILABLE_VALUE else backport.getLongTimeFormat(value)