Skip to content

Commit

Permalink
[doc] build from commit 4b6eebd
Browse files Browse the repository at this point in the history
  • Loading branch information
return42 committed May 10, 2024
1 parent 6e35290 commit 33422c4
Show file tree
Hide file tree
Showing 183 changed files with 1,314 additions and 598 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 795284d90d055f5a7f3730555ee6cf96
config: 533eff2ae6d804e2afe65b0873eb5f4c
tags: 645f666f9bcd5a90fca523b33c5a78b7
6 changes: 3 additions & 3 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Page not found &#8212; SearXNG Documentation (2024.4.30+c8d0b652)</title>
<title>Page not found &#8212; SearXNG Documentation (2024.5.10+4b6eebd3)</title>
<link rel="stylesheet" type="text/css" href="/_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="/_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="/_static/tabs.css?v=a5c4661c" />
<script src="/_static/documentation_options.js?v=a5e860d7"></script>
<script src="/_static/documentation_options.js?v=3c74e0ca"></script>
<script src="/_static/doctools.js?v=9a2dae69"></script>
<script src="/_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="/_static/tabs.js?v=3030b3cb"></script>
Expand All @@ -25,7 +25,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="/py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="/index.html">SearXNG Documentation (2024.4.30+c8d0b652)</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="/index.html">SearXNG Documentation (2024.5.10+4b6eebd3)</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Page not found</a></li>
</ul>
</div>
Expand Down
7 changes: 4 additions & 3 deletions _modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Overview: module code &#8212; SearXNG Documentation (2024.4.30+c8d0b652)</title>
<title>Overview: module code &#8212; SearXNG Documentation (2024.5.10+4b6eebd3)</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../_static/tabs.css?v=a5c4661c" />
<script src="../_static/documentation_options.js?v=a5e860d7"></script>
<script src="../_static/documentation_options.js?v=3c74e0ca"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/tabs.js?v=3030b3cb"></script>
Expand All @@ -25,7 +25,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">SearXNG Documentation (2024.4.30+c8d0b652)</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../index.html">SearXNG Documentation (2024.5.10+4b6eebd3)</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Overview: module code</a></li>
</ul>
</div>
Expand Down Expand Up @@ -84,6 +84,7 @@ <h1>All modules for which code is available</h1>
<li><a href="searx/infopage.html">searx.infopage</a></li>
<li><a href="searx/limiter.html">searx.limiter</a></li>
<li><a href="searx/locales.html">searx.locales</a></li>
<li><a href="searx/plugins/unit_converter.html">searx.plugins.unit_converter</a></li>
<li><a href="searx/redislib.html">searx.redislib</a></li>
<li><a href="searx/search.html">searx.search</a></li>
<ul><li><a href="searx/search/models.html">searx.search.models</a></li>
Expand Down
6 changes: 3 additions & 3 deletions _modules/searx/autocomplete.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>searx.autocomplete &#8212; SearXNG Documentation (2024.4.30+c8d0b652)</title>
<title>searx.autocomplete &#8212; SearXNG Documentation (2024.5.10+4b6eebd3)</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../_static/tabs.css?v=a5c4661c" />
<script src="../../_static/documentation_options.js?v=a5e860d7"></script>
<script src="../../_static/documentation_options.js?v=3c74e0ca"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/tabs.js?v=3030b3cb"></script>
Expand All @@ -25,7 +25,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SearXNG Documentation (2024.4.30+c8d0b652)</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SearXNG Documentation (2024.5.10+4b6eebd3)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">searx.autocomplete</a></li>
</ul>
Expand Down
6 changes: 3 additions & 3 deletions _modules/searx/babel_extract.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>searx.babel_extract &#8212; SearXNG Documentation (2024.4.30+c8d0b652)</title>
<title>searx.babel_extract &#8212; SearXNG Documentation (2024.5.10+4b6eebd3)</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../_static/tabs.css?v=a5c4661c" />
<script src="../../_static/documentation_options.js?v=a5e860d7"></script>
<script src="../../_static/documentation_options.js?v=3c74e0ca"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/tabs.js?v=3030b3cb"></script>
Expand All @@ -25,7 +25,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SearXNG Documentation (2024.4.30+c8d0b652)</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SearXNG Documentation (2024.5.10+4b6eebd3)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">searx.babel_extract</a></li>
</ul>
Expand Down
6 changes: 3 additions & 3 deletions _modules/searx/botdetection/_helpers.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>searx.botdetection._helpers &#8212; SearXNG Documentation (2024.4.30+c8d0b652)</title>
<title>searx.botdetection._helpers &#8212; SearXNG Documentation (2024.5.10+4b6eebd3)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script src="../../../_static/documentation_options.js?v=a5e860d7"></script>
<script src="../../../_static/documentation_options.js?v=3c74e0ca"></script>
<script src="../../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../../_static/tabs.js?v=3030b3cb"></script>
Expand All @@ -25,7 +25,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2024.4.30+c8d0b652)</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2024.5.10+4b6eebd3)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">searx.botdetection._helpers</a></li>
</ul>
Expand Down
47 changes: 36 additions & 11 deletions _modules/searx/botdetection/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>searx.botdetection.config &#8212; SearXNG Documentation (2024.4.30+c8d0b652)</title>
<title>searx.botdetection.config &#8212; SearXNG Documentation (2024.5.10+4b6eebd3)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script src="../../../_static/documentation_options.js?v=a5e860d7"></script>
<script src="../../../_static/documentation_options.js?v=3c74e0ca"></script>
<script src="../../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../../_static/tabs.js?v=3030b3cb"></script>
Expand All @@ -25,7 +25,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2024.4.30+c8d0b652)</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2024.5.10+4b6eebd3)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">searx.botdetection.config</a></li>
</ul>
Expand All @@ -52,7 +52,18 @@ <h1>Source code for searx.botdetection.config</h1><div class="highlight"><pre>
<span class="kn">import</span> <span class="nn">typing</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">import</span> <span class="nn">pathlib</span>
<span class="kn">import</span> <span class="nn">pytomlpp</span> <span class="k">as</span> <span class="nn">toml</span>

<span class="k">try</span><span class="p">:</span>
<span class="kn">import</span> <span class="nn">tomllib</span>

<span class="n">pytomlpp</span> <span class="o">=</span> <span class="kc">None</span>
<span class="n">USE_TOMLLIB</span> <span class="o">=</span> <span class="kc">True</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
<span class="kn">import</span> <span class="nn">pytomlpp</span>

<span class="n">tomllib</span> <span class="o">=</span> <span class="kc">None</span>
<span class="n">USE_TOMLLIB</span> <span class="o">=</span> <span class="kc">False</span>


<span class="n">__all__</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;Config&#39;</span><span class="p">,</span> <span class="s1">&#39;UNSET&#39;</span><span class="p">,</span> <span class="s1">&#39;SchemaIssue&#39;</span><span class="p">]</span>

Expand Down Expand Up @@ -105,20 +116,15 @@ <h1>Source code for searx.botdetection.config</h1><div class="highlight"><pre>
<span class="c1"># init schema</span>

<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;load schema file: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">schema_file</span><span class="p">)</span>
<span class="n">cfg</span> <span class="o">=</span> <span class="bp">cls</span><span class="p">(</span><span class="n">cfg_schema</span><span class="o">=</span><span class="n">toml</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">schema_file</span><span class="p">),</span> <span class="n">deprecated</span><span class="o">=</span><span class="n">deprecated</span><span class="p">)</span>
<span class="n">cfg</span> <span class="o">=</span> <span class="bp">cls</span><span class="p">(</span><span class="n">cfg_schema</span><span class="o">=</span><span class="n">toml_load</span><span class="p">(</span><span class="n">schema_file</span><span class="p">),</span> <span class="n">deprecated</span><span class="o">=</span><span class="n">deprecated</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">cfg_file</span><span class="o">.</span><span class="n">exists</span><span class="p">():</span>
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">&quot;missing config file: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">cfg_file</span><span class="p">)</span>
<span class="k">return</span> <span class="n">cfg</span>

<span class="c1"># load configuration</span>

<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;load config file: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">cfg_file</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">upd_cfg</span> <span class="o">=</span> <span class="n">toml</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">cfg_file</span><span class="p">)</span>
<span class="k">except</span> <span class="n">toml</span><span class="o">.</span><span class="n">DecodeError</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
<span class="n">msg</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">exc</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;</span><span class="se">\t</span><span class="s1">&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;</span><span class="se">\n</span><span class="s1">&#39;</span><span class="p">,</span> <span class="s1">&#39; &#39;</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">cfg_file</span><span class="p">,</span> <span class="n">msg</span><span class="p">)</span>
<span class="k">raise</span>
<span class="n">upd_cfg</span> <span class="o">=</span> <span class="n">toml_load</span><span class="p">(</span><span class="n">cfg_file</span><span class="p">)</span>

<span class="n">is_valid</span><span class="p">,</span> <span class="n">issue_list</span> <span class="o">=</span> <span class="n">cfg</span><span class="o">.</span><span class="n">validate</span><span class="p">(</span><span class="n">upd_cfg</span><span class="p">)</span>
<span class="k">for</span> <span class="n">msg</span> <span class="ow">in</span> <span class="n">issue_list</span><span class="p">:</span>
Expand Down Expand Up @@ -242,6 +248,25 @@ <h1>Source code for searx.botdetection.config</h1><div class="highlight"><pre>



<span class="k">def</span> <span class="nf">toml_load</span><span class="p">(</span><span class="n">file_name</span><span class="p">):</span>
<span class="k">if</span> <span class="n">USE_TOMLLIB</span><span class="p">:</span>
<span class="c1"># Python &gt;= 3.11</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">file_name</span><span class="p">,</span> <span class="s2">&quot;rb&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="k">return</span> <span class="n">tomllib</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
<span class="k">except</span> <span class="n">tomllib</span><span class="o">.</span><span class="n">TOMLDecodeError</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
<span class="n">msg</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">exc</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;</span><span class="se">\t</span><span class="s1">&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;</span><span class="se">\n</span><span class="s1">&#39;</span><span class="p">,</span> <span class="s1">&#39; &#39;</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">file_name</span><span class="p">,</span> <span class="n">msg</span><span class="p">)</span>
<span class="k">raise</span>
<span class="c1"># fallback to pytomlpp for Python &lt; 3.11</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="n">pytomlpp</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">file_name</span><span class="p">)</span>
<span class="k">except</span> <span class="n">pytomlpp</span><span class="o">.</span><span class="n">DecodeError</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
<span class="n">msg</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">exc</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;</span><span class="se">\t</span><span class="s1">&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;</span><span class="se">\n</span><span class="s1">&#39;</span><span class="p">,</span> <span class="s1">&#39; &#39;</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">file_name</span><span class="p">,</span> <span class="n">msg</span><span class="p">)</span>
<span class="k">raise</span>


<span class="c1"># working with dictionaries</span>


Expand Down
Loading

0 comments on commit 33422c4

Please sign in to comment.