Commit Graph

8446 Commits

Author SHA1 Message Date
Metaa 456e720b75 [WebUI] Constrain large icons to fit sidebar properly
Add CSS background position and size for sidebar icons.

Without this change tracker icons that are too big, render as too big.
This restrains them to fit into the sidebar list item.
2018-09-06 18:57:28 +01:00
Calum Lind ae9bbdbae7 [Core] Add tests for pausing and resuming torrents 2018-08-10 17:48:53 +01:00
Deepak 585ea88f1f [Core] Fix torrent pause/resume logic
If the torrent_id argument received in the pause or resume methods is not a string, the methods execute with the un-parsed input and then with parsed input on a second call. A key error exception is thrown from the first call, and the second call succeeds.
2018-08-10 17:09:50 +01:00
Deepak f94f58918e [Core] Remove libtorrent deprecated resolve_countries
Libtorrent 1.1 no longer supports this so remove it.
2018-08-10 09:56:38 +01:00
Calum Lind 3fc97672de Fix the docs run failing on Travis
Likely that the deprecation warning from cryptography is causing the
setup.py sphinx build command to return an error so the tox/travis job
is marked as failing. Changing to calling the sphinx-build command
directly solves this.

Also updated the sphinx config for built-in napoleon and faster builds
using jobs option.
2018-07-28 10:26:02 +01:00
Chase Sterling e8e649a030 Prevent time formatting crash when seconds were floats
Update docstring and tests for ftime supporting floats

Truncate rather than round floats in ftime
2018-07-27 07:26:37 +01:00
Calum Lind 1e6c02ae83 [Core] Fix get_eta returning float instead of int
Floor division will return a float if a float is provided so ensure int
when dividing by the stop_ratio. All other status values from libtorrent
are ints.

Added tests.
2018-07-16 16:25:08 +01:00
DjLegolas b2e1f850d8 [WebUI] Handle missing gettext.js file
Removed the creation code of `gettext.js` and now it will just mock
the `_` function by being the identity function.
2018-07-16 16:22:42 +01:00
Calum Lind 8bfa2cacbb Cleanup docstrings in httpdownloader
Use the new google docstring style.
Keep line length to 80 chars and new lines for mult-line func params.
2018-07-15 11:58:16 +01:00
DjLegolas c7e61f8c34 [HTTPDownloader] Refactor HTTPDownloader to Agent
As of twisted 16.7.0, `twisted.web.client.HTTPDownloader` have been
marked as deprecated.
This caused the tests results to show many lines of warnings about it.
This refactor uses `twisted.web.client.Agent`, as suggested by Twisted.
2018-07-15 11:58:16 +01:00
DjLegolas 089c667d7f [AutoAdd] Add WebUI interface 2018-07-12 19:18:08 +01:00
Calum Lind ebb955934d [Console] Fix unhandled error in preferences
If the value is None then the len cannot be calculated so set to blank
string.
2018-07-12 16:46:35 +01:00
Calum Lind c7567ddee4 [Console] Fix unhandled error in torrentactions
Fix calls to core pause and resume using the singular methods with a
list of torrent ids.

Fix and simplify the handling of errors from core.
2018-07-10 16:46:49 +01:00
Calum Lind c655da38c8 [Console] Ensure time string is unicode 2018-07-10 16:46:49 +01:00
Calum Lind 4c0be7ddd4 [Common] Fix missing return for de/encode methods 2018-07-10 16:46:49 +01:00
Calum Lind 38961d4253 [Console] Fix char encoding in preferences 2018-07-10 16:46:49 +01:00
Calum Lind 6e81a11d8d [Console] Fix and refactor window.add_str code
- Replace usage of single char variable.
- Use max function to prevent negate lengths when calculating trim.
- Remove usage of insstr as the addstr exception when writing offscreen is
excpected behaviour so needs caught and passed. This fixes a similar
error with insstr.
2018-07-10 16:46:49 +01:00
Calum Lind be02be75be [GTKUI|Py3] Ensure backward compatible pickle dumps 2018-07-01 20:34:42 +01:00
Calum Lind 7b5ed9f1d6 [Py3] Fix dict iter item deletion 2018-07-01 10:08:16 +01:00
Calum Lind e626f9fece [Win32] Fix missing certs for HTTPS requests
The following error occured on Windows when switching to using HTTPS
url with Twisted Agent:
```
<class 'twisted.web._newclient.ResponseNeverReceived'>: [<twisted.python.failure.Failure OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]>
```

The fix is to install certifi and provide the path to the trust store as
env var for OpenSSL to pick up.

Also includes a simplication of the core test_listen_port code.
2018-06-29 10:29:30 +01:00
Calum Lind 3fab799dbf Fix flake8 trailing comma 2018-06-27 16:41:21 +01:00
Calum Lind 24c100d9b7 [Py3] Decode new_release version to unicode string 2018-06-27 16:41:21 +01:00
Calum Lind 9bc2f62c80 [Py3] Fix tranfer header first byte check
The index of a byte in Python 3 will return an integer so use slice for
compatibility with 2/3
2018-06-27 16:41:21 +01:00
Calum Lind 1fa2de066f Fix mistakes in test code 2018-06-27 16:41:21 +01:00
Calum Lind ae0b070c1b [Py3] Fix sort and sorted issues
In Python 3 there is only the key functions available and cmp functions
should be removed, especially for speed.
2018-06-27 16:41:21 +01:00
Calum Lind c3a2c67b98 [Py3] A large set of fixes for tests to pass under Python 3
The usual minor fixes for unicode/bytes for library calls.

The minimum Twisted version is now 16 for Python 3 support so remove old
code and start replacing deprecated methods.

Raised the minimum TLS version to 1.2 for the web server.
2018-06-27 16:41:21 +01:00
Calum Lind 200e8f552b Add dependecy on six 2018-06-27 16:41:21 +01:00
Calum Lind 4247013446 [bencode] Fix errors with unicode dict keys or values 2018-06-26 12:42:26 +01:00
Calum Lind 6ec32a85e4 [GTKUI] Fix AttributeError with clipboard strip 2018-06-26 12:42:26 +01:00
Calum Lind 633c56f54e [Core] Add prefetch metadata methods for magnets 2018-06-26 12:42:26 +01:00
Calum Lind 23171ad205 Fix missing _metainfo attribute in TorrentInfo 2018-06-26 12:42:26 +01:00
Calum Lind 277576268c [Py2to3] Replace deprecated base64.(de|en)codestring
* In Py3 base64.encodestring is deprecated so rather than use the
   Py3 only encodebytes instead use b64encode. The other advantage is
   that with issue a consistent TypeError is raised that we can catch.
2018-06-26 12:42:26 +01:00
Calum Lind 74aa0db956 Manually compress png with zopflipng 2018-06-21 14:50:19 +01:00
Calum Lind fe42fb2c31 Recreate and compress icons
Will the change to deluge.svg all the icons need recreated. I also
updated the script to losslessly compress the png files with zopflipng.

hicolor theme changes:
 - Added a 512px icon.
 - Added a deluge-panel.png for systray theming.

Added extra webui icons and updated index.html to use them
correctly.
2018-06-21 14:50:19 +01:00
Calum Lind 4973538d6c Tweak the deluge icon size
At smaller sizes the padding makes the icon too small so only keep the
padding at the bottom and let the point of the droplet extend to top of
canvas.
2018-06-21 14:40:52 +01:00
DjLegolas de1e7c27df [#2867][WebUI] Fix Daemon connection problem
Trying to connect to daemon B while still connected to A will cause
the torrents from A to be shown after connecting to B.
Therefor, checking if connected to any daemon before connecting to B.
2018-06-19 09:39:15 +01:00
Calum Lind 587b9afefe [GTKUI] Fix count of torrents in dialog title 2018-06-19 09:34:46 +01:00
Calum Lind 63b25311f5 [UI] Refactor TorrentInfo and add functionality
Make a clearer distinction about torrent metainfo and metadata and allow
passing these to TorrentInfo.
2018-06-19 09:12:57 +01:00
Calum Lind d45dbfe064 [Core] Add is_session_paused method 2018-06-18 20:06:35 +01:00
Calum Lind 3176b877a4 [Core] Add methods pause_torrents & resume_torrents 2018-06-18 20:06:35 +01:00
sam-xif 18541bce86 Fixed a minor grammatical error in the deluge console command documentation 2018-06-18 20:04:22 +01:00
Kirill Romanov bebe08d92b Add X-GNOME-UsesNotifications
Due to Gnome Guidelines https://wiki.gnome.org/Initiatives/GnomeGoals/NotificationSource
2018-06-18 20:00:49 +01:00
DjLegolas 0dbbb51cff [Core] Fix strip None in set_listen_on
Trying to strip None will not work so combined the check as a condition
for the strip.
2018-06-18 19:56:16 +01:00
Calum Lind bd78bd2643 [#3001|GTK] Fix sorting to default to Added column
The sort function used when no column is being sorted was a lambda
function that had no effect and had a bug. Instead default to sort by
the added date.

Also fixed the name column sort to lowercase and uppercase properly.
2018-06-17 08:34:17 +01:00
DjLegolas 7a3b164060 [WebUi] Fixed Install Plugin window creation 2018-06-12 03:50:30 +03:00
Calum Lind e7eb26416e [Core] Fix strip None in outgoing_interface
Trying to strip None will not work so do this after checks for
falseness.
2018-06-09 22:18:38 +01:00
Calum Lind b2b7703081 [AutoAdd] Fix the logging for a failed added torrent
Add a missing arg to the failed added torrent callback and update the
logging text based on magnet or not.
2018-06-09 22:18:38 +01:00
Calum Lind cbdde7bba5 [Appveyor] Make win32 build files available as zip
It can be useful to have the build folder available so zip it up for
download as an artifact.

Although the 7z has an exclude for the installer exe it doesn't seem to
be working.
2018-06-05 23:21:12 +01:00
Unknown 4fd51a4ef9 Skip Failing Tests On Windows 2018-06-02 22:09:50 +01:00
Unknown 333c81c1d7 Add Appveyor support for Windows builds 2018-06-02 22:09:50 +01:00