mirror of
https://github.com/searxng/searxng.git
synced 2026-09-11 16:56:05 +00:00
fmt
This commit is contained in:
@@ -25,6 +25,7 @@ To use this engine, add an entry similar to the following to your engine list in
|
||||
https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app
|
||||
|
||||
"""
|
||||
|
||||
import typing as t
|
||||
|
||||
from searx.enginelib import EngineCache
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""BASE (Scholar publications)"""
|
||||
|
||||
from datetime import datetime
|
||||
import re
|
||||
|
||||
|
||||
@@ -83,7 +83,6 @@ from threading import Thread
|
||||
from searx import logger
|
||||
from searx.result_types import EngineResults
|
||||
|
||||
|
||||
engine_type = 'offline'
|
||||
paging = True
|
||||
command = []
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""Docker Hub (IT)"""
|
||||
|
||||
# pylint: disable=use-dict-literal
|
||||
|
||||
from urllib.parse import urlencode
|
||||
|
||||
@@ -164,6 +164,7 @@ Terms / phrases that you keep coming across:
|
||||
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Language
|
||||
|
||||
"""
|
||||
|
||||
# pylint: disable=global-statement
|
||||
|
||||
import json
|
||||
|
||||
@@ -12,6 +12,7 @@ least we could not find out how language support should work. It seems that
|
||||
most of the features are based on English terms.
|
||||
|
||||
"""
|
||||
|
||||
import typing as t
|
||||
|
||||
from urllib.parse import urlencode, urlparse, urljoin
|
||||
|
||||
@@ -17,7 +17,6 @@ from searx.result_types import EngineResults
|
||||
from searx.extended_types import SXNG_Response
|
||||
from searx import weather
|
||||
|
||||
|
||||
about = {
|
||||
"website": 'https://duckduckgo.com/',
|
||||
"wikidata_id": 'Q12805',
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
# pylint: disable=invalid-name
|
||||
"""Dummy Offline"""
|
||||
|
||||
|
||||
# about
|
||||
about = {
|
||||
"wikidata_id": None,
|
||||
|
||||
@@ -65,7 +65,6 @@ code lines are just relabeled (starting from 1) and appended (a disjoint set of
|
||||
code blocks in a single file might be returned from the API).
|
||||
"""
|
||||
|
||||
|
||||
import typing as t
|
||||
from urllib.parse import urlencode
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
from urllib.parse import urlencode
|
||||
from dateutil import parser
|
||||
|
||||
|
||||
about = {
|
||||
# pylint: disable=line-too-long
|
||||
"website": "https://hex.pm/",
|
||||
|
||||
@@ -108,14 +108,12 @@ def get_infobox(alt_forms, result_url, definitions):
|
||||
infobox_content.append(f'<p><i>Other forms:</i> {", ".join(alt_forms[1:])}</p>')
|
||||
|
||||
# definitions
|
||||
infobox_content.append(
|
||||
'''
|
||||
infobox_content.append('''
|
||||
<small><a href="https://www.edrdg.org/wiki/index.php/JMdict-EDICT_Dictionary_Project">JMdict</a>
|
||||
and <a href="https://www.edrdg.org/enamdict/enamdict_doc.html">JMnedict</a>
|
||||
by <a href="https://www.edrdg.org/edrdg/licence.html">EDRDG</a>, CC BY-SA 3.0.</small>
|
||||
<ul>
|
||||
'''
|
||||
)
|
||||
''')
|
||||
for pos, engdef, extra in definitions:
|
||||
if pos == 'Wikipedia definition':
|
||||
infobox_content.append('</ul><small>Wikipedia, CC BY-SA 3.0.</small><ul>')
|
||||
|
||||
@@ -49,7 +49,6 @@ except ImportError:
|
||||
|
||||
from searx.result_types import EngineResults
|
||||
|
||||
|
||||
engine_type = 'offline'
|
||||
|
||||
# mongodb connection variables
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
from urllib.parse import urlencode
|
||||
from dateutil import parser
|
||||
|
||||
|
||||
about = {
|
||||
"website": "https://npms.io/",
|
||||
"wikidata_id": "Q7067518",
|
||||
|
||||
@@ -9,7 +9,6 @@ from datetime import datetime
|
||||
from searx.result_types import EngineResults, WeatherAnswer
|
||||
from searx import weather
|
||||
|
||||
|
||||
about = {
|
||||
"website": "https://open-meteo.com",
|
||||
"wikidata_id": None,
|
||||
|
||||
@@ -8,7 +8,6 @@ Openverse (formerly known as: Creative Commons search engine) [Images]
|
||||
from json import loads
|
||||
from urllib.parse import urlencode
|
||||
|
||||
|
||||
about = {
|
||||
"website": 'https://openverse.org/',
|
||||
"wikidata_id": None,
|
||||
|
||||
@@ -12,7 +12,6 @@ from searx.enginelib import EngineCache
|
||||
from searx.exceptions import SearxEngineAPIException, SearxEngineAccessDeniedException
|
||||
from searx.network import get
|
||||
|
||||
|
||||
# about
|
||||
about = {
|
||||
"website": 'https://www.pexels.com',
|
||||
|
||||
@@ -48,7 +48,6 @@ Implementations
|
||||
|
||||
"""
|
||||
|
||||
|
||||
import time
|
||||
import random
|
||||
from urllib.parse import urlencode
|
||||
|
||||
@@ -18,7 +18,6 @@ from searx.utils import eval_xpath_list, eval_xpath, extract_text, get_embeded_s
|
||||
from searx.locales import region_tag
|
||||
from searx.result_types import EngineResults
|
||||
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from lxml.etree import ElementBase
|
||||
from searx.extended_types import SXNG_Response
|
||||
|
||||
@@ -35,6 +35,7 @@ Implementations
|
||||
===============
|
||||
|
||||
"""
|
||||
|
||||
import typing as t
|
||||
|
||||
from datetime import date, timedelta
|
||||
|
||||
@@ -34,7 +34,6 @@ from searx.exceptions import SearxEngineAPIException
|
||||
from searx.result_types import EngineResults
|
||||
from searx.extended_types import SXNG_Response
|
||||
|
||||
|
||||
base_url = 'http://localhost:8983'
|
||||
collection = ''
|
||||
rows = 10
|
||||
|
||||
@@ -117,7 +117,7 @@ def response(resp):
|
||||
|
||||
def init(engine_settings): # pylint: disable=unused-argument
|
||||
global CACHE # pylint: disable=global-statement
|
||||
CACHE = EngineCache(engine_settings["name"]) # type:ignore
|
||||
CACHE = EngineCache(engine_settings["name"]) # type: ignore
|
||||
|
||||
|
||||
def get_client_id() -> str | None:
|
||||
|
||||
@@ -44,6 +44,7 @@ Implementations
|
||||
===============
|
||||
|
||||
"""
|
||||
|
||||
import typing as t
|
||||
import sqlite3
|
||||
import contextlib
|
||||
|
||||
@@ -82,6 +82,7 @@ Startpage's category (for Web-search, News, Videos, ..) is set by
|
||||
Supported categories are ``web``, ``news`` and ``images``.
|
||||
|
||||
"""
|
||||
|
||||
# pylint: disable=too-many-statements
|
||||
|
||||
import re
|
||||
|
||||
@@ -74,7 +74,6 @@ Implementations
|
||||
===============
|
||||
"""
|
||||
|
||||
|
||||
from urllib.parse import urlencode
|
||||
from dateutil.parser import parse
|
||||
from searx.utils import html_to_text, humanize_number
|
||||
|
||||
@@ -12,7 +12,6 @@ from lxml import html
|
||||
from searx.result_types import EngineResults
|
||||
from searx.utils import eval_xpath_list, eval_xpath, extract_text
|
||||
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from lxml.etree import ElementBase
|
||||
from searx.extended_types import SXNG_Response
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
Some implementations are shared from :ref:`wikipedia engine`.
|
||||
"""
|
||||
|
||||
# pylint: disable=missing-class-docstring
|
||||
|
||||
import typing as t
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
Wolfram|Alpha (Science)
|
||||
"""
|
||||
|
||||
|
||||
from json import loads
|
||||
from urllib.parse import urlencode
|
||||
|
||||
@@ -53,7 +52,7 @@ seconds."""
|
||||
|
||||
def init(engine_settings):
|
||||
global CACHE # pylint: disable=global-statement
|
||||
CACHE = EngineCache(engine_settings["name"]) # type:ignore
|
||||
CACHE = EngineCache(engine_settings["name"]) # type: ignore
|
||||
|
||||
|
||||
def obtain_token() -> str:
|
||||
|
||||
@@ -50,6 +50,7 @@ the engine).
|
||||
Implementations
|
||||
===============
|
||||
"""
|
||||
|
||||
# pylint: disable=fixme
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ from lxml import html
|
||||
from searx.exceptions import SearxEngineCaptchaException
|
||||
from searx.utils import humanize_bytes, eval_xpath, eval_xpath_list, extract_text, extr
|
||||
|
||||
|
||||
# Engine metadata
|
||||
about = {
|
||||
"website": 'https://yandex.com/',
|
||||
|
||||
Reference in New Issue
Block a user