Esempio n. 1
0
def _limiter(last, seconds):
    limit = timedelta(seconds=seconds)
    since = (datetime.now() - last)
    if since < limit:
        raise APIException(
            _("please wait %(duration)s before making another post") % {
                "duration": timesince(datetime.now() - limit + since)})
Esempio n. 2
0
def _limiter(last, seconds):
    limit = timedelta(seconds=seconds)
    since = (now() - last)
    if since < limit:
        raise APIException(
            _("please wait %(duration)s before making another post") %
            {"duration": timesince(now() - limit + since)})
Esempio n. 3
0
def timesince_short(timestamp):
    return utils.timesince(timestamp)
Esempio n. 4
0
def timesince_short(timestamp):
    return utils.timesince(timestamp)