コード例 #1
0
ファイル: api.py プロジェクト: wanderer/occupywallst
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)})
コード例 #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)})
コード例 #3
0
ファイル: ows.py プロジェクト: djudd/occupywallst
def timesince_short(timestamp):
    return utils.timesince(timestamp)
コード例 #4
0
def timesince_short(timestamp):
    return utils.timesince(timestamp)