예제 #1
0
파일: bases.py 프로젝트: foXaCe/XDM
 def _release_threshold_select(self):
     return {0: "Don't ignore.",
             1: format_timedelta(helper.releaseThresholdDelta[1], locale=common.getLocale()),
             2: format_timedelta(helper.releaseThresholdDelta[2], locale=common.getLocale()),
             3: format_timedelta(helper.releaseThresholdDelta[3], locale=common.getLocale()),
             4: format_timedelta(helper.releaseThresholdDelta[4], locale=common.getLocale()),
             5: format_timedelta(helper.releaseThresholdDelta[5], locale=common.getLocale()),
             6: 'Completely ignore'}
예제 #2
0
파일: helper.py 프로젝트: Enjoy14/XDM
def reltime(date):
    if date == common.FAKEDATE or not date:
        return "unknown"
    # FIXME use isinstance() ... but test it
    if type(date).__name__ not in ('date', 'datetime'):
        return "reltime needs a date or datetime we got: '%s'" % repr(date)
    return format_timedelta(date - datetime.now(), locale=common.getLocale(), add_direction=True)
예제 #3
0
파일: helper.py 프로젝트: pannal/XDM
def reltime(date):
    if date == common.FAKEDATE or not date:
        return "unknown"
    # FIXME use isinstance() ... but test it
    if type(date).__name__ not in ('date', 'datetime'):
        return "reltime needs a date or datetime we got: '%s'" % repr(date)
    return format_timedelta(date - datetime.now(),
                            locale=common.getLocale(),
                            add_direction=True)
예제 #4
0
파일: bases.py 프로젝트: ragnvaldur/XDM
 def _release_threshold_select(self):
     return {
         0:
         "Don't ignore.",
         1:
         format_timedelta(helper.releaseThresholdDelta[1],
                          locale=common.getLocale()),
         2:
         format_timedelta(helper.releaseThresholdDelta[2],
                          locale=common.getLocale()),
         3:
         format_timedelta(helper.releaseThresholdDelta[3],
                          locale=common.getLocale()),
         4:
         format_timedelta(helper.releaseThresholdDelta[4],
                          locale=common.getLocale()),
         5:
         format_timedelta(helper.releaseThresholdDelta[5],
                          locale=common.getLocale()),
         6:
         'Completely ignore'
     }
예제 #5
0
def reltime(date):
    if type(date).__name__ not in ('date', 'datetime'):
        return "reltime needs a date or datetime we got: '%s'" % repr(date)
    _now = datetime.now()
    return format_timedelta(date - _now, locale=common.getLocale())
예제 #6
0
def reltime(date):
    if date == common.FAKEDATE:
        return "unknown"
    if type(date).__name__ not in ('date', 'datetime'):
        return "reltime needs a date or datetime we got: '%s'" % repr(date)
    return format_timedelta(date - datetime.now(), locale=common.getLocale())
예제 #7
0
파일: helper.py 프로젝트: Jeffroiscool/XDM
def reltime(date):
    if type(date).__name__ not in ('date', 'datetime'):
        return "reltime needs a date or datetime we got: '%s'" % repr(date)
    _now = datetime.now()
    return format_timedelta(date - _now, locale=common.getLocale())
예제 #8
0
파일: helper.py 프로젝트: nekoserv/xdm
def reltime(date):
    if date == common.FAKEDATE:
        return "unknown"
    if type(date).__name__ not in ('date', 'datetime'):
        return "reltime needs a date or datetime we got: '%s'" % repr(date)
    return format_timedelta(date - datetime.now(), locale=common.getLocale())