コード例 #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))
コード例 #9
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.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)
コード例 #10
0
def getTimeLongStr(value):
    return _UNAVAILABLE_SYMBOL if _getValueOrUnavailable(
        value) == _UNAVAILABLE_VALUE else backport.getLongTimeFormat(value)