summaryrefslogtreecommitdiff
path: root/searxng_extra/update/update_pygments.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2024-03-10 15:33:23 +0100
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-03-10 15:56:50 +0100
commitce4aaf6cad9c0a57f5f12ef80ec4e1b45bcf87d4 (patch)
treefe4b88659f1c39e1026e42305119bbd326ca3fc9 /searxng_extra/update/update_pygments.py
parent0ffec440b2d1146d4daf3f63a544aeb635a6e617 (diff)
[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 <markus.heiser@darmarit.de>
Diffstat (limited to 'searxng_extra/update/update_pygments.py')
-rwxr-xr-xsearxng_extra/update/update_pygments.py8
1 files changed, 5 insertions, 3 deletions
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'))