Commit Graph

21 Commits

Author SHA1 Message Date
Chocobo1
ae7cc7445b Enable strict type checking for Pyright
Doc: https://github.com/microsoft/pyright/blob/main/docs/configuration.md#type-check-diagnostics-settings

PR #23634.
2025-12-22 12:14:38 +08:00
Chocobo1
94ef038f3a Improve abstraction of search plugin
To make intentions clear and avoid misuse.
Now it should be possible to inherit `Engine` class and create an usable subclass from it.

PR #23232.
2025-09-07 17:50:39 +08:00
Chocobo1
2aee875642 Enforce SOCKS proxy setting in search engine plugins
Previously it require each plugin to import helpers.py to setup SOCKS proxy.
Now it is enforced by default for all plugins.
Also added a function for plugins to ignore/restore the socket to
default state.

PR #22554.
2025-04-19 07:11:50 +08:00
Chocobo1
871438f557 Bump search engine components version
The master branch should have version larger than stable branch.
https://github.com/qbittorrent/qBittorrent/pull/21539/files#r1790078486

PR #21542.
2024-10-10 16:30:45 +08:00
Chocobo1
69a829dfb0 Clean up search engine
Notable changes:
1. Prevent excessive engine module imports.
2. Replace trivial usage of `join()`.
3. Keep the output text sorted whenever possible.
4. Close handles properly.
5. Print error to stderr, not stdout.
6. Report search job exit code.
7. Print exception message to stderr if exception was thrown when
   running a search job.
8. Utilize XML library to build XML data
   And use 2 spaces as indentation.

PR #21098.
2024-07-22 16:51:57 +08:00
Chocobo1
d71086e400 Add type annotations
A few code are revised because the type checker (mypy) doesn't allow
changing types on a variable.

PR #20935.
2024-06-17 13:18:32 +08:00
Chocobo1
b1175b60e1 Use proper comparison for None
PR #20762.
2024-04-29 12:47:27 +08:00
milahu
4ac586c896 Lazy load search plugins
PR #20553.
2024-04-24 22:15:22 +03:00
Chocobo1
4ef8f39f23 Use python isolate mode
This (more or less) avoids user's environment variables tampering the
search process.
And also remove usages of `eval()` and `exec()`.

PR #18995.
2023-05-21 14:04:44 +08:00
Chocobo1
d52c6230e9 Fix defects found by lgtm.com 2018-11-03 00:34:25 +08:00
Chocobo1
bbe76231cf Reformat python code to be compliant with PEP8
The following command is used:
`pycodestyle --ignore=E265,E722 --max-line-length=100 <py files>`
2018-09-18 12:33:09 +08:00
jan.karberg
d534973650 search only when category is supported by plugin Closes #8053 2017-12-17 13:04:37 +01:00
ngosang
32c813eece [search engine] Fix cpu_count in old Python versions 2015-07-20 19:12:58 +02:00
ngosang
d7ffabe7ca [search engine] Fix novaprinter.py version number 2015-06-23 09:46:19 +02:00
dartraiden
8ac83cfd42 Fixed typos, spelling correction 2015-06-14 10:55:46 +03:00
DoumanAsh
920aefddde [search engine] Final enhancements. 2015-06-11 07:52:27 +03:00
DoumanAsh
bef8106d0f [search engine] Nova2 multiprocessing 2015-06-11 07:45:53 +03:00
sledgehammer999
1bf7e3cafa Move the searchengine code back into its original place. 2015-02-23 03:44:29 +02:00
Vladimir Golovnev (Glassez)
ff9a281b72 Change project directory structure.
Change project directory structure according to application structure.
Change 'nox' configuration option to something more meaningful 'nogui'.
Rename 'Icons' folder to 'icons' (similar to other folders).
Partially add 'nowebui' option support.
Remove QConf project file.
2015-02-05 19:10:26 +03:00
Bruno Barbieri
f288162e99 Fix search inconsistency between Python versions
Closes #2012
2014-10-13 07:42:06 -03:00
Christophe Dumez
f4c2fdd2fd Search: Initial support for Python 3.x 2011-09-11 20:22:54 +03:00