on master help sign in
Fix remote PEP8 errors as well
dee75acNoémi Ványi
searx/engines/mysql_server.py+5−1
@@ -3,6 +3,10 @@
3 MySQL database (Offline)
3 MySQL database (Offline)
4"""
4"""
5
5
6+# error is ignored because the admin has to
7+# install it manually to use the engine
8+# pylint: disable=import-error
9+
6import mysql.connector
10import mysql.connector
7
11
8
12
@@ -49,7 +53,7 @@ def search(query, params):
49def _fetch_results(cur):
53def _fetch_results(cur):
50 results = []
54 results = []
51 for res in cur:
55 for res in cur:
52− result = dict(zip(cur.column_names, map(str, res))),
56+ result = dict(zip(cur.column_names, map(str, res)))
53 result['template'] = result_template
57 result['template'] = result_template
54 results.append(result)
58 results.append(result)
55
59
searx/engines/postgresql.py+5−1
@@ -3,6 +3,10 @@
3 PostgreSQL database (Offline)
3 PostgreSQL database (Offline)
4"""
4"""
5
5
6+# error is ignored because the admin has to
7+# install it manually to use the engine
8+# pylint: disable=import-error
9+
6import psycopg2
10import psycopg2
7
11
8engine_type = 'offline'
12engine_type = 'offline'
@@ -41,7 +45,7 @@ def search(query, params):
41
45
42 with _connection:
46 with _connection:
43 with _connection.cursor() as cur:
47 with _connection.cursor() as cur:
44− cur.execute(query_str, query_params)
48+ cur.execute(query_to_run, query_params)
45
49
46 return _fetch_results(cur)
50 return _fetch_results(cur)
47
51