Commit Graph

8467 Commits

Author SHA1 Message Date
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
Calum Lind 21b5a15e5d Fix and cleanup outgoing interface code
There was a misunderstand about outgoing interface setting in libtorrent
and instead of being able to take both IP and adapater names, it only
accepts adapter names and errors with an IP address, which was the
default of '0.0.0.0' in code.

This fixes the code to not accept IP address and use empty string if it
is given one.

Also includes a bit of code cleanup.
2018-06-02 21:32:56 +01:00
Unknown edd431a304 Make Tox Multi-OS Friendly 2018-06-02 11:29:51 +01:00
Calum Lind d642fa3989 Fix files to pass new Flake8 checkers
Some new flake8 checkers were added so fix these new warnings and
any issues uncovered.

Use add-trailing-comma to fix missing trailing commas. It does not
format it as well as I would like however it was fast to change and
helps with git changes in future.

Removed pylint from tox due to large number of warnings.
2018-06-01 23:41:17 +01:00
Calum Lind bae1647e99 Add Pipenv Pipfile for development
Switching to Pipenv will speed up developement. See the docs for
details on using Pipenv.

 - Added more flake8 checks.
 - Added `detox` for running tests in parallel locally.
2018-06-01 23:41:17 +01:00
Calum Lind decd7aca71 Update gettext for outgoing interface 2018-06-01 12:57:18 +01:00
Calum Lind 7cc9aaca49 Fix VersionSplit comparison
The tests on Python revealed a bug with comparing dev versions.

Switch to comparing by integers and setting non-dev version to infinity.

There is still an issue with suffix release comparisons beyond single
digits but will leave that for now.
2018-06-01 08:59:24 +01:00
Doadin 196aa48727 [#3171] Add Option To Specify Outgoing Connection Interface 2018-05-21 13:14:15 -04:00
Calum Lind af2972f697 [GTKUI] Update prefs dialog ui file with Glade
Let Glade UI designer remove and make changes to UI file.
2018-05-21 08:30:25 +01:00
Calum Lind d4addeedd6 [UI] Fix non-unique hostlist host_id
Use a sha1 of time.time() can result in identical host_id. This was
evident with Travis tests randomly failing due to host_id collision
returning the wrong host details.

Using uuid4 to generate a random UUID in hex form should fix this issue.
2018-05-20 22:49:08 +01:00
Calum Lind 8439698336 [Tox] Use platform independant toxworkdir instead of PWD
The use of `{env:PWD}` is not available on Windows so switch to
`{toxworkdir}` which is the directory where virtual environments
are created and sub directories for packaging reside.
2018-05-20 08:46:40 +01:00
Calum Lind 7d120690ab [Docs] Fix Sphinx AutoDoc failing with gdk mask operation
The creation of a new mask from two gdk mask is causing a TypeError,
likely related to the mocking of gdk in Sphinx conf.
2018-05-20 08:46:25 +01:00
Calum Lind ee196f5035 [Flake8] Fix import and docstrings issues 2018-05-20 08:45:59 +01:00
Calum Lind ff85c334c7 [Tests] Fix 'Too many open files' by disabling LSD
Instances of libtorrent with Local Service Discovery enabled are leaving
many sockets fd open with every test run and will fail with 'Too many files
open' if ulimit is >=1024.
2018-05-19 21:50:23 +01:00
Calum Lind 0c574f33e1 [Tests] Ensure tear_down deletes rpcserver and core 2018-05-19 21:23:46 +01:00
Calum Lind a7c7309027 Use context manager for open in metafile 2018-05-19 21:03:36 +01:00
Calum Lind de2f998218 [WebUI] Encode HTML entitiies
Ensure that torrent keys that could contain HTML entities are encoded
when displayed in webui.
2018-02-04 22:02:18 +00:00
Calum Lind 4982ba0b98 Cleanup pytest config in tox
Config values are either wrong, unused or default is better.

Disable logging of deluge log output in testing.

Newer versions of pytest now use `pytest` cmd so rename.
2017-12-17 11:55:09 +00:00
Calum Lind f57286fd51 [#3121] Fix the peer-id to be unique
The associated ticket made us aware that the id '-DE2000-' might be
blocked.
2017-12-17 11:55:09 +00:00
Calum Lind 12f7345d0c Use a constant for versions 2017-12-17 11:47:08 +00:00
Calum Lind 4e79ed8124 Fix tox config to install latest pip packages
Trial changed command in latest versions of twisted
2017-12-16 17:39:48 +00:00
Calum Lind 7787aa975f Delay assert in test_torrent for Travis 2017-12-16 17:29:30 +00:00
Calum Lind c13622a1e6 Fix state not loading after async API change 2017-12-16 13:21:47 +00:00
Calum Lind 07a87fa15a [#3129|Console] Fix unable to use connect command from terminal
The parsed_cmd passed to do_command was an argparse Namespace object
which needed no further parsing so use exec_command instead.
2017-11-18 23:46:35 +00:00
Calum Lind 2644169376 [#3126|Core] Restore synchonous add torrent methods for backward compatibilty
The synchonous add torrent method was replaced with async but this
break backward compatibility with 3rd party plugins and clients.

Added a new add_torrent_file_async method for adding single torrent.

Torrent manager has a new add_async method and split up code to prevent
duplication.

Update any use of add_torrent_file to add_torrent_file_async. Future
refactoring could use add_torrent_files instead.
2017-11-18 23:04:38 +00:00
Calum Lind 5988f5f04f Fix flake8 error 2017-11-18 22:14:04 +00:00
Calum Lind 95d826b77c [#3127|Blocklist] Fix importing blocklist with encoded lines
There are some blocklists with encoded names that break upon importing
so decode lines to unicode.

Need to use decode_bytes as not all encoded lines are utf8!
2017-11-05 20:52:51 +00:00
Calum Lind 9bcda41700 [#3075|Console] Fix config handling windows paths
The console config token parser was unable to handle windows paths
starting with 'C:\'.

Remove unneeded windows_checks.
2017-11-05 17:30:47 +00:00
Calum Lind 507c5df984 [#3112|Console] Fix handling hex for setting peer_tos in config
The token parser was converting hex value to int which is not what
should be passed onto libtorrent peer_tos setting.
2017-10-29 22:16:13 +00:00
Calum Lind 0ba87b424c Revert "[#2848|Core] Fix incorrect share ratio in torrent status"
This reverts commit 7b87a93862.

After further discussion in the ticket this change is undesired.

> I wrongly assumed that private trackers will count how many bytes you
> download but they don't, they track how many parts(or chunks?) you
> have, when you announce it. So using total_done is fine, no change
> needed.

> Checking for private flag and using total_wanted_done for public
> enables users to be a bit more selfish. They can start a torrent,
> let it run for a bit then deselect the files they don't want and
> only upload enough to make up for what they wanted to download. This
> means they may upload less than they downloaded, hurting the swarm.
> So I personally don't think this would be a good change.
> Overall my suggestion is to close this as not a bug.
2017-10-29 12:36:15 +00:00