diff options
56 files changed, 71 insertions, 149 deletions
@@ -59,7 +59,9 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=bad-whitespace, duplicate-code +disable=bad-whitespace, + duplicate-code, + missing-function-docstring, # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/docs/dev/translation.svg b/docs/dev/translation.svg index 70400cca7..71f4172b5 100644 --- a/docs/dev/translation.svg +++ b/docs/dev/translation.svg @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="968px" preserveAspectRatio="none" style="width:1008px;height:968px;background:#FFFFFF;" version="1.1" viewBox="0 0 1008 968" width="1008px" zoomAndPan="magnify"><defs><filter height="300%" id="fwj4fqzvak25j" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><rect fill="#FFFFFF" filter="url(#fwj4fqzvak25j)" height="320.7266" style="stroke:#000000;stroke-width:2.0;" width="981" x="10" y="116.7266"/><rect fill="#FFFFFF" filter="url(#fwj4fqzvak25j)" height="289.5938" style="stroke:#000000;stroke-width:2.0;" width="961" x="20" y="140.8594"/><rect fill="#FFFFFF" filter="url(#fwj4fqzvak25j)" height="324.7266" style="stroke:#000000;stroke-width:2.0;" width="848" x="143" y="494.5859"/><rect fill="#FFFFFF" filter="url(#fwj4fqzvak25j)" height="245.3281" style="stroke:#000000;stroke-width:2.0;" width="828" x="153" y="518.7188"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="91" x2="91" y1="56.5938" y2="908.5781"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="270" x2="270" y1="56.5938" y2="908.5781"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="514" x2="514" y1="56.5938" y2="908.5781"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="738" x2="738" y1="56.5938" y2="908.5781"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="899" x2="899" y1="56.5938" y2="908.5781"/><rect fill="#FEFECE" filter="url(#fwj4fqzvak25j)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="119" x="30" y="21.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="105" x="37" y="41.292">master branch</text><rect fill="#FEFECE" filter="url(#fwj4fqzvak25j)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="119" x="30" y="907.5781"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="105" x="37" y="927.5732">master branch</text><rect fill="#FEFECE" filter="url(#fwj4fqzvak25j)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="211" x="163" y="21.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="197" x="170" y="41.292">translations_update branch</text><rect fill="#FEFECE" filter="url(#fwj4fqzvak25j)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="211" x="163" y="907.5781"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="197" x="170" y="927.5732">translations_update branch</text><rect fill="#FEFECE" filter="url(#fwj4fqzvak25j)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="153" x="436" y="21.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="139" x="443" y="41.292">translations branch</text><rect fill="#FEFECE" filter="url(#fwj4fqzvak25j)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="153" x="436" y="907.5781"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="139" x="443" y="927.5732">translations branch</text><rect fill="#FEFECE" filter="url(#fwj4fqzvak25j)" height="46.5938" style="stroke:#A80036;stroke-width:1.5;" width="153" x="660" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="120" x="676.5" y="24.9951">weblate clone of</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="139" x="667" y="41.292">SearXNG repository</text><rect fill="#FEFECE" filter="url(#fwj4fqzvak25j)" height="46.5938" style="stroke:#A80036;stroke-width:1.5;" width="153" x="660" y="907.5781"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="120" x="676.5" y="927.5732">weblate clone of</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="139" x="667" y="943.8701">SearXNG repository</text><rect fill="#FEFECE" filter="url(#fwj4fqzvak25j)" height="46.5938" style="stroke:#A80036;stroke-width:1.5;" width="140" x="827" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="58" x="868" y="24.9951">weblate</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="122" x="834" y="41.292">pending changes</text><rect fill="#FEFECE" filter="url(#fwj4fqzvak25j)" height="46.5938" style="stroke:#A80036;stroke-width:1.5;" width="140" x="827" y="907.5781"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="58" x="868" y="927.5732">weblate</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="122" x="834" y="943.8701">pending changes</text><rect fill="#EEEEEE" filter="url(#fwj4fqzvak25j)" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1001" x="0" y="87.1602"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1001" y1="87.1602" y2="87.1602"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1001" y1="90.1602" y2="90.1602"/><rect fill="#EEEEEE" filter="url(#fwj4fqzvak25j)" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="230" x="385.5" y="76.5938"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="211" x="391.5" y="92.6606">for each commit on master</text><path d="M10,116.7266 L314,116.7266 L314,123.7266 L304,133.7266 L10,133.7266 L10,116.7266 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="320.7266" style="stroke:#000000;stroke-width:2.0;" width="981" x="10" y="116.7266"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="259" x="25" y="129.7935">.github/workflows/integration.yml</text><path d="M20,140.8594 L332,140.8594 L332,147.8594 L322,157.8594 L20,157.8594 L20,140.8594 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="289.5938" style="stroke:#000000;stroke-width:2.0;" width="961" x="20" y="140.8594"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="267" x="35" y="153.9263">make weblate.push.translations</text><polygon fill="#FBFB77" filter="url(#fwj4fqzvak25j)" points="711,162.9922,765,162.9922,775,173.9922,765,185.9922,711,185.9922,701,173.9922,711,162.9922" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="50" x="713" y="179.0591">wlc lock</text><polygon fill="#A80036" points="726.5,208.2578,736.5,212.2578,726.5,216.2578,730.5,212.2578" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="514.5" x2="732.5" y1="212.2578" y2="212.2578"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="47" x="521.5" y="207.1919">wlc pull</text><polygon fill="#A80036" points="749.5,237.3906,739.5,241.3906,749.5,245.3906,745.5,241.3906" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="743.5" x2="898" y1="241.3906" y2="241.3906"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="74" x="755.5" y="236.3247">wlc commit</text><polygon fill="#A80036" points="525.5,266.5234,515.5,270.5234,525.5,274.5234,521.5,270.5234" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="519.5" x2="737.5" y1="270.5234" y2="270.5234"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="196" x="531.5" y="265.4575">git merge weblate/translations</text><polygon fill="#A80036" points="502.5,310.7891,512.5,314.7891,502.5,318.7891,506.5,314.7891" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="91.5" x2="508.5" y1="314.7891" y2="314.7891"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="101" x="98.5" y="294.5903">pybabel extract</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="399" x="98.5" y="309.7231">extract messages, store messages.pot on translations branch</text><polygon fill="#A80036" points="726.5,385.3203,736.5,389.3203,726.5,393.3203,730.5,389.3203" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="514.5" x2="732.5" y1="389.3203" y2="389.3203"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="200" x="521.5" y="338.856">pybabel update (messages.po)</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="163" x="521.5" y="353.9888">git add searx/translations</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="69" x="521.5" y="369.1216">git commit</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="51" x="521.5" y="384.2544">git push</text><polygon fill="#FBFB77" filter="url(#fwj4fqzvak25j)" points="703,402.3203,773,402.3203,783,413.3203,773,425.3203,703,425.3203,693,413.3203,703,402.3203" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="66" x="705" y="418.3872">wlc unlock</text><rect fill="#EEEEEE" filter="url(#fwj4fqzvak25j)" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1001" x="0" y="465.0195"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1001" y1="465.0195" y2="465.0195"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1001" y1="468.0195" y2="468.0195"/><rect fill="#EEEEEE" filter="url(#fwj4fqzvak25j)" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="111" x="445" y="454.4531"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="92" x="451" y="470.52">every Friday</text><path d="M143,494.5859 L513,494.5859 L513,501.5859 L503,511.5859 L143,511.5859 L143,494.5859 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="324.7266" style="stroke:#000000;stroke-width:2.0;" width="848" x="143" y="494.5859"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="325" x="158" y="507.6528">.github/workflows/translations-update.yml</text><path d="M153,518.7188 L465,518.7188 L465,525.7188 L455,535.7188 L153,535.7188 L153,518.7188 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="245.3281" style="stroke:#000000;stroke-width:2.0;" width="828" x="153" y="518.7188"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="267" x="168" y="531.7856">make weblate.translations.commit</text><polygon fill="#FBFB77" filter="url(#fwj4fqzvak25j)" points="711,540.8516,765,540.8516,775,551.8516,765,563.8516,711,563.8516,701,551.8516,711,540.8516" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="50" x="713" y="556.9185">wlc lock</text><polygon fill="#A80036" points="726.5,586.1172,736.5,590.1172,726.5,594.1172,730.5,590.1172" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="514.5" x2="732.5" y1="590.1172" y2="590.1172"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="47" x="521.5" y="585.0513">wlc pull</text><polygon fill="#A80036" points="749.5,615.25,739.5,619.25,749.5,623.25,745.5,619.25" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="743.5" x2="898" y1="619.25" y2="619.25"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="74" x="755.5" y="614.1841">wlc commit</text><polygon fill="#A80036" points="525.5,644.3828,515.5,648.3828,525.5,652.3828,521.5,648.3828" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="519.5" x2="737.5" y1="648.3828" y2="648.3828"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="196" x="531.5" y="643.3169">git merge weblate/translations</text><polygon fill="#A80036" points="281.5,718.9141,271.5,722.9141,281.5,726.9141,277.5,722.9141" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="275.5" x2="513.5" y1="722.9141" y2="722.9141"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="105" x="287.5" y="672.4497">pybabel compile</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="134" x="287.5" y="687.5825">cp searx/translations</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="44" x="287.5" y="702.7153">git add</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="69" x="287.5" y="717.8481">git commit</text><polygon fill="#FBFB77" filter="url(#fwj4fqzvak25j)" points="703,735.9141,773,735.9141,783,746.9141,773,758.9141,703,758.9141,693,746.9141,703,735.9141" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="66" x="705" y="751.981">wlc unlock</text><polygon fill="#FBFB77" filter="url(#fwj4fqzvak25j)" points="175,776.0469,365,776.0469,375,795.0469,365,814.0469,175,814.0469,165,795.0469,175,776.0469" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="186" x="177" y="792.1138">create or update pull request</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="135" x="177" y="807.2466">"Update translations"</text><rect fill="#EEEEEE" filter="url(#fwj4fqzvak25j)" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1001" x="0" y="846.8789"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1001" y1="846.8789" y2="846.8789"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1001" y1="849.8789" y2="849.8789"/><rect fill="#EEEEEE" filter="url(#fwj4fqzvak25j)" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="168" x="416.5" y="836.3125"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="149" x="422.5" y="852.3794">developper's review</text><polygon fill="#A80036" points="102.5,886.5781,92.5,890.5781,102.5,894.5781,98.5,890.5781" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="96.5" x2="269.5" y1="890.5781" y2="890.5781"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="121" x="108.5" y="885.5122">merge pull request</text><!--MD5=[e3d4a82efdc738a59c5df45b59de0f06] +<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="999px" preserveAspectRatio="none" style="width:1018px;height:999px;background:#FFFFFF;" version="1.1" viewBox="0 0 1018 999" width="1018px" zoomAndPan="magnify"><defs><filter height="300%" id="flwgy9xrajsm" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><rect fill="#FFFFFF" filter="url(#flwgy9xrajsm)" height="351.8594" style="stroke:#000000;stroke-width:2.0;" width="991" x="10" y="116.7266"/><rect fill="#FFFFFF" filter="url(#flwgy9xrajsm)" height="320.7266" style="stroke:#000000;stroke-width:2.0;" width="971" x="20" y="140.8594"/><rect fill="#FFFFFF" filter="url(#flwgy9xrajsm)" height="245.3281" style="stroke:#000000;stroke-width:2.0;" width="555" x="426" y="209.2578"/><rect fill="#FFFFFF" filter="url(#flwgy9xrajsm)" height="324.7266" style="stroke:#000000;stroke-width:2.0;" width="848" x="143" y="525.7188"/><rect fill="#FFFFFF" filter="url(#flwgy9xrajsm)" height="245.3281" style="stroke:#000000;stroke-width:2.0;" width="828" x="153" y="549.8516"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="91" x2="91" y1="56.5938" y2="939.7109"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="270" x2="270" y1="56.5938" y2="939.7109"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="514" x2="514" y1="56.5938" y2="939.7109"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="738" x2="738" y1="56.5938" y2="939.7109"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="899" x2="899" y1="56.5938" y2="939.7109"/><rect fill="#FEFECE" filter="url(#flwgy9xrajsm)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="119" x="30" y="21.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="105" x="37" y="41.292">master branch</text><rect fill="#FEFECE" filter="url(#flwgy9xrajsm)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="119" x="30" y="938.7109"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="105" x="37" y="958.7061">master branch</text><rect fill="#FEFECE" filter="url(#flwgy9xrajsm)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="211" x="163" y="21.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="197" x="170" y="41.292">translations_update branch</text><rect fill="#FEFECE" filter="url(#flwgy9xrajsm)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="211" x="163" y="938.7109"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="197" x="170" y="958.7061">translations_update branch</text><rect fill="#FEFECE" filter="url(#flwgy9xrajsm)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="153" x="436" y="21.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="139" x="443" y="41.292">translations branch</text><rect fill="#FEFECE" filter="url(#flwgy9xrajsm)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="153" x="436" y="938.7109"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="139" x="443" y="958.7061">translations branch</text><rect fill="#FEFECE" filter="url(#flwgy9xrajsm)" height="46.5938" style="stroke:#A80036;stroke-width:1.5;" width="153" x="660" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="120" x="676.5" y="24.9951">weblate clone of</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="139" x="667" y="41.292">translations branch</text><rect fill="#FEFECE" filter="url(#flwgy9xrajsm)" height="46.5938" style="stroke:#A80036;stroke-width:1.5;" width="153" x="660" y="938.7109"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="120" x="676.5" y="958.7061">weblate clone of</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="139" x="667" y="975.0029">translations branch</text><rect fill="#FEFECE" filter="url(#flwgy9xrajsm)" height="46.5938" style="stroke:#A80036;stroke-width:1.5;" width="140" x="827" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="58" x="868" y="24.9951">weblate</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="122" x="834" y="41.292">pending changes</text><rect fill="#FEFECE" filter="url(#flwgy9xrajsm)" height="46.5938" style="stroke:#A80036;stroke-width:1.5;" width="140" x="827" y="938.7109"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="58" x="868" y="958.7061">weblate</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="122" x="834" y="975.0029">pending changes</text><rect fill="#EEEEEE" filter="url(#flwgy9xrajsm)" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1011" x="0" y="87.1602"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1011" y1="87.1602" y2="87.1602"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1011" y1="90.1602" y2="90.1602"/><rect fill="#EEEEEE" filter="url(#flwgy9xrajsm)" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="230" x="390.5" y="76.5938"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="211" x="396.5" y="92.6606">for each commit on master</text><path d="M10,116.7266 L314,116.7266 L314,123.7266 L304,133.7266 L10,133.7266 L10,116.7266 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="351.8594" style="stroke:#000000;stroke-width:2.0;" width="991" x="10" y="116.7266"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="259" x="25" y="129.7935">.github/workflows/integration.yml</text><path d="M20,140.8594 L309,140.8594 L309,147.8594 L299,157.8594 L20,157.8594 L20,140.8594 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="320.7266" style="stroke:#000000;stroke-width:2.0;" width="971" x="20" y="140.8594"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="244" x="35" y="153.9263">make weblate.push.translations</text><polygon fill="#A80036" points="502.5,190.2578,512.5,194.2578,502.5,198.2578,506.5,194.2578" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="91.5" x2="508.5" y1="194.2578" y2="194.2578"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="101" x="98.5" y="174.0591">pybabel extract</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="399" x="98.5" y="189.1919">extract messages, store messages.pot on translations branch</text><path d="M426,209.2578 L492,209.2578 L492,216.2578 L482,226.2578 L426,226.2578 L426,209.2578 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="245.3281" style="stroke:#000000;stroke-width:2.0;" width="555" x="426" y="209.2578"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="21" x="441" y="222.3247">alt</text><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="299" x="507" y="221.4683">[if there are some changes in messages.pot]</text><polygon fill="#FBFB77" filter="url(#flwgy9xrajsm)" points="711,231.3906,765,231.3906,775,242.3906,765,254.3906,711,254.3906,701,242.3906,711,231.3906" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="50" x="713" y="247.4575">wlc lock</text><polygon fill="#A80036" points="726.5,276.6563,736.5,280.6563,726.5,284.6563,730.5,280.6563" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="514.5" x2="732.5" y1="280.6563" y2="280.6563"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="47" x="521.5" y="275.5903">wlc pull</text><polygon fill="#A80036" points="749.5,305.7891,739.5,309.7891,749.5,313.7891,745.5,309.7891" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="743.5" x2="898" y1="309.7891" y2="309.7891"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="74" x="755.5" y="304.7231">wlc commit</text><polygon fill="#A80036" points="525.5,334.9219,515.5,338.9219,525.5,342.9219,521.5,338.9219" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="519.5" x2="737.5" y1="338.9219" y2="338.9219"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="196" x="531.5" y="333.856">git merge weblate/translations</text><polygon fill="#A80036" points="726.5,409.4531,736.5,413.4531,726.5,417.4531,730.5,413.4531" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="514.5" x2="732.5" y1="413.4531" y2="413.4531"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="200" x="521.5" y="362.9888">pybabel update (messages.po)</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="163" x="521.5" y="378.1216">git add searx/translations</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="69" x="521.5" y="393.2544">git commit</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="51" x="521.5" y="408.3872">git push</text><polygon fill="#FBFB77" filter="url(#flwgy9xrajsm)" points="703,426.4531,773,426.4531,783,437.4531,773,449.4531,703,449.4531,693,437.4531,703,426.4531" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="66" x="705" y="442.52">wlc unlock</text><rect fill="#EEEEEE" filter="url(#flwgy9xrajsm)" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1011" x="0" y="496.1523"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1011" y1="496.1523" y2="496.1523"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1011" y1="499.1523" y2="499.1523"/><rect fill="#EEEEEE" filter="url(#flwgy9xrajsm)" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="111" x="450" y="485.5859"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="92" x="456" y="501.6528">every Friday</text><path d="M143,525.7188 L513,525.7188 L513,532.7188 L503,542.7188 L143,542.7188 L143,525.7188 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="324.7266" style="stroke:#000000;stroke-width:2.0;" width="848" x="143" y="525.7188"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="325" x="158" y="538.7856">.github/workflows/translations-update.yml</text><path d="M153,549.8516 L465,549.8516 L465,556.8516 L455,566.8516 L153,566.8516 L153,549.8516 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="245.3281" style="stroke:#000000;stroke-width:2.0;" width="828" x="153" y="549.8516"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="267" x="168" y="562.9185">make weblate.translations.commit</text><polygon fill="#FBFB77" filter="url(#flwgy9xrajsm)" points="711,571.9844,765,571.9844,775,582.9844,765,594.9844,711,594.9844,701,582.9844,711,571.9844" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="50" x="713" y="588.0513">wlc lock</text><polygon fill="#A80036" points="726.5,617.25,736.5,621.25,726.5,625.25,730.5,621.25" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="514.5" x2="732.5" y1="621.25" y2="621.25"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="47" x="521.5" y="616.1841">wlc pull</text><polygon fill="#A80036" points="749.5,646.3828,739.5,650.3828,749.5,654.3828,745.5,650.3828" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="743.5" x2="898" y1="650.3828" y2="650.3828"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="74" x="755.5" y="645.3169">wlc commit</text><polygon fill="#A80036" points="525.5,675.5156,515.5,679.5156,525.5,683.5156,521.5,679.5156" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="519.5" x2="737.5" y1="679.5156" y2="679.5156"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="196" x="531.5" y="674.4497">git merge weblate/translations</text><polygon fill="#A80036" points="281.5,750.0469,271.5,754.0469,281.5,758.0469,277.5,754.0469" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="275.5" x2="513.5" y1="754.0469" y2="754.0469"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="105" x="287.5" y="703.5825">pybabel compile</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="134" x="287.5" y="718.7153">cp searx/translations</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="44" x="287.5" y="733.8481">git add</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="69" x="287.5" y="748.981">git commit</text><polygon fill="#FBFB77" filter="url(#flwgy9xrajsm)" points="703,767.0469,773,767.0469,783,778.0469,773,790.0469,703,790.0469,693,778.0469,703,767.0469" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="66" x="705" y="783.1138">wlc unlock</text><polygon fill="#FBFB77" filter="url(#flwgy9xrajsm)" points="175,807.1797,365,807.1797,375,826.1797,365,845.1797,175,845.1797,165,826.1797,175,807.1797" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="186" x="177" y="823.2466">create or update pull request</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="135" x="177" y="838.3794">"Update translations"</text><rect fill="#EEEEEE" filter="url(#flwgy9xrajsm)" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1011" x="0" y="878.0117"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1011" y1="878.0117" y2="878.0117"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1011" y1="881.0117" y2="881.0117"/><rect fill="#EEEEEE" filter="url(#flwgy9xrajsm)" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="168" x="421.5" y="867.4453"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="149" x="427.5" y="883.5122">developper's review</text><polygon fill="#A80036" points="102.5,917.7109,92.5,921.7109,102.5,925.7109,98.5,921.7109" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="96.5" x2="269.5" y1="921.7109" y2="921.7109"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="121" x="108.5" y="916.645">merge pull request</text><!--MD5=[5c6c15370b11f873d07f34ae239ca6ad] @startuml participant "master branch" as master participant "translations_update branch" as translations_update @@ -10,13 +10,15 @@ participant "weblate\npending changes " as weblate_change group .github/workflows/integration.yml group make weblate.push.translations - hnote over weblate : wlc lock - translations -> weblate: wlc pull - weblate_change -> weblate: wlc commit - weblate -> translations: git merge weblate/translations master -> translations: pybabel extract\nextract messages, store messages.pot on translations branch - translations -> weblate: pybabel update (messages.po)\ngit add searx/translations\ngit commit\ngit push - hnote over weblate : wlc unlock + alt if there are some changes in messages.pot + hnote over weblate : wlc lock + translations -> weblate: wlc pull + weblate_change -> weblate: wlc commit + weblate -> translations: git merge weblate/translations + translations -> weblate: pybabel update (messages.po)\ngit add searx/translations\ngit commit\ngit push + hnote over weblate : wlc unlock + end end end @@ -42,4 +44,4 @@ translations_update -> master: merge pull request See https://plantuml.com/en/sequence-diagram https://www.planttext.com ---></g></svg> +--></g></svg>
\ No newline at end of file @@ -37,7 +37,7 @@ PYLINT_SEARX_DISABLE_OPTION="\ I,C,R,\ W0105,W0212,W0511,W0603,W0613,W0621,W0702,W0703,W1401,\ E1136" -PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES="supported_languages,language_aliases" +PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES="supported_languages,language_aliases,logger,categories" PYLINT_OPTIONS="-m pylint -j 0 --rcfile .pylintrc" help() { @@ -239,16 +239,14 @@ weblate.push.translations() { local messages_pot diff_messages_pot last_commit_hash last_commit_detail \ last_commit_message exitcode + messages_pot="${TRANSLATIONS_WORKTREE}/searx/translations/messages.pot" ( set -e - # lock change on weblate - pyenv.cmd wlc lock # get translations branch in git worktree (TRANSLATIONS_WORKTREE) weblate.translations.worktree # update messages.pot in the master branch build_msg BABEL 'extract messages from source files and generate POT file' - messages_pot="${TRANSLATIONS_WORKTREE}/searx/translations/messages.pot" pyenv.cmd pybabel extract -F babel.cfg \ -o "${messages_pot}" \ "searx/" @@ -258,8 +256,25 @@ weblate.push.translations() { git diff -- "searx/translations/messages.pot") if ! echo "$diff_messages_pot" | grep -qE "[\+\-](msgid|msgstr)"; then build_msg BABEL 'no changes detected, exiting' - return 0 + return 42 fi + return 0 + ) + exitcode=$? + if [ "$exitcode" -eq 42 ]; then + return 0 + fi + if [ "$exitcode" ]; then + return $exitcode + fi + ( + set -e + + # lock change on weblate + # weblate may add commit(s) since the call to "weblate.translations.worktree". + # this is not a problem because after this line, "weblate.to.translations" + # calls again "weblate.translations.worktree" which calls "git pull" + pyenv.cmd wlc lock # save messages.pot in the translations branch for later pushd "${TRANSLATIONS_WORKTREE}" @@ -588,6 +603,7 @@ test.pylint() { ( set -e build_msg TEST "[pylint] \$PYLINT_FILES" pyenv.cmd python ${PYLINT_OPTIONS} ${PYLINT_VERBOSE} \ + --additional-builtins="${PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES}" \ "${PYLINT_FILES[@]}" build_msg TEST "[pylint] searx/engines" diff --git a/searx/__init__.py b/searx/__init__.py index 0b73d5204..265f926bc 100644 --- a/searx/__init__.py +++ b/searx/__init__.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring, missing-module-docstring +# pylint: disable=missing-module-docstring from os.path import dirname, abspath import logging diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index d7defe0b4..154cd605f 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -1,6 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """This module implements the engine loader. Load and initialize the ``engines``, see :py:func:`load_engines` and register @@ -111,6 +110,7 @@ def load_engine(engine_data): if is_missing_required_attributes(engine): return None + engine.logger = logger.getChild(engine_name) return engine diff --git a/searx/engines/apkmirror.py b/searx/engines/apkmirror.py index 855d19739..746a8cd9c 100644 --- a/searx/engines/apkmirror.py +++ b/searx/engines/apkmirror.py @@ -3,20 +3,17 @@ """APKMirror """ -# pylint: disable=invalid-name, missing-function-docstring +# pylint: disable=invalid-name from urllib.parse import urlencode from lxml import html -from searx import logger from searx.utils import ( eval_xpath_list, eval_xpath_getindex, extract_text, ) -logger = logger.getChild('APKMirror engine') - about = { "website": 'https://www.apkmirror.com', "wikidata_id": None, diff --git a/searx/engines/artic.py b/searx/engines/artic.py index 44af4ebd5..104ab8839 100644 --- a/searx/engines/artic.py +++ b/searx/engines/artic.py @@ -8,14 +8,9 @@ Explore thousands of artworks from The Art Institute of Chicago. """ -# pylint: disable=missing-function-docstring - from json import loads from urllib.parse import urlencode -from searx import logger -logger = logger.getChild('APKMirror engine') - about = { "website": 'https://www.artic.edu', "wikidata_id": 'Q239303', diff --git a/searx/engines/bing.py b/searx/engines/bing.py index f849cef92..9cac3e926 100644 --- a/searx/engines/bing.py +++ b/searx/engines/bing.py @@ -6,11 +6,8 @@ import re from urllib.parse import urlencode from lxml import html -from searx import logger from searx.utils import eval_xpath, extract_text, match_language -logger = logger.getChild('bing engine') - # about about = { "website": 'https://www.bing.com', diff --git a/searx/engines/core.py b/searx/engines/core.py index 0d9724695..e83c8bbe9 100644 --- a/searx/engines/core.py +++ b/searx/engines/core.py @@ -3,17 +3,13 @@ """CORE (science) """ -# pylint: disable=missing-function-docstring from json import loads from datetime import datetime from urllib.parse import urlencode -from searx import logger from searx.exceptions import SearxEngineAPIException -logger = logger.getChild('CORE engine') - about = { "website": 'https://core.ac.uk', "wikidata_id": 'Q22661180', @@ -29,8 +25,6 @@ nb_per_page = 10 api_key = 'unset' -logger = logger.getChild('CORE engine') - base_url = 'https://core.ac.uk:443/api-v2/search/' search_string = '{query}?page={page}&pageSize={nb_per_page}&apiKey={apikey}' diff --git a/searx/engines/deviantart.py b/searx/engines/deviantart.py index 21d56831c..b13d54dd5 100644 --- a/searx/engines/deviantart.py +++ b/searx/engines/deviantart.py @@ -3,7 +3,6 @@ """ Deviantart (Images) """ -# pylint: disable=missing-function-docstring from urllib.parse import urlencode from lxml import html diff --git a/searx/engines/digg.py b/searx/engines/digg.py index 5c6fb3875..e12cc43c8 100644 --- a/searx/engines/digg.py +++ b/searx/engines/digg.py @@ -3,7 +3,6 @@ """ Digg (News, Social media) """ -# pylint: disable=missing-function-docstring from json import loads from urllib.parse import urlencode diff --git a/searx/engines/docker_hub.py b/searx/engines/docker_hub.py index d9d0f745b..e69f677b3 100644 --- a/searx/engines/docker_hub.py +++ b/searx/engines/docker_hub.py @@ -1,6 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """Docker Hub (IT) """ diff --git a/searx/engines/duckduckgo_definitions.py b/searx/engines/duckduckgo_definitions.py index a9098de65..3ef043964 100644 --- a/searx/engines/duckduckgo_definitions.py +++ b/searx/engines/duckduckgo_definitions.py @@ -1,6 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """DuckDuckGo (Instant Answer API) """ @@ -9,15 +8,12 @@ import json from urllib.parse import urlencode, urlparse, urljoin from lxml import html -from searx import logger from searx.data import WIKIDATA_UNITS from searx.engines.duckduckgo import language_aliases from searx.engines.duckduckgo import _fetch_supported_languages, supported_languages_url # NOQA # pylint: disable=unused-import from searx.utils import extract_text, html_to_text, match_language, get_string_replaces_function from searx.external_urls import get_external_url, get_earth_coordinates_url, area_to_osm_zoom -logger = logger.getChild('duckduckgo_definitions') - # about about = { "website": 'https://duckduckgo.com/', @@ -67,7 +63,7 @@ def request(query, params): params['url'] = URL.format(query=urlencode({'q': query})) language = match_language( params['language'], - supported_languages, # pylint: disable=undefined-variable + supported_languages, language_aliases ) language = language.split('-')[0] diff --git a/searx/engines/flickr_noapi.py b/searx/engines/flickr_noapi.py index a07aad51e..1d670ee50 100644 --- a/searx/engines/flickr_noapi.py +++ b/searx/engines/flickr_noapi.py @@ -7,11 +7,8 @@ from json import loads from time import time import re from urllib.parse import urlencode -from searx.engines import logger from searx.utils import ecma_unescape, html_to_text -logger = logger.getChild('flickr-noapi') - # about about = { "website": 'https://www.flickr.com', diff --git a/searx/engines/genius.py b/searx/engines/genius.py index 9d701a8de..b0fcb09a8 100644 --- a/searx/engines/genius.py +++ b/searx/engines/genius.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=invalid-name, missing-function-docstring +# pylint: disable=invalid-name """Genius """ @@ -9,9 +9,6 @@ from json import loads from urllib.parse import urlencode from datetime import datetime -from searx import logger -logger = logger.getChild('genius engine') - # about about = { "website": 'https://genius.com/', diff --git a/searx/engines/gigablast.py b/searx/engines/gigablast.py index d1c2639af..c2c51afe8 100644 --- a/searx/engines/gigablast.py +++ b/searx/engines/gigablast.py @@ -3,12 +3,11 @@ """ Gigablast (Web) """ -# pylint: disable=missing-function-docstring, invalid-name +# pylint: disable=invalid-name import re from json import loads from urllib.parse import urlencode -# from searx import logger from searx.network import get # about diff --git a/searx/engines/google.py b/searx/engines/google.py index e1caabb12..4e6fa6190 100644 --- a/searx/engines/google.py +++ b/searx/engines/google.py @@ -25,16 +25,11 @@ The google WEB engine itself has a special setup option: """ -# pylint: disable=invalid-name, missing-function-docstring - from urllib.parse import urlencode from lxml import html -from searx import logger from searx.utils import match_language, extract_text, eval_xpath, eval_xpath_list, eval_xpath_getindex from searx.exceptions import SearxEngineCaptchaException -logger = logger.getChild('google engine') - # about about = { "website": 'https://www.google.com', @@ -280,7 +275,6 @@ def request(query, params): offset = (params['pageno'] - 1) * 10 lang_info = get_lang_info( - # pylint: disable=undefined-variable params, supported_languages, language_aliases, True ) diff --git a/searx/engines/google_images.py b/searx/engines/google_images.py index f4fbbaa42..ffdd6675e 100644 --- a/searx/engines/google_images.py +++ b/searx/engines/google_images.py @@ -16,7 +16,6 @@ from urllib.parse import urlencode, unquote from lxml import html -from searx import logger from searx.utils import ( eval_xpath, eval_xpath_list, @@ -37,8 +36,6 @@ from searx.engines.google import ( ) # pylint: enable=unused-import -logger = logger.getChild('google images') - # about about = { "website": 'https://images.google.com', @@ -95,7 +92,6 @@ def request(query, params): """Google-Video search request""" lang_info = get_lang_info( - # pylint: disable=undefined-variable params, supported_languages, language_aliases, False ) logger.debug( diff --git a/searx/engines/google_news.py b/searx/engines/google_news.py index e6d50855e..87ac9a19d 100644 --- a/searx/engines/google_news.py +++ b/searx/engines/google_news.py @@ -11,7 +11,7 @@ ignores some parameters from the common :ref:`google API`: """ -# pylint: disable=invalid-name, missing-function-docstring +# pylint: disable=invalid-name import binascii from datetime import datetime @@ -20,7 +20,6 @@ from urllib.parse import urlencode from base64 import b64decode from lxml import html -from searx import logger from searx.utils import ( eval_xpath, eval_xpath_list, @@ -50,8 +49,6 @@ about = { "results": 'HTML', } -logger = logger.getChild('google news') - # compared to other google engines google-news has a different time range # support. The time range is included in the search term. time_range_dict = { @@ -78,7 +75,6 @@ def request(query, params): """Google-News search request""" lang_info = get_lang_info( - # pylint: disable=undefined-variable params, supported_languages, language_aliases, False ) logger.debug( diff --git a/searx/engines/google_scholar.py b/searx/engines/google_scholar.py index 8442a7bfa..e6726463d 100644 --- a/searx/engines/google_scholar.py +++ b/searx/engines/google_scholar.py @@ -9,12 +9,11 @@ Definitions`_. https://developers.google.com/custom-search/docs/xml_results#WebSearch_Query_Parameter_Definitions """ -# pylint: disable=invalid-name, missing-function-docstring +# pylint: disable=invalid-name from urllib.parse import urlencode from datetime import datetime from lxml import html -from searx import logger from searx.utils import ( eval_xpath, @@ -53,8 +52,6 @@ use_locale_domain = True time_range_support = True safesearch = False -logger = logger.getChild('google scholar') - def time_range_url(params): """Returns a URL query component for a google-Scholar time range based on ``params['time_range']``. Google-Scholar does only support ranges in years. @@ -76,7 +73,6 @@ def request(query, params): offset = (params['pageno'] - 1) * 10 lang_info = get_lang_info( - # pylint: disable=undefined-variable params, supported_languages, language_aliases, False ) logger.debug( diff --git a/searx/engines/google_videos.py b/searx/engines/google_videos.py index 3990d5b32..9403ef4f7 100644 --- a/searx/engines/google_videos.py +++ b/searx/engines/google_videos.py @@ -14,13 +14,12 @@ """ -# pylint: disable=invalid-name, missing-function-docstring +# pylint: disable=invalid-name import re from urllib.parse import urlencode from lxml import html -from searx import logger from searx.utils import ( eval_xpath, eval_xpath_list, @@ -59,8 +58,6 @@ about = { "results": 'HTML', } -logger = logger.getChild('google video') - # engine dependent config categories = ['videos'] @@ -113,7 +110,6 @@ def request(query, params): """Google-Video search request""" lang_info = get_lang_info( - # pylint: disable=undefined-variable params, supported_languages, language_aliases, False ) logger.debug( diff --git a/searx/engines/mediathekviewweb.py b/searx/engines/mediathekviewweb.py index 80104ae73..bd7c16a5d 100644 --- a/searx/engines/mediathekviewweb.py +++ b/searx/engines/mediathekviewweb.py @@ -4,8 +4,6 @@ """ -# pylint: disable=missing-function-docstring - import datetime from json import loads, dumps diff --git a/searx/engines/meilisearch.py b/searx/engines/meilisearch.py index d0d304e2a..c41d23eb4 100644 --- a/searx/engines/meilisearch.py +++ b/searx/engines/meilisearch.py @@ -4,7 +4,7 @@ Meilisearch """ -# pylint: disable=global-statement, missing-function-docstring +# pylint: disable=global-statement from json import loads, dumps diff --git a/searx/engines/mongodb.py b/searx/engines/mongodb.py index 1f24c5acf..2ebb90539 100644 --- a/searx/engines/mongodb.py +++ b/searx/engines/mongodb.py @@ -1,6 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """MongoDB engine (Offline) """ diff --git a/searx/engines/mysql_server.py b/searx/engines/mysql_server.py index 42b436f5e..be89eb86e 100644 --- a/searx/engines/mysql_server.py +++ b/searx/engines/mysql_server.py @@ -1,6 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """MySQL database (offline) """ diff --git a/searx/engines/openstreetmap.py b/searx/engines/openstreetmap.py index 6920356c3..78c15320a 100644 --- a/searx/engines/openstreetmap.py +++ b/searx/engines/openstreetmap.py @@ -3,7 +3,6 @@ """OpenStreetMap (Map) """ -# pylint: disable=missing-function-docstring import re from json import loads @@ -439,3 +438,8 @@ def get_key_label(key_name, lang): if labels is None: return None return get_label(labels, lang) + + +def init(_): + import searx.engines.wikidata # pylint: disable=import-outside-toplevel + searx.engines.wikidata.logger = logger diff --git a/searx/engines/peertube.py b/searx/engines/peertube.py index 058065c03..f9cd50be1 100644 --- a/searx/engines/peertube.py +++ b/searx/engines/peertube.py @@ -34,7 +34,6 @@ def request(query, params): search_url = sanitized_url + "/api/v1/search/videos/?pageno={pageno}&{query}" query_dict = {"search": query} language = params["language"].split("-")[0] - # pylint: disable=undefined-variable if "all" != language and language in supported_languages: query_dict["languageOneOf"] = language params["url"] = search_url.format( diff --git a/searx/engines/postgresql.py b/searx/engines/postgresql.py index eb4e9b0b4..1eddcd519 100644 --- a/searx/engines/postgresql.py +++ b/searx/engines/postgresql.py @@ -1,6 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """PostgreSQL database (offline) """ diff --git a/searx/engines/qwant.py b/searx/engines/qwant.py index 8d03d8324..18e6a65d8 100644 --- a/searx/engines/qwant.py +++ b/searx/engines/qwant.py @@ -89,7 +89,6 @@ def request(query, params): else: language = match_language( params['language'], - # pylint: disable=undefined-variable supported_languages, language_aliases, ) diff --git a/searx/engines/redis_server.py b/searx/engines/redis_server.py index e8c248e32..a48f0775b 100644 --- a/searx/engines/redis_server.py +++ b/searx/engines/redis_server.py @@ -1,6 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """Redis engine (offline) """ diff --git a/searx/engines/solidtorrents.py b/searx/engines/solidtorrents.py index 4ed6167d0..7fbef9190 100644 --- a/searx/engines/solidtorrents.py +++ b/searx/engines/solidtorrents.py @@ -4,13 +4,8 @@ """ -# pylint: disable=missing-function-docstring - from json import loads from urllib.parse import urlencode -from searx import logger - -logger = logger.getChild('solidtor engine') about = { "website": 'https://www.solidtorrents.net/', diff --git a/searx/engines/solr.py b/searx/engines/solr.py index e38a103a9..e26f19442 100644 --- a/searx/engines/solr.py +++ b/searx/engines/solr.py @@ -4,7 +4,7 @@ Solr """ -# pylint: disable=global-statement, missing-function-docstring +# pylint: disable=global-statement from json import loads from urllib.parse import urlencode diff --git a/searx/engines/soundcloud.py b/searx/engines/soundcloud.py index a6f923855..d5bfc0f6f 100644 --- a/searx/engines/soundcloud.py +++ b/searx/engines/soundcloud.py @@ -8,7 +8,6 @@ from json import loads from lxml import html from dateutil import parser from urllib.parse import quote_plus, urlencode -from searx import logger from searx.network import get as http_get # about diff --git a/searx/engines/springer.py b/searx/engines/springer.py index 77a82016b..246e59b44 100644 --- a/searx/engines/springer.py +++ b/searx/engines/springer.py @@ -4,17 +4,12 @@ """ -# pylint: disable=missing-function-docstring - from datetime import datetime from json import loads from urllib.parse import urlencode -from searx import logger from searx.exceptions import SearxEngineAPIException -logger = logger.getChild('Springer Nature engine') - about = { "website": 'https://www.springernature.com/', "wikidata_id": 'Q21096327', diff --git a/searx/engines/sqlite.py b/searx/engines/sqlite.py index 84db74d62..292448602 100644 --- a/searx/engines/sqlite.py +++ b/searx/engines/sqlite.py @@ -1,6 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """SQLite database (Offline) @@ -9,11 +8,6 @@ import sqlite3 import contextlib -from searx import logger - - -logger = logger.getChild('SQLite engine') - engine_type = 'offline' database = "" query_str = "" diff --git a/searx/engines/unsplash.py b/searx/engines/unsplash.py index 834bc917c..1445b4cec 100644 --- a/searx/engines/unsplash.py +++ b/searx/engines/unsplash.py @@ -1,6 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """Unsplash """ @@ -8,9 +7,6 @@ from urllib.parse import urlencode, urlparse, urlunparse, parse_qsl from json import loads -from searx import logger - -logger = logger.getChild('unsplash engine') # about about = { "website": 'https://unsplash.com', diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.py index ddcce9085..f0dfc7595 100644 --- a/searx/engines/wikidata.py +++ b/searx/engines/wikidata.py @@ -10,15 +10,12 @@ from json import loads from dateutil.parser import isoparse from babel.dates import format_datetime, format_date, format_time, get_datetime_format -from searx import logger from searx.data import WIKIDATA_UNITS from searx.network import post, get from searx.utils import match_language, searx_useragent, get_string_replaces_function from searx.external_urls import get_external_url, get_earth_coordinates_url, area_to_osm_zoom from searx.engines.wikipedia import _fetch_supported_languages, supported_languages_url # NOQA # pylint: disable=unused-import -logger = logger.getChild('wikidata') - # about about = { "website": 'https://wikidata.org/', diff --git a/searx/engines/wordnik.py b/searx/engines/wordnik.py index 4bfeb4070..0c3785cfb 100644 --- a/searx/engines/wordnik.py +++ b/searx/engines/wordnik.py @@ -4,12 +4,9 @@ """ from lxml.html import fromstring -from searx import logger from searx.utils import extract_text from searx.network import raise_for_httperror -logger = logger.getChild('Wordnik engine') - # about about = { "website": 'https://www.wordnik.com', diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py index 0f88fb29a..8338d5301 100644 --- a/searx/engines/xpath.py +++ b/searx/engines/xpath.py @@ -1,6 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """The XPath engine is a *generic* engine with which it is possible to configure engines in the settings. @@ -23,9 +22,6 @@ from urllib.parse import urlencode from lxml import html from searx.utils import extract_text, extract_url, eval_xpath, eval_xpath_list -from searx import logger - -logger = logger.getChild('XPath engine') search_url = None """ @@ -187,7 +183,7 @@ def response(resp): ''' results = [] dom = html.fromstring(resp.text) - is_onion = 'onions' in categories # pylint: disable=undefined-variable + is_onion = 'onions' in categories if results_xpath: for result in eval_xpath_list(dom, results_xpath): diff --git a/searx/engines/yahoo_news.py b/searx/engines/yahoo_news.py index 98d8bc9f1..ec07cd408 100644 --- a/searx/engines/yahoo_news.py +++ b/searx/engines/yahoo_news.py @@ -6,7 +6,7 @@ Yahoo News is "English only" and do not offer localized nor language queries. """ -# pylint: disable=invalid-name, missing-function-docstring +# pylint: disable=invalid-name import re from urllib.parse import urlencode @@ -14,7 +14,6 @@ from datetime import datetime, timedelta from dateutil import parser from lxml import html -from searx import logger from searx.utils import ( eval_xpath_list, eval_xpath_getindex, @@ -23,8 +22,6 @@ from searx.utils import ( from searx.engines.yahoo import parse_url -logger = logger.getChild('yahoo_news engine') - # about about = { "website": 'https://news.yahoo.com', diff --git a/searx/flaskfix.py b/searx/flaskfix.py index c069df453..47aabfa53 100644 --- a/searx/flaskfix.py +++ b/searx/flaskfix.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-module-docstring,missing-function-docstring +# pylint: disable=missing-module-docstring from urllib.parse import urlparse diff --git a/searx/metrics/__init__.py b/searx/metrics/__init__.py index 2ef73149b..995f182af 100644 --- a/searx/metrics/__init__.py +++ b/searx/metrics/__init__.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-module-docstring, missing-function-docstring +# pylint: disable=missing-module-docstring import typing import math diff --git a/searx/network/__init__.py b/searx/network/__init__.py index 3dc99da48..7b0396a12 100644 --- a/searx/network/__init__.py +++ b/searx/network/__init__.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-module-docstring, missing-function-docstring, global-statement +# pylint: disable=missing-module-docstring, global-statement import asyncio import threading diff --git a/searx/network/client.py b/searx/network/client.py index 60171e6c3..187ae5366 100644 --- a/searx/network/client.py +++ b/searx/network/client.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-module-docstring, missing-function-docstring, global-statement +# pylint: disable=missing-module-docstring, global-statement import asyncio import logging diff --git a/searx/network/network.py b/searx/network/network.py index 94e91593d..d09a2ee0e 100644 --- a/searx/network/network.py +++ b/searx/network/network.py @@ -1,7 +1,7 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint # pylint: disable=global-statement -# pylint: disable=missing-module-docstring, missing-class-docstring, missing-function-docstring +# pylint: disable=missing-module-docstring, missing-class-docstring import atexit import asyncio diff --git a/searx/network/raise_for_httperror.py b/searx/network/raise_for_httperror.py index 0f550918d..a2f554614 100644 --- a/searx/network/raise_for_httperror.py +++ b/searx/network/raise_for_httperror.py @@ -1,6 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """Raise exception for an HTTP response is an error. """ diff --git a/searx/preferences.py b/searx/preferences.py index c19a11f4b..26506556a 100644 --- a/searx/preferences.py +++ b/searx/preferences.py @@ -117,7 +117,7 @@ class MultipleChoiceSetting(EnumStringSetting): self._validate_selections(elements) self.value = elements - def parse_form(self, data): # pylint: disable=missing-function-docstring + def parse_form(self, data): if self.locked: return @@ -154,7 +154,7 @@ class SetSetting(Setting): for element in elements: self.values.add(element) - def parse_form(self, data): # pylint: disable=missing-function-docstring + def parse_form(self, data): if self.locked: return @@ -226,22 +226,22 @@ class SwitchableSetting(Setting): if not hasattr(self, 'choices'): raise MissingArgumentException('missing argument: choices') - def transform_form_items(self, items): # pylint: disable=missing-function-docstring + def transform_form_items(self, items): # pylint: disable=no-self-use return items - def transform_values(self, values): # pylint: disable=missing-function-docstring + def transform_values(self, values): # pylint: disable=no-self-use return values - def parse_cookie(self, data): # pylint: disable=missing-function-docstring + def parse_cookie(self, data): # pylint: disable=attribute-defined-outside-init if data[DISABLED] != '': self.disabled = set(data[DISABLED].split(',')) if data[ENABLED] != '': self.enabled = set(data[ENABLED].split(',')) - def parse_form(self, items): # pylint: disable=missing-function-docstring + def parse_form(self, items): if self.locked: return @@ -262,14 +262,14 @@ class SwitchableSetting(Setting): resp.set_cookie('disabled_{0}'.format(self.value), ','.join(self.disabled), max_age=COOKIE_MAX_AGE) resp.set_cookie('enabled_{0}'.format(self.value), ','.join(self.enabled), max_age=COOKIE_MAX_AGE) - def get_disabled(self): # pylint: disable=missing-function-docstring + def get_disabled(self): disabled = self.disabled for choice in self.choices: # pylint: disable=no-member if not choice['default_on'] and choice['id'] not in self.enabled: disabled.add(choice['id']) return self.transform_values(disabled) - def get_enabled(self): # pylint: disable=missing-function-docstring + def get_enabled(self): enabled = self.enabled for choice in self.choices: # pylint: disable=no-member if choice['default_on'] and choice['id'] not in self.disabled: @@ -515,7 +515,7 @@ class Preferences: resp.set_cookie(k, v, max_age=COOKIE_MAX_AGE) return resp - def validate_token(self, engine): # pylint: disable=missing-function-docstring + def validate_token(self, engine): valid = True if hasattr(engine, 'tokens') and engine.tokens: valid = False diff --git a/searx/search/__init__.py b/searx/search/__init__.py index 041a54c4b..d8d3e1e1c 100644 --- a/searx/search/__init__.py +++ b/searx/search/__init__.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-module-docstring, missing-function-docstring +# pylint: disable=missing-module-docstring import typing import threading diff --git a/searx/search/checker/__main__.py b/searx/search/checker/__main__.py index e1de860b7..4ce4ca76b 100644 --- a/searx/search/checker/__main__.py +++ b/searx/search/checker/__main__.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-module-docstring, missing-function-docstring +# pylint: disable=missing-module-docstring import sys import io diff --git a/searx/search/checker/background.py b/searx/search/checker/background.py index f79a5d2df..d9f11a71c 100644 --- a/searx/search/checker/background.py +++ b/searx/search/checker/background.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-module-docstring, missing-function-docstring +# pylint: disable=missing-module-docstring import json import random diff --git a/searx/search/processors/abstract.py b/searx/search/processors/abstract.py index 81724f052..c8d81c026 100644 --- a/searx/search/processors/abstract.py +++ b/searx/search/processors/abstract.py @@ -19,8 +19,6 @@ from searx.utils import get_engine_from_settings logger = logger.getChild('searx.search.processor') SUSPENDED_STATUS = {} -# pylint: disable=missing-function-docstring - class SuspendedStatus: """Class to handle suspend state.""" diff --git a/searx/search/processors/online_currency.py b/searx/search/processors/online_currency.py index 4f642fa72..3213a11e5 100644 --- a/searx/search/processors/online_currency.py +++ b/searx/search/processors/online_currency.py @@ -12,8 +12,6 @@ from .online import OnlineProcessor parser_re = re.compile('.*?(\\d+(?:\\.\\d+)?) ([^.0-9]+) (?:in|to) ([^.0-9]+)', re.I) -# pylint: disable=missing-function-docstring - def normalize_name(name): name = name.lower().replace('-', ' ').rstrip('s') name = re.sub(' +', ' ', name) diff --git a/searx/settings_defaults.py b/searx/settings_defaults.py index 42d88f2bc..62625b912 100644 --- a/searx/settings_defaults.py +++ b/searx/settings_defaults.py @@ -1,6 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """Implementation of the default settings. """ diff --git a/searx/unixthreadname.py b/searx/unixthreadname.py index 9a6f53813..0f1f54936 100644 --- a/searx/unixthreadname.py +++ b/searx/unixthreadname.py @@ -14,7 +14,7 @@ else: old_thread_init = threading.Thread.__init__ def new_thread_init(self, *args, **kwargs): - # pylint: disable=protected-access, disable=c-extension-no-member, disable=missing-function-docstring + # pylint: disable=protected-access, disable=c-extension-no-member old_thread_init(self, *args, **kwargs) setproctitle.setthreadtitle(self._name) threading.Thread.__init__ = new_thread_init diff --git a/searx/version.py b/searx/version.py index daada6020..ac42834d9 100644 --- a/searx/version.py +++ b/searx/version.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring,missing-module-docstring,missing-class-docstring +# pylint: disable=,missing-module-docstring,missing-class-docstring import re import os diff --git a/searx/webapp.py b/searx/webapp.py index e29b7f442..6fcf7c464 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint -# pylint: disable=missing-function-docstring """WebbApp """ |