summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
...
* [lt] Upgraded libtorrent minimum version to 1.2DjLegolas2022-02-13
| | | | | As part of the preparations for libtorrent 2.0, we should stop supporting lower versions of it.
* [Core] Enable file_completed_alert handling.Chase Sterling2022-02-13
| | | | | | | | | Without adding file_progress to the alert mask, the TorrentFileCompletedEvent would never fire. Closes: https://dev.deluge-torrent.org/ticket/3421 Closes: https://github.com/deluge-torrent/deluge/pull/370 Ref: https://libtorrent.org/upgrade_to_1.2-ref.html
* [GTK] Fix adding daemon accountsCalum Lind2022-02-12
| | | | | | | | | | | Errors were raised when trying to add a new daemon account due to dialog being destroyed before looking up widget values. Fixed by saving widget values before destroying. Refactored code to be simplified with a named tuple for the account details instead of separate attributes and modernized the preferences dialog creation and account saving by replacing callback functions.
* [Console] Fix incorrect test for when a host is onlinebendikro2022-02-12
| | | | | | | | | | | | The tests in connectionmanager for when a host is online are broken and always considers a host as online. When an error occurs in e.g. in _on_connect_fail, report_message() in PopupsHandler expects the message to be string, not a Twisted Failure. Fix by checking if message is string and log a warning before converting to string. Closes: https://github.com/deluge-torrent/deluge/pull/277
* [plugins] Add dev links script for WindowsDjLegolas2022-02-12
| | | | | | | | | | | Currently, when creating a new plugin, a script for creating the dev links was created for *NIX systems only. Now, it will detect the system type and create the correct script: Windows: create_dev_links.bat *NIX: create_dev_links.sh Closes: https://github.com/deluge-torrent/deluge/pull/257
* [Config] Fix callLater func missing argsDjLegolas2022-02-12
| | | | | | | | | | | | In a6840296, a refactor to the `config` class was introduced. The change included an internal wrapper for `reactor.callLater`, for lazy import, but didn't wrap it correctly and therefor, no args/kwargs were passed to the wrapped method. Furthermore, the exception was silently ignored. This caused changes to be ignored and not applied, including `preferencesmanager._on_config_value_change` callback. Closes: https://github.com/deluge-torrent/deluge/pull/372
* [Tests] Make file priority test more consistent.Chase Sterling2022-02-12
| | | | | | | | | | | Our file priority test was using time.sleep to wait until libtorrent had processed the command. This was sometimes not long enough and the test would fail. On libtorrent 2.0.3+ there is an alert when the process has finished, switch to waiting for that in this test to make the test more consistent. On older libtorrent, make the delay a bit longer, to try to make the test more consistent there as well. Closes: https://github.com/deluge-torrent/deluge/pull/373
* [Core] Document all exported core methods with type hintsChase Sterling2022-02-11
| | | | | | | | | | | | | | | Standardize docstrings in core.py to google standard. Remove type hints in docstrings in favor of the ones in method signatures. Use function signature type hints in autodoc generated docs. Change Deferred type hints to strings. Older versions of twisted (<21.7) don't support generic Deferred type hinting, this prevents crashes on those versions. Closes: https://github.com/deluge-torrent/deluge/pull/359
* [GtkUI] Fix ETA being copied to neighboring empty cellsChase Sterling2022-02-11
| | | | | | | | | An optimization that avoided re-rendering treeview cells sometimes went wrong, and rendered a value from the wrong row when moving the mouse around the torrentview window. Closes: https://dev.deluge-torrent.org/ticket/3500 Closes: https://github.com/deluge-torrent/deluge/pull/371
* [CI] Fix package build errorCalum Lind2022-02-09
| | | | | | | Not all dependencies were installed due to adding a comment in the middle of the pip install command Also need to specify Twisted extras to match requirement.txt
* [Packaging] Fix pyinstaller to find installed deluge package dataCalum Lind2022-02-09
| | | | | Instead of relying on the source code paths use the pip installed Deluge package data.
* [CI] Use working dir to shorten commandsCalum Lind2022-02-09
| | | | Making the workflows more readable
* [CI] Replace custom twisted package with pre-releaseCalum Lind2022-02-09
| | | | | | Fix for Windows simulate error has been merged and in 22.2.0rc Ref: https://github.com/twisted/twisted/pull/1679
* [GTK] Workaround crash on Windows with ico or gif iconsCalum Lind2022-02-09
| | | | | | | | | | A problem with GdkPixbuf loaders on Windows causes a hard crash when attempting to load ico or gif tracker icons. Added a workaround by skipping these icon types until a more permanent solution is found. Ref: https://dev.deluge-torrent.org/ticket/3501
* [GTK] Refactor out get_pixbuf_at_sizeCalum Lind2022-02-09
| | | | | The functionality of get_pixbuf and get_pixbuf_at_size is almost identical so reuse get_pixbuf with an optional size arg.
* [Build] Fix entry point build errorsCalum Lind2022-02-06
| | | | | | | | | | Fixed a mistake settings entry points in setup.py. Replaced with simpler logic since gui_scripts only affect Windows. Fixed entry point changes affecting pyinstaller build Corrected deluge-web.exe to have no console instead of deluge-web-debug.exe
* [Core] Convert inlineCallbacks to maybe_coroutineChase Sterling2022-02-06
| | | | | | | | | | Make logging functions synchronous. They were not calling any async functions, and wrapping them in maybe_coroutine caused reactor to be imported before gtkui could install the gtk reactor. Closes: https://github.com/deluge-torrent/deluge/pull/353
* [Decorators] Add maybe_coroutine decoratorChase Sterling2022-02-06
| | | | | | | | | | | | - Clean up callback hell by making more code inline - Use async/await syntax as it has more modern niceties than inlineCallbacks - Also gets us closer if we want to transition to asyncio in the future - `await` is usable in places that `yield` is not. e.g. `return await thething` `func(await thething, 'otherparam')` - IDEs know async semantics of async/await syntax to help more than with `inlineCallbacks` - `maybe_coroutine` decorator has nice property (over `ensureDeferred`) that when used in a chain of other coroutines, they won't be wrapped in deferreds on each level, and so traceback will show each `await` call leading to the error. - All async functions wrapped in `maybe_coroutine` are 100% backwards compatible with a regular Deferred returning function. Whether called from a coroutine or not. - Use Deferred type hints as strings since older versions of twisted (<21.7) don't support generic Deferred type hinting.
* [Plugins] Fix namespace deprecation warningCalum Lind2022-02-06
| | | | | The plugin namespace was changed from deluge.plugins to deluge_ in 535b13b5f1b7b7 but deprecation warning was not updated.
* [Config] Add mask_funcs to help mask passwords in logsCalum Lind2022-02-06
| | | | | | | | | | | Added a new Config class parameter `log_mask_funcs` to enable config instances hide sensitive information that would normally appear in config debug logs. Added mask password function to hostlist to replace passwords with '*'s in logs. Closes: https://github.com/deluge-torrent/deluge/pull/363
* [Windows] Use gui_scripts for web and daemon entry pointsCalum Lind2022-02-06
| | | | | | | | | | | Hide the console cmd popup when using deluge-web.exe ordeluged.exe on Windows. By using gui_scripts it will disable stdin and stdout for these executable but there are `-debug` versions available if that is required. Ref: https://packaging.python.org/en/latest/specifications/entry-points/#use-for-scripts
* [Console] Add the torrent label to info commandkingamajick2022-02-06
| | | | | Closes: https://dev.deluge-torrent.org/ticket/1556 Closes: https://github.com/deluge-torrent/deluge/pull/356
* Revert "[Core] Document all exported core methods with type hints"Calum Lind2022-02-05
| | | | | | | | | | | | | | | Typing is broken with older versions of Twisted e.g. with v21.2 deluge/deluge/core/core.py", line 404, in Core ) -> defer.Deferred[str]: TypeError: 'type' object is not subscriptable Also it might not be compatible with Python 3.6 or 3.7 with use of certain types such as dict rather than Dict This reverts commit 4096cdfdfe4fc7e42746cedd868bd7d8fea99f23. Ref: https://twistedmatrix.com/trac/ticket/9816
* [Core] Document all exported core methods with type hintsChase Sterling2022-02-05
| | | | | | | | | Standardize docstrings in core.py to google standard. Remove type hints in docstrings in favor of the ones in method signatures. Use function signature type hints in autodoc generated docs. Closes: https://github.com/deluge-torrent/deluge/pull/359
* [Config] Replace custom property decoratorCalum Lind2022-02-05
|
* [Config] Refactor config classCalum Lind2022-02-05
| | | | | | | | | | | | | * Refactored duplication with setting config key and logging * Simplified lazy importing reactor for callLater. This lazy importing is required for testing and also prevents Gtk UI lockup if reactor imported in Config. * Fixed saving config to file when setting a key that doesn't exist yet. This was due to returning early in the set_item method. * Added a `default` arg to set_item to prevent saving to file when only setting a default value for a key in init. * Moved casting value to existing key type from set_item to dedicated function.
* [Log] Fix crash logging to Windows protected folderdoadin2022-02-03
| | | | | | | | | | | | | | | Have the log dir be a protected windows folder and Deluge crashes. Windows blocks access to the dir and so it fails. It will fail trying to write to any protected folder. Should probably just pass on the error maybe and maybe log to stdout and log a message saying access was blocked or something. .\deluge-debug -L debug -l E:\Documents\deluge.log ... Failed to execute script 'deluge-debug-script' due to unhandled exception! Closes: https://dev.deluge-torrent.org/ticket/3502 Closes: https://github.com/deluge-torrent/deluge/pull/358
* Remove legacy PY2 sys.argv unicode handlingChase Sterling2022-02-03
| | | | | | | | | | | Fixed crash when sys.stdout was None When using pythonw on windows, sys.stdout and stdin are None. We had a legacy unicode_argv handler that was crashing in this instance. Just removed that, since sys.argv is always unicode on python 3 to fix the crash. Closes: https://github.com/deluge-torrent/deluge/pull/361
* [Tests] Transition tests to pure pytestChase Sterling2022-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert all the twisted.trial tests to pytest_twisted. Also move off of unittest.TestCase as well. Seems there were several tests which weren't actually testing what they should, and also some code that wasn't doing what the broken test said it should. Goals: Remove twisted.trial tests Move to pytest fixtures, rather than many classess and subclasses with setup and teardown functions Move away from self.assertX to assert style tests FIx broken tests Going forward I think these should be the goals when adding/modifying tests: * Don't use BaseTest or set_up tear_down methods any more. Fixtures should be used either in the test module/class, or make/improve the ones available in conftest.py * For sure don't use unittest or twisted.trial, they mess up the pytest stuff. * Prefer pytest_twisted.ensureDeferred with an async function over inlineCallbacks. - I think the async function syntax is nicer, and it helps catch silly mistakes, e.g. await None is invalid, but yield None isn't, so if some function returns an unexpected thing we try to await on, it will be caught earlier. (I struggled debugging a test for quite a while, then caught it immediately when switching to the new syntax) - Once the maybe_coroutine PR goes in, using the async syntax can also improve tracebacks when debugging tests. Things that should probably be cleaned up going forward: * Remove BaseTestCase * Remove the subclasses like DaemonBase in favor of new fixtures. * I think there are some other utility subclasses that could be removed too * Perhaps use parameterization in the ui_entry tests, rather that the weird combination of subclasses and the set_var fixture I mixed in. * Convert some of the callback stuff to pytest_twisted.ensureDeferred tests, just for nicer readability Details relating to pytest fixtures conftest.py in root dir: * https://github.com/pytest-dev/pytest/issues/5822#issuecomment-697331920 * https://docs.pytest.org/en/latest/deprecations.html#pytest-plugins-in-non-top-level-conftest-files Closes: https://github.com/deluge-torrent/deluge/pull/354
* [CI] Fix checkout action missing fetch depthCalum Lind2022-02-01
| | | | Need a fetch depth greater than 1 to find latest tag.
* [CI] Fix run manual packaging workflow for tagCalum Lind2022-01-30
| | | | | To allow packaging any commit the workflow needs to separately checkout the source code from the current code containing the packaging scripts.
* [CI] Allow manual specifying tag in packaging workflowCalum Lind2022-01-30
|
* [Gtk] Fixed edit torrents dialogs windows close issuesDjLegolas2022-01-30
| | | | | | | | | | Up until now, when closing the Add or Edit dialogs, of the `Edit Torrents`, using the top-right X button or using the Escape key, they were being destroyed without any way to reopening them, and it was breaking the `Edit Torrents` window itself. Now both dialogs have the right handlers for handing the closing process without breaking anything. Closes: deluge-torrent/deluge#324 Closes: https://dev.deluge-torrent.org/ticket/2434
* [Blocklist] Add frequency unit to interval labelFacundo Acevedo2022-01-30
| | | | | Closes: https://dev.deluge-torrent.org/ticket/3492 Closes: https://github.com/deluge-torrent/deluge/pull/322
* [Docs] Add discord link to readmeChase Sterling2022-01-30
| | | | Closes: https://github.com/deluge-torrent/deluge/pull/350
* [Common] Add is_interface to validate network interfacestbkizle2022-01-30
| | | | | | | | | | | | | | | | | | | | | | Libtorrent now supports interface names instead of just IP address so add new common functions to validate user input. * Added is_interface that will verify if a libtorrent interface of name or IP address. * Added is_interface_name to verify that the name supplied is a valid network interface name in the operating system. On Windows sock.if_nameindex() is only supported on 3.8+ and does not return a uuid (required by libtorrent) so use ifaddr package. Using git commit version for ifaddr due to adapter name decode bug in v0.1.7. On other OSes attempt to use stdlib and fallback to ifaddr if installed otherwiser return True. * Added tests for is_interface & is_interface_name * Updated UIs with change from address to interface * Updated is_ipv6 and is_ipv4 to used inet_pton; now supported on Windows. Ref: https://github.com/pydron/ifaddr/pull/32 Closes: https://github.com/deluge-torrent/deluge/pull/338
* [Tests] fix/enable most ui tests on WindowsChase Sterling2022-01-26
| | | | Closes: https://github.com/deluge-torrent/deluge/pull/348
* [Tests] fix torrentview tests (new default column was added)Chase Sterling2022-01-26
|
* [Tests] Make sure to return exit code still when ending test daemonChase Sterling2022-01-26
| | | | Use a separate Client instance to call test daemon shutdown
* [Tests] Escape backslashes in filename in webserver testChase Sterling2022-01-26
|
* [Tests] Change example files in files tab test to sort the same on linux/windowsChase Sterling2022-01-26
|
* [Tests] Enable more tests that now work on WindowsChase Sterling2022-01-26
|
* [Tests] Shutdown test daemon cleanly using rpc. (needed for Windows)Chase Sterling2022-01-26
| | | | Escape backslashes in config path for test daemon startup.
* [Tests] Make failure message more clear when test daemon doesn't shut down ↵Chase Sterling2022-01-26
| | | | cleanly
* [Tests] Enable unicode path test on WindowsChase Sterling2022-01-26
|
* [Tests] Fix erroneous windows line endings in test state fileChase Sterling2022-01-26
|
* [Tests] Enable metafile test on WindowsChase Sterling2022-01-26
|
* [Tests] Fix maketorrent test on WindowsChase Sterling2022-01-26
|
* Fix crash when logging errors initializing gettextChase Sterling2022-01-26
|
* [Core] Return plugin keys with get_torrents_statusChase Sterling2022-01-26
| | | | | | | | When requesting all keys, get_torrents_status was missing plugin added keys This commit brings the behavior in line with get_torrent_status, and deluge 1.3 Closes: https://dev.deluge-torrent.org/ticket/3357 Closes: https://github.com/deluge-torrent/deluge/pull/347