|
@@ -32,7 +32,7 @@ from flask import (
|
32
|
32
|
Flask, request, render_template, url_for, Response, make_response,
|
33
|
33
|
redirect, send_from_directory
|
34
|
34
|
)
|
35
|
|
-from flask.ext.babel import Babel, gettext, ngettext, format_date
|
|
35
|
+from flask.ext.babel import Babel, gettext, format_date
|
36
|
36
|
from searx import settings, searx_dir
|
37
|
37
|
from searx.engines import (
|
38
|
38
|
search as do_search, categories, engines, get_engines_stats,
|
|
@@ -161,12 +161,12 @@ def index():
|
161
|
161
|
if 'publishedDate' in result:
|
162
|
162
|
if result['publishedDate'] >= datetime.now() - timedelta(days=1):
|
163
|
163
|
timedifference = datetime.now() - result['publishedDate']
|
164
|
|
- minutes = int((timedifference.seconds/60)%60)
|
165
|
|
- hours = int(timedifference.seconds/60/60)
|
|
164
|
+ minutes = int((timedifference.seconds / 60) % 60)
|
|
165
|
+ hours = int(timedifference.seconds / 60 / 60)
|
166
|
166
|
if hours == 0:
|
167
|
|
- result['publishedDate'] = gettext(u'{minutes} minute(s) ago').format(minutes=minutes)
|
|
167
|
+ result['publishedDate'] = gettext(u'{minutes} minute(s) ago').format(minutes=minutes) # noqa
|
168
|
168
|
else:
|
169
|
|
- result['publishedDate'] = gettext(u'{hours} hour(s), {minutes} minute(s) ago').format(hours=hours, minutes=minutes)
|
|
169
|
+ result['publishedDate'] = gettext(u'{hours} hour(s), {minutes} minute(s) ago').format(hours=hours, minutes=minutes) # noqa
|
170
|
170
|
else:
|
171
|
171
|
result['publishedDate'] = format_date(result['publishedDate'])
|
172
|
172
|
|