예제 #1
0
 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)
예제 #2
0
 def getMessageLongDatetimeFormat(cls, time):
     return '({0:>s} {1:>s}) '.format(
         backport.getShortDateFormat(time),
         backport.getLongTimeFormat(time)).decode('utf-8', 'ignore')
예제 #3
0
 def getLongDatetimeFormat(cls, time):
     return '{0:>s} {1:>s}'.format(backport.getShortDateFormat(time),
                                   backport.getLongTimeFormat(time))
예제 #4
0
 def getLongTimeFormat(cls, time):
     return '{0:>s}'.format(backport.getLongTimeFormat(time))
예제 #5
0
 def getDateTimeFormat(cls, value):
     return cls._makeLocalTimeString(
         value, lambda localTime: '{0:>s} {1:>s}'.format(
             backport.getShortDateFormat(value),
             backport.getLongTimeFormat(value)))
예제 #6
0
def getPrebattleStartTimeString(startTime):
    startTimeString = backport.getLongTimeFormat(startTime)
    if startTime - time.time() > 86400:
        startTimeString = '{0:>s} {1:>s}'.format(
            backport.getLongDateFormat(startTime), startTimeString)
    return startTimeString
예제 #7
0
 def _getValue(self, value):
     value = self._getLocalTime(value)
     return '{0:>s} {1:>s}'.format(backport.getShortDateFormat(value),
                                   backport.getLongTimeFormat(value))
예제 #8
0
 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)