SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
Improves PEP8 compatibility.
Gabor Nagy22fd0746d94e
diff --git a/searx/engines/__init__.py b/searx/engines/__init__.pyindex d8bb27e5f..ae7128790 100644--- a/searx/engines/__init__.py+++ b/searx/engines/__init__.py@@ -17,16 +17,16 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.'''from os.path import realpath, dirname, splitext, join+import sysfrom imp import load_source-import grequestsfrom itertools import izip_longest, chainfrom operator import itemgetterfrom urlparse import urlparse-from searx import settings-from searx.utils import gen_useragent-import sysfrom datetime import datetime+import grequestsfrom flask.ext.babel import gettext+from searx import settings+from searx.utils import gen_useragentengine_dir = dirname(realpath(__file__))diff --git a/searx/engines/bing.py b/searx/engines/bing.pyindex 00f66b118..9712a3103 100644--- a/searx/engines/bing.py+++ b/searx/engines/bing.py@@ -1,6 +1,6 @@-from lxml import htmlfrom urllib import urlencodefrom cgi import escape+from lxml import htmlbase_url = 'http://www.bing.com/'search_string = 'search?{query}&first={offset}'diff --git a/searx/engines/dailymotion.py b/searx/engines/dailymotion.pyindex 04f77af80..03e1d7ffc 100644--- a/searx/engines/dailymotion.py+++ b/searx/engines/dailymotion.py@@ -1,6 +1,6 @@from urllib import urlencode-from lxml import htmlfrom json import loads+from lxml import htmlcategories = ['videos']locale = 'en_US'diff --git a/searx/engines/deviantart.py b/searx/engines/deviantart.pyindex 602678e41..d42a25a19 100644--- a/searx/engines/deviantart.py+++ b/searx/engines/deviantart.py@@ -1,6 +1,6 @@from urllib import urlencode-from lxml import htmlfrom urlparse import urljoin+from lxml import htmlcategories = ['images']diff --git a/searx/engines/piratebay.py b/searx/engines/piratebay.pyindex c40dacf65..ca1085141 100644--- a/searx/engines/piratebay.py+++ b/searx/engines/piratebay.py@@ -1,7 +1,7 @@-from lxml import htmlfrom urlparse import urljoinfrom cgi import escapefrom urllib import quote+from lxml import htmlcategories = ['videos', 'music']diff --git a/searx/engines/stackoverflow.py b/searx/engines/stackoverflow.pyindex 213597243..e24b309c1 100644--- a/searx/engines/stackoverflow.py+++ b/searx/engines/stackoverflow.py@@ -1,7 +1,7 @@-from lxml import htmlfrom urlparse import urljoinfrom cgi import escapefrom urllib import urlencode+from lxml import htmlcategories = ['it']diff --git a/searx/engines/vimeo.py b/searx/engines/vimeo.pyindex 924497a99..a95c75b49 100644--- a/searx/engines/vimeo.py+++ b/searx/engines/vimeo.py@@ -1,7 +1,7 @@from urllib import urlencodefrom HTMLParser import HTMLParser-from xpath import extract_textfrom lxml import html+from xpath import extract_textbase_url = 'http://vimeo.com'search_url = base_url + '/search?{query}'diff --git a/searx/engines/yahoo.py b/searx/engines/yahoo.pyindex 436a2d7a6..3dba4c432 100644--- a/searx/engines/yahoo.py+++ b/searx/engines/yahoo.py@@ -1,8 +1,8 @@#!/usr/bin/env pythonfrom urllib import urlencode-from searx.engines.xpath import extract_text, extract_urlfrom lxml import html+from searx.engines.xpath import extract_text, extract_urlcategories = ['general']search_url = 'http://search.yahoo.com/search?{query}&b={offset}'diff --git a/searx/engines/youtube.py b/searx/engines/youtube.pyindex 208254317..6e4e8859a 100644--- a/searx/engines/youtube.py+++ b/searx/engines/youtube.py@@ -3,7 +3,8 @@ from urllib import urlencodecategories = ['videos']-search_url = 'https://gdata.youtube.com/feeds/api/videos?alt=json&{query}&start-index={index}&max-results=25' # noqa+search_url = ('https://gdata.youtube.com/feeds/api/videos'+ '?alt=json&{query}&start-index={index}&max-results=25') # noqapaging = Truediff --git a/searx/tests/test_robot.py b/searx/tests/test_robot.pyindex 1480ae8ef..b48153fe4 100644--- a/searx/tests/test_robot.py+++ b/searx/tests/test_robot.py@@ -1,12 +1,11 @@# -*- coding: utf-8 -*-+import os+import unittest2 as unittestfrom plone.testing import layeredfrom robotsuite import RobotTestSuitefrom searx.testing import SEARXROBOTLAYER-import os-import unittest2 as unittest-def test_suite():suite = unittest.TestSuite()diff --git a/searx/tests/test_webapp.py b/searx/tests/test_webapp.pyindex 82d4a9088..4e2c820d9 100644--- a/searx/tests/test_webapp.py+++ b/searx/tests/test_webapp.py@@ -1,12 +1,10 @@# -*- coding: utf-8 -*-+import json+from urlparse import ParseResultfrom mock import patchfrom searx import webappfrom searx.testing import SearxTestCase-from urlparse import ParseResult---import jsonclass ViewsTestCase(SearxTestCase):diff --git a/searx/webapp.py b/searx/webapp.pyindex 75c8abc8c..4f0fe92b3 100644--- a/searx/webapp.py+++ b/searx/webapp.py@@ -21,22 +21,18 @@ import jsonimport cStringIOimport os-from flask import Flask, request, render_template-from flask import url_for, Response, make_response, redirect-from flask import send_from_directory-+from flask import (+ Flask, request, render_template, url_for, Response, make_response,+ redirect, send_from_directory+)+from flask.ext.babel import Babelfrom searx import settings, searx_dir-from searx.engines import search-from searx.engines import categories-from searx.engines import engines-from searx.engines import get_engines_stats-from searx.engines import engine_shortcuts-from searx.utils import UnicodeWriter-from searx.utils import highlight_content, html_to_text+from searx.engines import (+ search, categories, engines, get_engines_stats, engine_shortcuts+)+from searx.utils import UnicodeWriter, highlight_content, html_to_textfrom searx.languages import language_codes-from flask.ext.babel import Babel-app = Flask(__name__,