Ejemplo 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)})
Ejemplo 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)})
Ejemplo n.º 3
0
def timesince_short(timestamp):
    return utils.timesince(timestamp)
Ejemplo n.º 4
0
def timesince_short(timestamp):
    return utils.timesince(timestamp)