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)})
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)})
def timesince_short(timestamp): return utils.timesince(timestamp)