From ce4aaf6cad9c0a57f5f12ef80ec4e1b45bcf87d4 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 10 Mar 2024 15:33:23 +0100 Subject: [mod] comprehensive revision of the searxng_extra/update/ scripts - pylint all scripts - fix some errors reported by pyright - from searx.data import data_dir (Path.open) - fix import from pygments.formatters.html NOTE: none functional changes! Signed-off-by: Markus Heiser --- searxng_extra/update/update_pygments.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'searxng_extra/update/update_pygments.py') diff --git a/searxng_extra/update/update_pygments.py b/searxng_extra/update/update_pygments.py index 69a8ee2db..5d11b28dc 100755 --- a/searxng_extra/update/update_pygments.py +++ b/searxng_extra/update/update_pygments.py @@ -1,14 +1,16 @@ #!/usr/bin/env python +# lint: pylint # SPDX-License-Identifier: AGPL-3.0-or-later """Update pygments style Call this script after each upgrade of pygments """ +# pylint: disable=too-few-public-methods from pathlib import Path import pygments -from pygments.formatters import HtmlFormatter +from pygments.formatters.html import HtmlFormatter from searx import searx_dir @@ -41,7 +43,7 @@ END_DARK_THEME = """ """ -class Formatter(HtmlFormatter): +class Formatter(HtmlFormatter): # pylint: disable=missing-class-docstring @property def _pre_style(self): return 'line-height: 100%;' @@ -67,5 +69,5 @@ def generat_css(light_style, dark_style) -> str: if __name__ == '__main__': print("update: %s" % LESS_FILE) - with open(LESS_FILE, 'w') as f: + with LESS_FILE.open('w', encoding='utf8') as f: f.write(generat_css('default', 'lightbulb')) -- cgit v1.2.3