Compare commits

...

2844 Commits

Author SHA1 Message Date
2a945de069 [CI] Fix tests stalling/timing out
GitHub pytest runner stalling with the following error:

    [Errno 2] No such file or directory: '/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/deluge/plugins'

This is related to the editable install of Deluge via pip

    pip install -e .

and the custom resource_filename in deluge.common is the source of the
problem where a DistInfoDistribution returns a different path to
EggInfoDistribution.

Working egg-info install

    >>> pkg_resources.get_distribution('Deluge')
    deluge 2.1.1.dev8 (/home/user/deluge)

    >>> type(pkg_resources.get_distribution('Deluge'))
    <class 'pkg_resources.EggInfoDistribution'>

    >>> pkg_resources.resource_filename('deluge', 'plugins')
    '/home/user/deluge/deluge/plugins'

This can identified by the `deluge.egg-info` directory in source
directory.

Broken dist-info install

    >>> pkg_resources.get_distribution('Deluge')
    deluge 2.1.1.dev8 (/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages)

    >>> type(pkg_resources.get_distribution('Deluge'))
    <class 'pkg_resources.DistInfoDistribution'>

    >>> pkg_resources.resource_filename('deluge', 'plugins')
    '/home/user/deluge/deluge/plugins'

This can be worked around by setting an env var that enables legacy mode
but long-term need to replace the custom resource_filename and replace
usage of pkg_resources.

https://setuptools.pypa.io/en/latest/userguide/development_mode.html#legacy-behavior
https://setuptools.pypa.io/en/latest/pkg_resources.html
2022-12-01 22:39:10 +00:00
d0acd3e06e [CI] Fix installing enchant for github docs workflow
The enchant package was renamed for version 2 to enchant-2 and original
enchant package removed in Ubuntu 22.04 so docs workflow failed

Fixed by using latest package and specifying ubuntu version to avoid
unexpected failures in future.
2022-12-01 13:11:53 +00:00
3565a9a817 [WebUI] Fix TypeError in DelugeWeb constructor
In `twisted 22.10`, a check new for passing the `path` variable as
`bytes` in the `putChild` method.
We were enforcing this on every other place but the `__init__` of
`DelugeWeb` itself.

Ref: https://github.com/twisted/twisted/pull/11718
Closes: https://dev.deluge-torrent.org/ticket/3566
2022-12-01 12:52:00 +00:00
b3d1fd79a8 Update changelog from 2.1.1 release 2022-07-10 14:06:34 +01:00
b64084d248 [Docs] Update changelog and install details 2022-07-08 09:04:57 +01:00
e120536d87 Fix parsing magnet with tracker tiers
Magnets with trackers specified with tr.x param were not being unquoted
so unusable raw tracker string was being set.

Fixed by unquoting tracker and adding test

See-also: https://dev.deluge-torrent.org/ticket/2716
2022-07-08 08:34:29 +01:00
f52cf760e4 Fix missing trackers adding magnets
The changes to remove deprecated lt methods didn't account for magnet
trackers so magnets are missing trackers when added.

Previously the addition of trackers was handled by libtorrent when a url
was passed in add_torrent_params. The url parameter is deprecated so
instead we need to add both the info_hash and trackers.

Trac: https://dev.deluge-torrent.org/ticket/3530
2022-07-05 08:03:33 +01:00
94d790c159 [CI] Bump ifaddr to 0.2.0
With release of ifaddr 0.2.0 no longer need to pin to github commit to
resolve Windows decoding issues.
2022-06-30 21:47:06 +01:00
f78506161d [CI] Fix failing Windows Python 3.10 tests
A recent dependency change caused the tests running on GitHub Actions
under Python 3.10.5 on Windows to fail when starting pytest run:

    ...
    INTERNALERROR>   File "<frozen importlib._bootstrap>", line 123, in acquire
    INTERNALERROR> KeyError: xxxx

The cause seems to have been a newer version of chardet package released
recently.

* Fixed by pinning chardet to v4
* Also pin Windows version to 2019 to match packaging workflow

See-also: https://github.com/deluge-torrent/deluge/actions/runs/2578427588
Issue: https://github.com/chardet/chardet/issues/265
2022-06-29 15:07:23 +01:00
592b05cd87 back to development 2022-06-28 22:11:29 +01:00
6c8f9ce756 Release 2.1.0 2022-06-28 22:07:35 +01:00
19dba297ef [Docs] Fix ReadTheDocs theme rendering issue
Fix rendering issues in ReadTheDocs by specifying latest version of
sphinx-rtd-theme. Normally not an issue to install this latest
dependency from doc/requirement.txt but RTD installs in the env an older
version (<0.5) before running requirements file install
thus sphinx-rtd-theme is not upgraded unless a version is specified.

See-also: https://github.com/readthedocs/sphinx_rtd_theme/issues/1115
2022-06-28 19:45:21 +01:00
cbacaf0545 [Core] Fix typo in AUTH_LEVEL_MAPPING
Closes: https://github.com/deluge-torrent/deluge/pull/387
2022-06-19 19:02:11 +01:00
75db47fc1f Update Changelog entries 2022-06-19 08:30:54 +01:00
f1ec68704d [CD] Cleanup pip cache in Win builds
- Use the more reliable setup-python cache
- Move the pip install to GTK install step for consistency
- Don't update pip to ensure consistent version
2022-06-13 19:37:41 +01:00
ae3fbcca77 [Packaging] Pinned Pyinstaller to v4.10 and readme update
Pin Pyinstaller to latest v4.x until issue of aborting upon missing typelibs for various unbuilt gst-modules can be properly investigated and resolved. Specific error for one of the modules being:

`36738 INFO: Loading module hook 'hook-gi.repository.Gst.py' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\lib\\site-packages\\PyInstaller\\hooks'...
Traceback (most recent call last):
  File "<string>", line 7, in <module>
gi.repository.GLib.GError: g-irepository-error-quark: Typelib file for namespace 'Gst', version '1.0' not found (0)
36870 ERROR: gi repository 'GIRepository 2.0' not found. Please make sure corresponding package is installed.
Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\gi\__init__.py", line 139, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gst not available`

Added `--no-index` to ensure pip doesn't install from Pypi

Closes: https://github.com/deluge-torrent/deluge/pull/386
2022-06-13 19:31:54 +01:00
6a10e8f3cd [Packaging] Bump Win dependencies
* Update Twisted and libtorrent to latest releases
* Update to v3 github actions that now use node 16
2022-06-12 20:05:04 +01:00
b0dba97fec [Web] Accept charset in content-type for json messages
Trac: https://dev.deluge-torrent.org/ticket/3521
Closes: https://github.com/deluge-torrent/deluge/pull/385
2022-06-12 16:08:36 +01:00
d7c520c85e [WebUI] Fixed 'Complete Seen' and 'Completed' sorting
Closes: https://github.com/deluge-torrent/deluge/pull/384
2022-05-17 22:45:37 +01:00
ee3180fd94 [Notifications] Fix UnicodeEncodeError upon non-ascii torrent name
smtplib.SMTP.sendmail expects 'msg' in string of ascii chars or bytes,
where the former gets encoded to bytes through ascii codec, hence
raising said error, but now fixed by encoding to bytes ourself through
utf-8

Closes: https://github.com/deluge-torrent/deluge/pull/383
2022-05-17 22:42:05 +01:00
47e548fdb5 [Core] Refactor prefetch_metadata for more clarity
Just trying to clean up some of the more complicated callback logic.

Notable changes:

* The test was awaiting a DeferredList. By default that will eat
exceptions and just add them to the result list (including test
assertion exceptions.) Added fireOnOneErrback=True to make sure that
wasn't happening.  * Moved the logic for multiple calls to await the
same response into torrentmanager from core, so no matter where the
prefetch is called from it will wait for the original call.
* Implemented the multiple calls with an explicit queue of waiting
callbacks, rather than a callback callback chain.  * Moved to one inline
async function rather than split into a main and callback after alert
function.
* Added some more type hints to the stuff I changed.

Adjusted test since we are using prefetch as an async function now
we have to schedule the alert to come after we start awaiting the
prefetch call.

Closes: https://github.com/deluge-torrent/deluge/pull/368
2022-05-17 22:15:55 +01:00
cd63efd935 [Console] Fix curses.init_pair raise ValueError on Py3.10
Fix ValueError crash for console users with Python 3.10

Trac: https://dev.deluge-torrent.org/ticket/3518
See-also: https://docs.python.org/3/whatsnew/3.10.html#curses
2022-05-01 21:09:41 +01:00
7f0a380576 [Core] Cleanup temp files in add_torrent_url
Temporary torrent files are not deleted by add_torrent_url. Not as big a
problem as with tracker icons pages but should be removed after use.

Fixed by updating the method to use async and a try..finally cleanup
block.

Perhaps could be refactored to not require temporary files and instead
store the downloaded torrent as object for passing to add_torrent_file.

Trac: https://dev.deluge-torrent.org/ticket/3167
2022-05-01 20:38:09 +01:00
68c75ccc05 [TrackerIcons] Cleanup tmp files created by downloading page
Temporary files created while download host html page are no cleaned up
if the download fails.

Fixed by adding a 'finally' step in the callback chain to delete any
created temporary files.

Added tests to ensure the temporary files are deleted, using a fixture
that creates a known filename for the test.

Trac: https://dev.deluge-torrent.org/ticket/3167
2022-05-01 20:35:28 +01:00
96a0825add [TrackerIcon] Use httpdownloader page redirect handling
User reported infinite redirecting when attempting to fetch tracker
icon.

Fixed by allowing httpdownloader and RedirectAgent to handle page
redirects including catching infinite redirects

Trac: https://dev.deluge-torrent.org/ticket/3167
See-also: https://github.com/twisted/twisted/blob/5c24e9/src/twisted/web/client.py#L168
2022-05-01 20:35:28 +01:00
61a83bbd20 [Tests] Remove winreg interface name check
GitHub CI tests on Windows failing for get_windows_interface_name so
remove the fragile tests since not a requirement to be this specific
with testing whether name exists for these methods relying on standard
lib or 3rd-party libs.
2022-05-01 20:32:57 +01:00
bc6611fc0d [AutoAdd] Verify torrent decode and errors cleanly if invalid
Watch folder was disabled in AutoAdd and torrent filename is unchanged
if an invalid torrent was added.

Trac: https://dev.deluge-torrent.org/ticket/3515
Closes: https://github.com/deluge-torrent/deluge/pull/381
2022-05-01 18:34:19 +01:00
970a0ae240 [lint] update black package
Previous version (22.1.0) didn't support `click` version 8.1.0.
Updating to 22.3.0 to resolve.

See: https://github.com/psf/black/issues/2964
Closes: https://github.com/deluge-torrent/deluge/pull/382
2022-05-01 18:31:12 +01:00
5acb57b5af [CI] Use setup-python action pip cache
Replace custom pip cache that didn't work correctly on Windows with
option to use pip cache in setup-python action
2022-03-02 13:08:02 +00:00
7fa0af3446 [Core] Fixed KeyError in sessionproxy after torrent delete
When several torrents are being removed from session, an exception was
being raised in a callback function `on_status` with the `torrent_id` of
one (or more) of the removed torrents.
Now we will catch when the torrent does not exist anymore and print a
debug log about it.

Closes: https://dev.deluge-torrent.org/ticket/3498
Closes: https://github.com/deluge-torrent/deluge/pull/341
2022-03-02 13:00:45 +00:00
a954348567 [CI] Use libtorrent pypi install
Up until now, the linux installation source of libtorrent was launchpad,
because there was no other source, and we wanted a debug version of lt.

With pypi wheel versions now available use lt in the requirements.txt
file.

Closes: https://github.com/deluge-torrent/deluge/pull/364
2022-03-02 12:55:19 +00:00
13be64d355 [CI] Changed tested python version to 3.7 and 3.10
We cannot add python 3.6 because there is no precompiled version of it to used.
Therefor, will be using 3.7 as the minimum version in CI.
In addition, dropped version limits from pytest.
2022-03-02 12:53:29 +00:00
11fe22e4cd [Tests] Remove reference to Twisted Trial
With the move to pytest remove remainings documentation or comments that
refer to Trial.
2022-03-02 12:45:15 +00:00
a683b7e830 [Tests] Skip SNI icon test
The SNI icon test is failing due to seo.com removing their favicon.

A new test to replace it would be needed to check SNI support. Ideally
new tests would not rely on external sites.
2022-03-02 12:18:05 +00:00
b0f80f9654 [Console] Swap j and k key's behavior to fit vim mode
There is a problem in the Deluge's Console UI. This UI supports the j
and k keys as up and down, but for some reason they are inverted. This
commit inverts back the behaviour of j and k in several places.

Resolves: https://dev.deluge-torrent.org/ticket/3483
Closes: https://github.com/deluge-torrent/deluge/pull/377
2022-03-02 11:38:36 +00:00
f9ca3932a8 [GTK] Remove unneeded glade icon activatable False property
This propery cause issue with added extra space in the entries, likely a
minor GTK bug and property being leftover from GTK2 migration. The
default is True and should have no effect since no icon is shown.
2022-03-02 11:29:17 +00:00
5ec5271fdd [GTK] Refactor Connection Manager Add Host dialog
Replace table with grid and use single column for entries.
2022-03-02 11:09:30 +00:00
e15731fcd4 [GTK] Fix obscured port number in Connection Manager Add Host
A visual problem with the port spin button meant that the port number
was not fully visible in the entry field.

The problem is related to icon activatable property value set to False
when default is True. Although no icon is used is creates a left-hand
5px space in the entry which narrows the available text space and the
entry does not expand to account for this.

Fixed by removing primary_icon_activatable and
secondary_icon_activatable properies so that default values of True is
used.
2022-03-02 11:02:26 +00:00
2962f7cd2c [Packaging] Add systemd user services
Files should be installed into /usr/lib/systemd/user/

Unlike the existing service file, this one configures deluge to run as a
desktop session user. The difference between the services files is the
use of multi-user.target in system service which does not exist for user
services so requires default.target.

Including the Slice indicates to the service manager that this is a
background service. This can be used to handle OOM situations, or
prioritising foreground processes. There's no equivalent for system
services.

Refs: https://dev.deluge-torrent.org/ticket/2034
Closes: https://github.com/deluge-torrent/deluge/pull/380
2022-03-02 09:26:23 +00:00
c89a366dfb [Hostlist] Support IPv6 in host lists
socket.gethostbyname does not support IPv6 name resolution, and
getaddrinfo() should be used instead for IPv4/v6 dual stack support.

Closes: https://github.com/deluge-torrent/deluge/pull/376
2022-02-18 23:05:12 +00:00
5f8acabb81 [Console] Fix torrent details status error
The torrent status num_peers and num_seeds was replaced for session
status keys by accident as part of replacing deprecated session keys
so revert those changes

Ref: 2bd095e5bf
2022-02-17 20:30:05 +00:00
055a84bb15 [Core] Fix Twisted fromCoroutine AttrError
Users with older versions of Twisted <= 21.2 were encoutering the
following error:

    File "/home/calum/projects/deluge/deluge/decorators.py", line 191, in activate
      d = defer.Deferred.fromCoroutine(self.coro)

    builtins.AttributeError: type object 'Deferred' has no attribute 'fromCoroutine'

Fixed by falling back to ensureDeferred since fromCoroutine was
introduced in Twisted 21.2 as a saner name for handling of coroutines.

Ref: https://twistedmatrix.com/trac/ticket/9825
2022-02-16 16:20:54 +00:00
03938839e0 [Docs] Add permanent discord invite link
Default discord invites expire after 7 days so replace with non-expiring
invite
2022-02-15 15:30:08 +00:00
8ff4683780 Automatically refresh and expire the torrent status cache.
Stop at ratio was not working when no clients were connected, because
it was using a cached version of the torrent status, and never calling
for a refresh. When a client connected, it called for the refresh and
started working properly.

Closes: https://dev.deluge-torrent.org/ticket/3497
Closes: https://github.com/deluge-torrent/deluge/pull/369
2022-02-15 15:14:40 +00:00
62a4052178 [Docs] Remove custom mock to fix autodoc typing errors
If a libtorrent return type was specified e.g.

   def get_lt_status(self) -> 'lt.torrent_status'

Even as a string autodoc_typehints module would raise and error:

    Handler <function process_docstring at 0x7f6c16c8ec10> for event 'autodoc-process-docstring' threw an exception (exception: getattr(): attribute name must be string)

This was a result of using a custom mock in Sphinx autodoc config and
this Mock object name or qualname returns an object instead of str.

Testing with putting modules in autodoc_mock_imports again showed no
issues so removing custom mock

Ref: https://github.com/tox-dev/sphinx-autodoc-typehints/issues/220
2022-02-15 11:49:54 +00:00
8ece036770 [WebUI] Move HTML entity encoding to client
We should not be mangling the torrent data in the JSON API since this
can have unintended consquences with names and filepaths that can be
edited. If we escape those symbols in the JSON API then the data no
longer matches that stored by core. Therefore shift the encoding to the
client and consider dealing separetely with these entities when the user
first adds a torrent.

* Created a modified htmlEncode in Deluge Formatter based on extjs
method that also encodes single quotes.
* Removed renderers in ListViews since only templates specified via tpl
are used and any render attribute specified was a no-op.
* Removed old buggy escapeHtml

Resolves: https://dev.deluge-torrent.org/ticket/3459
Ref: https://docs.sencha.com/extjs/6.5.3/modern/src/String.js.html#Ext.String-method-htmlEncode
Ref: https://docs.sencha.com/extjs/3.4.0/source/Format.html#Ext-util-Format-method-htmlEncode
2022-02-14 18:44:19 +00:00
a5503c0c60 [WebUI] Fix encoding HTML entities for torrent attributes
Ensure all torrent attributes that might contain malicious HTML entities
are encoded.

By allowing HTML entities to be rendered it enable malicious torrent
files to perform XSS attacks.

Resolves: https://dev.deluge-torrent.org/ticket/3459
2022-02-14 18:43:20 +00:00
f754882498 [GTK] Increase connection mgr default height
Could not see more than one host when connection manager opens so need to
scroll or resize window

Increased default height to now show three hosts when first opens

Closes: https://dev.deluge-torrent.org/ticket/3431
2022-02-13 14:45:29 +00:00
191549074c [GTK] Fix ui logic/bug of checked move_completed
if move_completed is checked/True, options should be updated, not the
other way round

The path was updated the first time the move_completed option is selected
and then ignored on further updated to the path.

Fixed by checking instead if the path has changed.

Closes: https://github.com/deluge-torrent/deluge/pull/374
2022-02-13 13:55:54 +00:00
2ec6e10c8e [Lint] Update linter version and fix issues
Notable changes:

* Prettier >=2.3 with more consistent js assignments
* Black now formats docstrings
* Added isort to list of autoformaters
* Update flake8 config for v4

Ref: https://prettier.io/blog/2021/05/09/2.3.0.html
2022-02-13 13:38:27 +00:00
2bd095e5bf [Core] Stopped using libtorrent deprecated functions
As part of the process of adding support to LT 2.0, we should stop using
all deprecated function, as some (if not all) were removed.
For this process, we should use the LT 1.2 upgrade (guide)[1].

The change includes:
* stop using file entries directly
* start using the torrent handle's set/unset flags
* stop using url key in add_torrent_params (for magnet)
* stop accessing resume_data from save_resume_data_alert
* stop using deprecated session status keys in UI

[1] https://libtorrent.org/upgrade_to_1.2-ref.html
Closes: https://dev.deluge-torrent.org/ticket/3499
Closes: https://github.com/deluge-torrent/deluge/pull/342
2022-02-13 11:36:04 +00:00
513d5f06e5 [lt] Upgraded libtorrent minimum version to 1.2
As part of the preparations for libtorrent 2.0, we should stop supporting
lower versions of it.
2022-02-13 11:32:30 +00:00
a1da2058bc [Core] Enable file_completed_alert handling.
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
2022-02-13 11:25:45 +00:00
af26fdfb37 [GTK] Fix adding daemon accounts
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.
2022-02-12 23:40:00 +00:00
66b5a2fc40 [Console] Fix incorrect test for when a host is online
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
2022-02-12 19:03:52 +00:00
29f0789223 [plugins] Add dev links script for Windows
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
2022-02-12 17:59:37 +00:00
f8f997a6eb [Config] Fix callLater func missing args
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
2022-02-12 17:14:19 +00:00
374997a8d7 [Tests] Make file priority test more consistent.
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
2022-02-12 17:12:05 +00:00
dabb505376 [Core] Document all exported core methods with type hints
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
2022-02-11 08:48:58 +00:00
aa74261d50 [GtkUI] Fix ETA being copied to neighboring empty cells
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
2022-02-11 08:31:03 +00:00
b29829f571 [CI] Fix package build error
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
2022-02-09 20:39:48 +00:00
d559f67ab9 [Packaging] Fix pyinstaller to find installed deluge package data
Instead of relying on the source code paths use the pip installed Deluge
package data.
2022-02-09 19:53:17 +00:00
d4f8775f44 [CI] Use working dir to shorten commands
Making the workflows more readable
2022-02-09 19:53:17 +00:00
50647ab3a5 [CI] Replace custom twisted package with pre-release
Fix for Windows simulate error has been merged and in 22.2.0rc

Ref: https://github.com/twisted/twisted/pull/1679
2022-02-09 19:53:17 +00:00
90744dc2e6 [GTK] Workaround crash on Windows with ico or gif icons
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
2022-02-09 19:53:17 +00:00
24a3987c3a [GTK] Refactor out get_pixbuf_at_size
The functionality of get_pixbuf and get_pixbuf_at_size is almost
identical so reuse get_pixbuf with an optional size arg.
2022-02-09 19:53:15 +00:00
e87236514d [Build] Fix entry point build errors
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
2022-02-06 21:02:43 +00:00
2fb41341c9 [Core] Convert inlineCallbacks to maybe_coroutine
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
2022-02-06 16:45:37 +00:00
b76f2c0f20 [Decorators] Add maybe_coroutine decorator
- 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.
2022-02-06 16:42:13 +00:00
bd88f78af6 [Plugins] Fix namespace deprecation warning
The plugin namespace was changed from deluge.plugins to deluge_
in 535b13b5f1 but deprecation warning was not updated.
2022-02-06 16:27:47 +00:00
bf97bec994 [Config] Add mask_funcs to help mask passwords in logs
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
2022-02-06 16:15:34 +00:00
a27a77f8c1 [Windows] Use gui_scripts for web and daemon entry points
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
2022-02-06 15:15:25 +00:00
e8fd07e5e3 [Console] Add the torrent label to info command
Closes: https://dev.deluge-torrent.org/ticket/1556
Closes: https://github.com/deluge-torrent/deluge/pull/356
2022-02-06 15:11:29 +00:00
1089adb844 Revert "[Core] Document all exported core methods with type hints"
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 4096cdfdfe.

Ref: https://twistedmatrix.com/trac/ticket/9816
2022-02-05 17:50:54 +00:00
4096cdfdfe [Core] Document all exported core methods with type hints
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
2022-02-05 17:23:50 +00:00
099077fe20 [Config] Replace custom property decorator 2022-02-05 16:13:10 +00:00
a684029602 [Config] Refactor config class
* 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.
2022-02-05 16:01:22 +00:00
8b0c8392b6 [Log] Fix crash logging to Windows protected folder
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
2022-02-03 22:46:33 +00:00
222aeed2f3 Remove legacy PY2 sys.argv unicode handling
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
2022-02-03 22:38:37 +00:00
ece31cf3cf [Tests] Transition tests to pure pytest
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
2022-02-03 22:29:32 +00:00
0fbb3882f2 [CI] Fix checkout action missing fetch depth
Need a fetch depth greater than 1 to find latest tag.
2022-02-01 06:45:10 +00:00
73394f1fc5 [CI] Fix run manual packaging workflow for tag
To allow packaging any commit the workflow needs to separately checkout
the source code from the current code containing the packaging scripts.
2022-01-30 17:42:15 +00:00
9b043cf2c1 [CI] Allow manual specifying tag in packaging workflow 2022-01-30 17:03:33 +00:00
1cd005c272 [Gtk] Fixed edit torrents dialogs windows close issues
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
2022-01-30 16:26:44 +00:00
4107bf8f25 [Blocklist] Add frequency unit to interval label
Closes: https://dev.deluge-torrent.org/ticket/3492
Closes: https://github.com/deluge-torrent/deluge/pull/322
2022-01-30 16:21:39 +00:00
49bedda956 [Docs] Add discord link to readme
Closes: https://github.com/deluge-torrent/deluge/pull/350
2022-01-30 16:17:05 +00:00
540d557cb2 [Common] Add is_interface to validate network interfaces
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
2022-01-30 16:13:27 +00:00
d8acadb085 [Tests] fix/enable most ui tests on Windows
Closes: https://github.com/deluge-torrent/deluge/pull/348
2022-01-26 18:44:54 +00:00
932c3c123f [Tests] fix torrentview tests (new default column was added) 2022-01-26 18:44:48 +00:00
986375fa86 [Tests] Make sure to return exit code still when ending test daemon
Use a separate Client instance to call test daemon shutdown
2022-01-26 18:44:48 +00:00
4497c9bbcc [Tests] Escape backslashes in filename in webserver test 2022-01-26 18:44:47 +00:00
23f7c4dd6e [Tests] Change example files in files tab test to sort the same on linux/windows 2022-01-26 18:44:47 +00:00
a41f950d09 [Tests] Enable more tests that now work on Windows 2022-01-26 18:44:47 +00:00
209716f7cd [Tests] Shutdown test daemon cleanly using rpc. (needed for Windows)
Escape backslashes in config path for test daemon startup.
2022-01-26 18:44:47 +00:00
3dca30343f [Tests] Make failure message more clear when test daemon doesn't shut down cleanly 2022-01-26 18:44:47 +00:00
71cde7c05e [Tests] Enable unicode path test on Windows 2022-01-26 18:44:47 +00:00
dbf3495c4e [Tests] Fix erroneous windows line endings in test state file 2022-01-26 18:44:47 +00:00
fffc6ab7d7 [Tests] Enable metafile test on Windows 2022-01-26 18:44:46 +00:00
a73e01f89f [Tests] Fix maketorrent test on Windows 2022-01-26 18:44:46 +00:00
87ec04af16 Fix crash when logging errors initializing gettext 2022-01-26 18:44:46 +00:00
d8746a8852 [Core] Return plugin keys with get_torrents_status
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
2022-01-26 18:40:16 +00:00
7c9a542006 [GTK] Hide account password length in log
We should not let anyone know the account's password length,
as it can help to crack it.
Instead, we will print a constant amount (10) of asterisks.

Closes: https://github.com/deluge-torrent/deluge/pull/346
2022-01-23 16:39:24 +00:00
e75ef7e31f [Packaging] Simplify PyInstaller spec file
This makes the process of editing the file much more pleasant and
removes duplicate code.

Fixed collecting twisted package which brings both build speed
improvements but also decreases package size, as it stops PyInstaller
from bundling tests (actually, some tests might even execute during
import and break build if they're designed to throw!) used by
PyInstaller

Closes: https://github.com/deluge-torrent/deluge/pull/342
2022-01-23 16:04:33 +00:00
4f87612a0f [Common] Replace distro.linux_distribution function
As of distro (1.6.0)[1], this function is marked as deprecated.
Instead, we will use the underlying functions directly, as explained in the (docs)[2].

[1] https://github.com/python-distro/distro/issues/263#issuecomment-927098357
[2] https://distro.readthedocs.io/en/latest/#distro.linux_distribution

Closes: https://github.com/deluge-torrent/deluge/pull/345
2022-01-22 12:06:38 +00:00
2cad0f46f2 [CI] Add pygame to windows package build/spec file
pygame is required by notification plugin for sounds
2022-01-21 13:12:23 +00:00
5931d0cc0b [CI] Fix package job not running with PR label
The job would only run when the PR was labeled since
`github.event.label.name` only available when `labeled` type event
recieved
2022-01-21 12:53:54 +00:00
9d4ca77ef7 [CI] Cleanup packaging dependencies 2022-01-21 12:53:54 +00:00
ad27a278fd [GTK UI]About Dialog Update year 2022-01-21 12:53:54 +00:00
4f17fc41a5 [Packaging] Disable GTK CSD by default on Windows
CirnoT reported how they felt that GTK3 is not reliable on Windows.
Seeing some weird issues where clicking Deluge icon on taskbar does
bring window to front but doing so again does not minimize it as one
would expect. By using GTK_CSD=0 this would reduce these problems.

> If changed to 0, this disables the default use of client-side
decorations on GTK windows, thus making the window manager responsible
for drawing the decorations of windows that do not have a custom
titlebar widget.

This can be overridden by a global env var.

Ref: https://github.com/deluge-torrent/deluge/pull/331#issuecomment-1012311605
Ref: https://docs.gtk.org/gtk3/running.html
2022-01-21 12:53:54 +00:00
15d2d27a53 [CI] Specify github windows server version
To ensure builds don't break avoid using windows-latest

Refs: https://github.com/actions/virtual-environments/issues/4856
2022-01-21 10:16:15 +00:00
65e5010e7f [Core] Add pygeoip dependency support
Provide support for the pure-python pygeoip as compiled GeoIP is not
always available.

Ref: https://dev.deluge-torrent.org/ticket/3271
2022-01-21 10:02:18 +00:00
9b97c74025 [GTK] Added a torrent menu option for magnet copy
this will lined-up with the WebUI, which already have this option.
in addition, it will not open the Add Torrent URL dialog after copied,
which happens automatically when there is torrent/magnet URIs in the clipboard.

Closes: deluge-torrent/deluge#328
Closes: https://dev.deluge-torrent.org/ticket/3489
2022-01-21 09:41:59 +00:00
d62362d6ae [CI] Improve packaging workflow
Include arch in artifacts so they can be downloaded separately

Added libtorrent 2.0 to matrix since users often request latest
libtorrent.

Renamed workflow to make it's purpose clearer
2022-01-20 15:31:15 +00:00
1a9affbbac [Build] Add missing setuptools to requirements
Although likely to already be installed this is a runtime requirement
for Deluge
2022-01-20 14:49:53 +00:00
2316088f5c [CI] Remove PR specified branch
This branch name is the head name not the base name so prevents the job
running unless submitted has branch name that matches
2022-01-14 13:07:22 +00:00
d14310078b [CI] Fix typo in CD 2022-01-13 22:46:02 +00:00
1696c69776 [CI] Fix windows build tag exclude
Fixes error:

    you may only define one of `tags` and `tags-ignore` for a single event
2022-01-13 22:36:56 +00:00
5f96ea4217 [CI] Restrict creating Windows installer
Limit the running of this job by only running on develop, tags and pull
requests that have label 'windows'
2022-01-13 22:23:25 +00:00
491a20cb08 Fix Execute and Extractor Plugins
Include missing twisted requirements resulting in errors:

    ModuleNotFoundError: No module named 'twisted.internet.utils'
2022-01-13 22:23:25 +00:00
490fb898af Build With Patched Twisted Build
Fixes TypeError in simulate call

Ref: https://twistedmatrix.com/trac/ticket/9660
Ref: https://github.com/twisted/twisted/pull/1679
2022-01-13 22:23:25 +00:00
560a52a443 Fix OpenSSL For Libtorrent
libtorrent + pyinstaller requires a lib(ssl/crypto)-1_1.dll and
lib(ssl/crypto)-1_1-x64.dll odd quirk but solveable by just having
two copies. Maybe later compiling our own libtorrent.
2022-01-13 22:23:25 +00:00
b9a208f18f Update Windows Packaging
* Rename instances of win32 to generic win or the appropriate bit where applicable
* Remove files used in GTK2
* Add spec file for use with PyInstaller
* Remove Python bbfreeze Script
* Add Github Action To Build Releases
* Add Modified script to make files used by NSIS
* Update Readme

Closes: https://github.com/deluge-torrent/deluge/pull/331
2022-01-13 22:23:08 +00:00
6da4c4bf66 Restore PY2 for 3rd-party plugins
Restored PY2 to avoid breaking compatibility with plugins that imported
PY2 from common.

Ref: https://bitbucket.org/bendikro/deluge-yarss-plugin/issues/67/deluge-210-removed-all-py2-support
2022-01-13 19:48:53 +00:00
d2390cd247 [i18n] Fix load_libintl error
Fixed libintl being undefined if no library was found
2022-01-12 20:19:56 +00:00
c3cd7f5e5c [Plugins] Fix missing description with metadata 2.1
Changes to the metadata specs in v2.1 meant that Description field
might appear in the body of the message instead of as a header key.

Replaced custom parser with email parser (as outlined in the document
using compat32 policy) to simplify extracting the message header and
body.

Ref: https://dev.deluge-torrent.org/ticket/3476
Ref: https://packaging.python.org/en/latest/specifications/core-metadata/#description
2022-01-12 20:12:02 +00:00
2351d65844 [Plugins] Fix and refactor get_plugin_info method
A new metadata version 2.1 has optional Description that is causing an
TypeError when looking up the key in plugin_info since clients are
assuming values are always strings but the default is None.

Fixed TypeError by ensuring that the info dict has a default empty
string set for all keys.

Separated the parsing of the pkg_info into static method to make it
easier to test.

Changed the missing plugin info to only set the Name and Version as
'not available' since all other fields are optional.

Ref: https://dev.deluge-torrent.org/ticket/3476
Ref: https://packaging.python.org/en/latest/specifications/core-metadata/#description
2022-01-12 19:19:39 +00:00
e50927f575 [GTK] Fix unable to prefetch magnet in thinclient
A UnicodeDecodeError is raised in transfer module when attempting to
prefetch a magnet.

This is result of passing a Python dict containing text bytes and raw
bytes that cannot be decoded as utf-8 in rencode when recieving the
message. This could be handled in rencode by returning raw bytes if
decoding fails (perhaps with a strict mode?) however better to follow
convention of encoding raw bytes in base64 in API calls.

Fixed by retaining bencoding and encoding with base64 when sending
result.

Resolves: https://github.com/deluge-torrent/deluge/pull/334
2022-01-08 19:43:40 +00:00
79b7e6093f Fix is_url and is_infohash error with None value
Encountered a TypeError with None value passed to is_infohash function
so add guard clause.
2022-01-08 13:56:05 +00:00
4f0c786649 [AutoAdd] Fixed error dialog not being shown on error
This happened due to the removal of `exception_msg` attribute, which was
removed with the changes to `RPC` protocol in commit 9b812a4.
Now we access the message using the `message` attribute.

Closes: deluge-torrent/deluge#332
Closes: https://dev.deluge-torrent.org/ticket/3069
2022-01-06 10:06:03 +00:00
fca08cf583 [TrackerIcon] Fixed old-large icon removal
After downloading and resizing the new icon, we try to remove the downloaded
file, which is larger, but it fails because it tries to do so when the file
is still open, and therefor locked.
On close of the UI, we got `PermissionError` exceptions for each new icon.
2022-01-06 10:04:22 +00:00
517b2c653b [TrackerIcon] Fixed parse error on UTF-8 sites with non-english chars
When parsing the site's page in search for the FAVICON, the page gets opens.
The default file encoding in dependent on the running OS, and might not
be `UTF-8` on Windows.
Therefor, some trackers might not get their icon downloaded at all because of
an error:
`UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 2158: character maps to <undefined>`.
This fix adds a detection of file encoding using the optional `chardet` dependency, and also a test.

Closes: deluge-torrent/deluge#333
Closes: https://dev.deluge-torrent.org/ticket/3479
2022-01-06 10:04:19 +00:00
44dcbee5f4 [GTK] Make combobox_window expand to width
This makes the download location entry textbox resizable which is very
useful for entering long paths.

Closes: deluge-torrent/deluge#295
2022-01-03 22:17:00 +00:00
efc9f465f0 [WebUI] Define foreground and background colors
There is no promise that default bg is white and default fg is black so
define in deluge.css

Ref: https://dev.deluge-torrent.org/ticket/3435
Closes: deluge-torrent/deluge#330
2022-01-03 22:07:11 +00:00
5321d24f2a [GTK] Use GtkSpinner when testing open port
this switched was motivated by an error which happened each time the check
port button was clicked, and was caused by the GtkImage when loading the
loading.gif file on Windows:

    cannot register existing type 'GdkPixbufGdipAnim'

Closes: deluge-torrent/deluge#329
2022-01-03 22:02:53 +00:00
f30f7f4629 [UI] Add Keywords property to desktop file
Deluge fails to appear in some app launchers (GNOME app search, Albert launcher) when searching for just "torrent" or other keywords, rather than "bittorrent". This is due to the lack of a Keywords header/property in its desktop entry file. Adding this line should solve the issue.

I don't know if the underscore "_" is actually necessary for this line, I just copied the appearance of the lines above it when inserting. Please check that this comes out without the underscore in the final file after processing.

Closes: deluge-torrent/deluge#323
2021-12-29 21:54:00 +00:00
ec0bcc11f5 Upgrade codebase with pyupgrade (>=py3.6)
Added pyupgrade utility with manual stage to pre-commit and run on all
files.

Ref: https://github.com/asottile/pyupgrade
Closes: deluge-torrent/deluge#326
2021-12-29 21:51:07 +00:00
16895b4a49 [Docs] Fix spinx-contrib-spelling build error
CI docs build was failing with the following error when using latest
sphinx-contrib-spelling 7.3.1

    error: option -j not recognized

Fixed by pinning to previous version.

GitHub-ref: https://github.com/sphinx-contrib/spelling/issues/142
2021-12-29 21:43:03 +00:00
f3784723ae [UI] Add SVG support for tracker icons
SVG files are supported by all browsers so need to support it as well,
according to https://www.w3schools.com/html/html_favicon.asp

Also, it appears as SEO.com site, which was dropped because of a cert issue,
has only SVG icon. So enabled it again.

Lastly, from python 3.2, `os.path.samefile` is supported on Windows.
So Windows will now test TrackerIcons as well.
2021-12-29 21:38:55 +00:00
7f5857296e [CI] Upgrade Windows python version to 3.8 (same as linux) 2021-12-29 20:06:10 +02:00
897955f0a1 Remove all Python 2 support
* Removed all __future__ imports from code
* Removed all six dependencies
* Removed all future_builtins imports
* Removed all Python 2 related code

Closes: deluge-torrent/deluge#325
2021-12-28 19:26:38 +00:00
ff309ea4c5 [GtkUI] Fix ETA sorting to match WebUI
The sort for Ascending was putting longest eta first but seems more
intuitive that the smallest time to wait should be first. The WebUI
in previous commit swapped this behaviour so updating GtkUI.
2021-12-22 23:17:14 +00:00
3b11613cc7 [WebUI] Fixed ETA sorting in WebUI
When sorting the according to ETA values, all torrents with infinite value were being
considered a lower value (INF -> 12 -> 32) instead of largest (12 -> 32 -> INF).
This is due to the fact that the INF symbol is placed to lower value (<= 0).
Now the lower values are being treated as the largest JS number when sorting.

Closes: https://dev.deluge-torrent.org/ticket/3413
Closes: https://github.com/deluge-torrent/deluge/pull/321
2021-12-22 22:04:24 +00:00
a2d0cb7141 [Console] Removed Core dependency from Console UI
UIs should not depend on core directly, so removing the dependency in ConsoleUI.
This is done by adding a hard-coded variable.

Closes https://dev.deluge-torrent.org/ticket/3491
Closes: https://github.com/deluge-torrent/deluge/pull/320
2021-12-22 21:53:17 +00:00
88ffd1b843 [Servers] Moved check_ssl_keys and generate_ssl_keys to crypto_utils.py
With this change, we drop a core dependency from the UI. This will help group together
all related functionality in one place, i.e. all security related functions.

Also updated testssl.sh version to 3.0.6 (SECURITY_TEST)

Closes: deluge-torrent/deluge#288
2021-12-20 22:09:08 +00:00
6a10e57f7e back to development 2021-12-15 19:43:39 +00:00
612e0061ed Release 2.0.5 2021-12-15 18:48:16 +00:00
2eee7453cb Update Changelog 2021-12-15 18:45:25 +00:00
58cc278145 [i18n] Fix set_language error with empty lang string
The Web server config for language was set to an empty string which
resulted in an warning logged by i18n set_language.

* Changed set_language to ignore empty language string and do nothing.
We don't want to override the user's system language unless actually
specified by the user.
* Improved the translation warning message.
2021-12-15 18:35:50 +00:00
a03e649da6 [Build] Fix WebUI js minifying error
Some users encoutered a bug where WebUI in browser show a white screen,
which indicates a problem with loading javascript files. The problem was
due to closure minifying failure leaving a zero-length deluge-all.js
file which broke the usual fallback mechanism to debug files.

* Fixed usage of ES6 const declaration breaking closure minifying.
* Cleanup minified files upon errors so no zero length files left
* Replaced broken and unmaintained slimit with rjsmin.
* Fixed unable to set dev or debug query args due to request args
requiring bytes.
2021-12-15 09:37:55 +00:00
073bbbc09d [Packaging] Start replacing deprecated distutils
Working towards removing distutils

> direct usage of distutils is now actively discouraged,
with setuptools being the preferred replacement.

Ref: https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html
2021-12-13 23:57:09 +00:00
bca0aa3532 [CI] Replace pypi deluge-libtorrent with libtorrent
* Remove certifi since included in requirements.txt
* Remove old travis config
2021-12-12 21:49:31 +00:00
cb588d0205 [Docs] Update release checklist page 2021-12-12 21:43:54 +00:00
2b20e9689b back to development 2021-12-12 19:35:54 +00:00
65f7cf0d83 Release 2.0.4 2021-12-12 18:57:38 +00:00
5ac8f4c81b Update changelog 2021-12-12 18:55:41 +00:00
c33c9082d9 [Docs] Add Flatpak install links 2021-12-12 18:39:41 +00:00
62ae0f5ef6 [Docs] Update install guide
Rewrite install instructions to include more details on Deluge 2.0
install.

* Added other Linux distros
* Added stable PPA details
* Added link to forum for Windows and macOS community packages

Co-authored-by: Sergio M <sergio@example.com>
Co-authored-by: Ofry Linkovsky <15746116+OfryL@users.noreply.github.com>
Closes: deluge-torrent/deluge#296
Closes: deluge-torrent/deluge#310
2021-12-12 18:27:05 +00:00
24aa48187e [Docs] Replace recommonmark with MyST parser
We used recommonmark so that we can use markdown in sphinx but it is
buggy and now so switch to better supported MyST-parser.

* Fixed incorrect heading warnings in markdown.
* Added sphinx toctree to markdown using directive as required by MyST.
* Upgraded Sphinx to 4.3

Ref: https://myst-parser.readthedocs.io
2021-12-12 18:16:21 +00:00
342cca4367 [GTKUI] Open tracker edit with double click
Closes #2434
Closes: deluge-torrent/deluge#253
2021-11-26 07:29:34 +00:00
9194092d7b [GTKUI] Support using the Ayatana fork of indicators.
As this fork is maintained in Debian, and as of Impish/21.10 is the supported
variant in Ubuntu as well.

Closes: deluge-torrent/deluge#317
2021-11-24 19:49:49 +00:00
5f6f65a065 [GTKUI] Add "Last Transfer" column
Closes: deluge-torrent/deluge#255
2021-11-23 20:45:09 +00:00
967537a409 [GTK3UI] Allow escape key to close Create Torrent dialog 2021-11-23 20:07:44 +00:00
f74163489c [Packaging] Fix gtk3 glade path in MANIFEST
Missed path update when moving from gtk2 to gtk3
2021-11-23 20:07:33 +00:00
7a110bd60f [Plugins] Fix allow enabling any plugin Python version
Properly fix allow enabling any plugin Python version, first attempted
in previous commit 3433a91

Closes: deluge-torrent/deluge#316
2021-11-08 19:27:24 +00:00
d56636426e [GTKUI] Added detection of torrent URL on GTK UI focus
In case deluge GTK gets focus with a new torrent URL on the clipboard,
the "Add Torrent from URL" dialog will pop up automatically

Closes: deluge-torrent/deluge#306
2021-10-03 19:34:09 +01:00
de4fbd2e82 [Core] Workaround torrent file_progress lt 2.0 error
Workaround lt 2.0 python bindings error when calling a torrent handle
file_progress:

```
Boost.Python.ArgumentError: Python argument types in
    torrent_handle.file_progress(torrent_handle)
did not match C++ signature:
    file_progress(libtorrent::torrent_handle {lvalue}, libtorrent:🎏:bitfield_flag<unsigned char, libtorrent::file_progress_flags_tag, void> flags=0)
```

Should be fixed in 2.0.5 release: https://github.com/arvidn/libtorrent/commit/3feba04e6d
2021-10-03 18:53:31 +01:00
9c3982d4ff [GTKUI] Fix piecesbar crashing when enabled
When enabled in preferences the piecesbar was crashing the application.

This was narrowed down to an issue with text_font property and there was a
suggestion that the PangoFontDescription should be freed after getting
the result from get_style_context.

Fixed by creating a copy of the PangoFontDescription

Refs:

 * https://trac.wxwidgets.org/ticket/15697#comment:1
2021-10-03 17:20:22 +01:00
88fc21e993 [Stats] Fix cairo error and failing tests
Fixed the Stats GTKUI test not updated to the new GTK3 dir layout.

Fixed pygobject cairo ImageSurface error:

    AttributeError: 'gi.repository.cairo' object has no attribute 'ImageSurface'

The documentation seems to suggest that using `import cairo` is the correct
usage and this fixed the issue, along with adding suggested gi.require_foreign
call.

References:

https://pygobject.readthedocs.io/en/latest/guide/cairo_integration.html
2021-10-03 14:22:11 +01:00
54674576db [UI] Remove num_blocks_cache_hits usage for stats
Removed in libtorrent v2: https://github.com/arvidn/libtorrent/commit/569d4
2021-10-03 14:19:40 +01:00
89189adb24 [Core] Stop using removed disk.num_blocks_cache_hits stat
Removed in libtorrent v2.0.0:
569d47c391
2021-10-03 14:19:17 +01:00
a5a7da4a1a [Core] Use external_address in external_ip alert handler
Unit tests are segfaulting and this is a result of a subsequent call to
pop_alert creating a dangling pointer to alert.message method.

Replace alert.message call with correct external_address property that
doesn't require any parsing and wonder trigger segfault to expired
pointer.

https://github.com/arvidn/libtorrent/issues/6437
2021-10-03 14:16:57 +01:00
1e6cc03946 [Lint] Fix spelling mistakes
A quick fix of some of the mistakes caught by codespell.
Updated readme with new IRC server

Useful to add it as part of linting checks.
2021-09-21 21:43:53 +01:00
d8526ba653 [UI] Add magnet icons for copy and add actions
Added new magnet icons with a consistent naming scheme
Run script to update all icons

Co-authored-by: Matias Wilkman <matias.wilkman@gmail.com>
2021-09-21 20:38:08 +01:00
c38f913948 [WebUI] Add menu option to copy magnet URI 2021-09-21 20:35:24 +01:00
0659fe4641 [Core] Export torrent get_magnet_uri method
Returns a generated magnet uri from torrent info
2021-09-21 20:27:38 +01:00
10501db63d [i18n] Update translation PO files from Launchpad 2021-09-14 22:02:56 +01:00
2a312159b9 [GTKUI] Fix unhandled error with empty clipboard
If the primary clipboard was empty the fallback resulted in an unhandled
error due to missing arguments.

Fixed by using SELECTION_PRIMARY as fallback clipboard
2021-09-14 21:56:03 +01:00
cb75192df4 [CI] Add core dump capture to GH job
Add further debugging to trace segfaults with lt 1.2
2021-09-10 19:06:21 +01:00
588f600ba2 [#3310|Core] Change logging invalid session status key to debug
Users were complaining about logs being flooded with `Session status key not valid`
which was a result of the Stats plugin using the wrong status keys.

Fixed by changing to debug log level since not useful in warning level
if spamming.
2021-08-29 16:07:53 +01:00
ea609cd3e0 [#3310|Stats] Fix constant session status key warnings
Fixed logs flooded with:

    [WARNING ][deluge.core.core              :655 ] Session status key not valid: num_connections
    [WARNING ][deluge.core.core              :655 ] Session status key not valid: dht_cache_nodes
2021-08-29 16:05:36 +01:00
4b6c7d01b2 [#3478|Core] Fix loading magnet with resume_data and no metadata
Since libtorrent 1.2.10 magnets save resume_data even with metadata not
yet downloaded. Unfortunately when using the deprecated
add_torrent_params key resume_data results in an error  "missing
info-hash from URI"

The problem is due to lt session requiring an info_hash in
add_torrent_params but resume_data does not set or override this key and
resume_data overrides the add_torrent_params.url with an empty string.

The workaround is to specify the info_hash in add_torrent_params. We
require sha1_hash object or bytes and use of bytearray to maintain
python2 compatability.

https://dev.deluge-torrent.org/ticket/3478
2021-08-29 15:58:48 +01:00
b89b2c45b1 [Console] Fix using windows-curses on Windows
The console tests are still failing on Windows due to an issue where the
sys args are not being correctly replaced in the tests so the pytest
args are being passed to console.
2021-08-01 08:48:27 +01:00
e38f1173cf [Notifications] Fix email KeyError with status name
Fix user reported error:

    Notification failure using email:
    [Failure instance: Traceback: <class 'KeyError'>: 'name'

This was due to using empty dict used with get_status where a list of
keys is now required or the all_keys parameter is used.

Fixes: #3303
2021-08-01 08:43:37 +01:00
e1e0999de6 [Tests] Fix skipping torrent test for libtorrent >= 1.2
Test is still failing with libtorrent 2 so also skip.
2021-08-01 08:35:17 +01:00
5c9378ac5e [Tests] Fix incorrent twisted defer import
With the release Twisted 21.7.0 there was an import error running the
tests due to defer incorrectly imported via twisted.internet.tasks module.
2021-07-31 22:08:23 +01:00
f075f391cb [CI] Add catchsegv to get a backtrace for segfaults
Encountering random libtorrent segfault with GitHub action so add
catchsegv when running tests to get more information.
2021-07-31 22:08:23 +01:00
8fb25f71f3 [Install] Update and fix python optional requirements
* Added required dependency setuptools to install_requires
* Remove optional dependency ipaddress from install_requires
* Created extras_require in setup.py. The optional dependencies should
not be included in install_requires so that users can either install
forked dependencies or remove problematic ones. Updated documentation to
detail how to install these optional dependencies.
* Fixed README badge

Refs:
 * https://dev.deluge-torrent.org/ticket/3470
 * https://dev.deluge-torrent.org/ticket/3282
 * https://dev.deluge-torrent.org/ticket/3353
2021-07-31 22:08:23 +01:00
a3332079db [GTKUI] Remove deprecated GTK attributes 2021-07-25 17:42:05 +01:00
0d6eec7a33 [i18n] Refactor loading libintl library
Handle different names for libintl library on MacOS and Windows with
fallback.
2021-07-25 16:47:14 +01:00
f16afc59ba Ignore TypeError with custom Twisted logging
The modification of Python logging _findCaller args in Python 3.8 raises
TypeError in our custom Twisted Logger with Twisted <= 19 versions.

The actual issue for the custom logger was fixed in 18.9 so added a
version check to avoid usage.

Refs:
 - https://twistedmatrix.com/trac/ticket/7927
 - 6b894744e4
2021-07-25 13:28:18 +01:00
e5388048a9 [CI/CD] Add github actions to replace Travis
Due to new limitations for open-source projects on Travis we are
switching to GitHub actions.

* Notes about system site-packages

We had many problems with accessing system python packages on Travis for
libtorrent and GTK and the problems are harder on Github since there is
no more access. For now copying the python libtorrent binary into the
deluge source is the workaround. There is a pip package that could be
used in future.

Fixed failing tests with libtorrent 1.2 which required a non-zero length
file in torrent and workarounds for async alert delay.
2021-07-25 13:27:26 +01:00
5374d237a7 [AutoAdd|3295] Correctly fix auto-adding magnets
Properly fix adding magnets, first attempted in previous commit 2e466101fc

add_torrent_magnet does not return a deferred so wrap in maybeDeferred.

Fixed broken test due to new deluge website icon
2021-07-24 11:25:25 +01:00
2e466101fc [AutoAdd] Fix magnet missing applied labels
The autoadd function does not apply labels to torrents that are added via magnet files.
Those magnet files are also renamed ".Magnet.Invalid".

Here are two threads discussing the issue, which still exists.

    https://forum.deluge-torrent.org/viewtopic.php?t=55539
    https://dev.deluge-torrent.org/ticket/3295

Here is what Deluged.log shows when the problem occurs:

21:51:38 [ERROR   ][deluge_autoadd.core           :333 ] Cannot Autoadd magnet: /Torrents/TorrentFiles/FileName.magnet: Torrent already in session (e1e0f33b656cb74532dcddc04f2ec52771ef1c26).
21:56:38 [ERROR   ][deluge_autoadd.core           :333 ] Cannot Autoadd magnet: /Torrents/TorrentFiles/FileName2.magnet: Torrent already in session (ef839d84d113cc35719b6fd616a4d8e220de7d32).

After looking at the code, what appears to be happening is the magnet link is added, but then a second scan of the folder occurs. Since the magnet file was never renamed, it will attempt to add it again, error out, then rename the file "magnet.invalid".

The only difference between the torrents working properly and magnets having the issue is the two lines I copy-pasted into the magnet IF statement. This should resolve the issue.
2021-04-17 17:24:58 +01:00
8676a0d2a0 [Core] Improve on_alert_tracker_error for lt >= 1.2
libtorrent 1.2 added endpoint struct to each tracker, to prevent false
updates we will need to verify that at least one endpoint to the errored
tracker is working.  if there is at least one working, it will not set
the tracker status to
error and set it to `Announce OK`. otherwise, it will use the error
message from the alert.

Refs: https://dev.deluge-torrent.org/ticket/3384
2021-04-17 16:55:54 +01:00
3ec23ad96b [#3388|WebUI] Fix md5sums in torrent files breaking file listing
Torrents containing md5sum optional hashes are not being decoded and so
causes errors in the json_api when the TorrentInfo is returned:

    Object of type bytes is not JSON serializable

Fixed by removing all optional hashes from the paths returned from
TorrentInfo and only including the required path keys. The optional
hashes are unused by Deluge so simplify by removing.

Fixed Windows path issue in TorrentInfo by ensuring conversion to posix paths.

Refs:

http://wiki.bitcomet.com/inside_bitcomet
http://wiki.depthstrike.com/index.php/P2P:Protocol:Specifications:Optional_Hashes
https://wiki.theory.org/index.php/BitTorrentSpecification
2021-03-24 10:26:08 +00:00
dcd3918f36 [WebUI] Add test for torrent files containing md5sums
Some torrent files built with py3createtorrent fail to produce a
file listing in the WebUI when uploading them.
This made it impossible to add such files.
Specifically this is caused by the additional metadata when using
py3createtorrent with the `--md5` flag.
2021-03-24 10:26:08 +00:00
08c7f1960f [CI/CD] Fix Tox SSL error in Windows Travis job
The tox sdist-make step failed with SSL: CERTIFICATE_VERIFY_FAILED so
fix by install certifi to ensure updated SSL certificates are available.
2021-03-24 10:25:30 +00:00
8a4ec493c0 [CI/CD] Add Travis windows build
* Added APPDATA to tox passenv so it is available to common module.
* Fixed windows path issue in httpdownloader tests
* Skipped torrentmanager test due to the following error from loading a
Linux pickled state file with a different line ending.
    ModuleNotFoundError: No module named 'deluge.core.torrentmanager\r'
* Removed appveyor build
2021-02-23 10:41:46 +00:00
4d970754a4 [#3440] Fix httpdownloader reencoding torrent file downloads
Torrent downloads from rutracker responds with the header:

    Content-Type: application/x-bittorrent; charset=Windows-1251

The problem is that httpdownloader was using the charset to re-encode
the downloaded file, corrupting the binary torrent file download.

Fixed by only re-encoding text content types, since it is very rare
that non-text content types would actually have a non-utf8 codeset and
if there is a requirement we would need to determine it on a type by
type basis.
2021-02-20 21:18:32 +00:00
f331b6c754 [GTKUI] Fix torrentdetails tab bar position not saving
The GTKUI tests were failing and the saved config for the tab bar
position was not being restored.

Fixed by moving the setting of notebook.tabs_pos to TorrentDetail init.

Replaced more deprecated methods that were showing up in tests.
2021-02-20 17:29:36 +00:00
1022448e4f [#3441|GTKUI] Add a torrentdetails tabs position menu
The tabs placement for the torrentdetails notebook might not be to
everyone's liking so add a menu item to configure it.

Default the position back to top.
2021-02-20 15:22:08 +00:00
291540b601 Hide pygame community banner in console
Notifications plugin uses pygame for sound notifications however pygame
show a console message "Hello from the pygame community." whenever
starting deluge from console.

Refs: https://stackoverflow.com/a/55769463/175584
2021-02-20 14:11:14 +00:00
092d07b68e [#3337|Core] Fix lt listen_interfaces not comma-separated
A typo meant that the interfaces supplied to libtorrent were not
comma-separated.

Refs: https://github.com/arvidn/libtorrent/blob/RC_1_1/include/libtorrent/string_util.hpp#L70
2021-02-06 17:26:30 +00:00
da5d5bee20 [#3325|Core] Fix unable to remove magnet with delete_copies enabled
Users were encountering the following error while attempting to delete
magnet torrents and had the config 'Delete copy of torrent file'
enabled. This was due to removing a magnet before the metadata was
downloaded and the torrent.filename was still set to None so raises
exceptions when string operations are performed with it.

  File "/usr/lib/python3/dist-packages/deluge/core/torrent.py", line 1317, in delete_torrentfile
    os.path.join(self.config['torrentfiles_location'], self.filename)
  ...
  TypeError: join() argument must be str or bytes, not 'NoneType'

Fixed by both setting a default empty string for self.filename and only
deleting the torrent file copy if filename is set.
2021-02-05 20:33:19 +00:00
6d9dc9bd42 [WebUI] Add country flag alt/title for accessibility
This allows viewing the country in textual form by hovering the flag
image and displays it if the image couldn't be loaded.
2021-01-29 18:49:24 +00:00
937afd921c [Tests] Fix console tests sometimes failing due to hard coded port
The tests in ConsoleUIWithDaemonBaseTestCase could fail to the hard coded
port 58900 being busy.
Fix by using the proper port found in self.listen_port

Also convert unnecessary use of assertTrue where more appropriate
assert functions should be used, such as assertEqual and assertIn
2021-01-29 18:46:42 +00:00
EFS
a4da8d29f8 [WebUI] Fix tracker icon download error
Encoutering an error when webui attempts to download tracker icon:

    Error occurred downloading file from "http://b'acg.rip'/": invalid
    hostname: b'acg.rip'

Fixed by ensuring the request.tracker_name is decoded from bytes before
looking up the icon name.
2021-01-29 18:31:52 +00:00
8ec5ca9d08 [Console] Fix setting 'Skip' priority on console
Selecting priorities 'Low' and 'Skip' on console will both set the
actual priority to 'Low'.

Fixed typo in previous commit 6655fe67c3
2021-01-29 18:26:35 +00:00
9c90136f57 [#3439] Execute plugin fails to run on Windows
Fixed TypeError: a bytes-like object is required, not 'str'
2021-01-29 18:17:35 +00:00
610a1bb313 [Lint] Update pre-commit hook and isort versions
* Fixed black hook requiring Py3.6 to installed locally. Will now assume
Py3.6+ in installed.
 * Added isort traceback in pre-commit flake8 hook fails
 * Updated versions of Black, Prettier and isort
 * Keep Flake8 at 3.7.9 due to E402 issue: https://gitlab.com/pycqa/flake8/-/issues/638
 * New pyproject config for isort v5 with fixes for Python 2 imports.
 * Fixed travis config to run Python 3.6 for lint run. Replaced the
virtualenv with_system_site_packages config with Travis specific Python
config value so lint run doesn't attempt to append with_system_site_packages
to Python 3.6 command.
2021-01-24 20:40:20 +00:00
23a48dd01c [#3309|GTK] Fix cmp function for None types
Comparisons on Python 3 are much stricter resulting in the following
error comparing with None:

    TypeError: '>' not supported between instances of 'NoneType' and 'str'

Fix this by getting the type of the other value and getting it's default
value.
2020-04-30 14:30:37 +01:00
d02fa72e80 [Console] Fix hostlist status lookup errors
If a host in hostlist failed DNS lookup or other issue it was returning
a tuple instead of deferred. Fix this in hostlist by returning a
defer.succeed.

A race condition with BaseMode was also encountered when
update_hosts_status calls update_select_host_popup and
ConnectionManager does not have a rows attribute. Fix this by init
BaseMode before update_hosts_status and remove already called
update_select_host_popup.
2020-04-27 16:24:33 +01:00
62d8749e74 [#3348] Fix TypeError adding peers to torrents
Python3 has stricter type checking and passing a port as string results
in libtorrent raising a TypeError.

Fixed by casting port to int, along with refactoring to ensure ipv6 is
correctly parsing and a useful error is output to user with invalid ip
or port details.

https://dev.deluge-torrent.org/ticket/3348
2020-04-25 13:16:04 +01:00
76f0bf2e04 Ctl+Q to quit Deluge GTK without killing daemon 2020-04-25 13:08:54 +01:00
635f6d970d [Config] Fix loading config with double-quotes in string
If a password or other string contained a double-quote then the config
would fail to be loaded on startup and reset.

This occurred due to fixing a similar issue with curly braces for #3079
in commit 33e9545cd4 and the checking for double-quotes had unforseen
consequences.

To resolve both these issues the code to check for json objects in
config files was simplified and utilises the json module raw_decode
method to ensure the extracted string indexes are json objects.
2020-04-25 10:49:08 +01:00
672e3c42a8 [Tests] Add pytest markers to tox.ini
Remove pytest warnings due to unknown markers
2020-04-23 17:19:37 +01:00
c1110e4ef3 [Tests] Fix tests failing when deluged fails to listen
Commit b32c5d824 changed the logged message in deluge/core/daemon_entry.py
when libtorrent fails to listen on the given port, without updating the
trigger expression in deluge/tests/common.py:start_core to match the new output.

Fix by updating the trigger match expressions to match the new log output
2020-04-23 17:19:37 +01:00
742c8a941a [Tests] Fix PytestDeprecationWarning from pytest
Accessing pytest.config is deprecated and produces:
PytestDeprecationWarning: the pytest.config global is deprecated. Please use
request.config or pytest_configure (if you're a pytest plugin) instead.

Fix by using a pytest.fixture
2020-04-23 17:19:37 +01:00
3427ae4b90 [GTK] Remove PyGIWarning in gtk3/files_tab.py
Remove warning: PyGIWarning: Gtk was imported without specifying a version first
2020-04-23 17:17:20 +01:00
034db27936 [GTK] Add more width to outgoing ports spinbuttons in network preferences
The spinbuttons would sometimes be truncated.
Fix by increasing the width
2020-04-23 17:17:20 +01:00
1e3c624613 [GTK] Destroy the dialog before running the callback
Currently, the dialog window is displayed until after the callback has returned.
The result is that if a new dialog is opened from the callback, the first dialog
is still displayed until the new dialog is destroyed.

Fix by destroying the dialog before running the callback.
2020-04-23 17:17:20 +01:00
3519f341d4 [GTK] Fix showing correct error on libtorrent import error
The exception string "No module named libtorrent" was changed to
"No module named 'libtorrent'" in python 3.3, which results in a
"unknown Import Error" message being displayed instead of the
message meant for libtorrent import error.

Change to raising LibtorrentImportError in _libtorrent.py and
catch this error to display libtorrent specific import errors.
2020-04-23 17:17:20 +01:00
d6c96d6291 Fix warning related to gettext 2020-04-23 17:14:24 +01:00
15c250e152 Fix template config.ui naming in create_plugin script. 2020-04-20 00:01:16 -07:00
eb57412601 [Tests] Fix tox, pytest and travis issues
* Error occurring with Pytest 5.4 so pin to below that version.
 * Fix minor issues with Travis config.
 * Use full command-switches for pytest in tox config.
 * Remove pin for pip as issue with pip-wheel-metadata was fixed in 19.3
 * Remove tox-venv as causing issues of incompatible packages installed.
   The latest versions of the virtualenv package should handle these
   duties.
2020-04-12 17:37:42 +01:00
2f1c008a26 [Console] Fix AttributeError setting config values
GitHub user JohnDoee reported that config settings are not decoded
correctly, this error can be reproduced with a command like

    deluge-console -c /config/ "config --set download_location /downloads"

    > AttributeError: 'str' object has no attribute 'decode'

The tokenize code was using 'string-escape' to decode strings but there
is no direct replacement in Python 3 but also unnecessary. However the
tokenize code is complex and buggy and not really suitable for the task
of evaluating config values.

A better alternative is to evaluate the config values using the json
decoder with some additional logic to allow for previous syntax usage,
such as parentheses.

Added a comprehensive set of tests to check for potential config values
passed in from command line.
2019-11-28 12:38:02 +00:00
5e06aee5c8 [Logging] Fix findCaller with unknown source
In case no source was found, a 3-tuple was returned instead of a 4-tuple
in Python 3
2019-11-19 17:44:48 +01:00
351664ec07 [Logging] Fix Python 3.8 compatibility
Deluge's logger class extends Python's `logging.Logger`. Since Python
3.8, it takes an additional argument `stacklevel`.
The implementation in Deluge does not support that. Work around the
problem by ignoring additional arguments.
2019-11-19 17:44:47 +01:00
5f1eada3ea [Tests] Skip buggy pytest 5.2.3
Plugins test fails due to:

https://github.com/pytest-dev/pytest/issues/6194
2019-11-15 20:55:22 +00:00
bde4e4443e [Lint] Fix Black and Flake8 issues
For a single element unpack black now also encloses with parentheses to
make it clearer: https://github.com/psf/black/issues/1108

Fix flake8 warnings
2019-11-13 15:44:46 +00:00
ed4bc5fa17 [Core] Fix potential "dictionary changed size during iteration" on shutdown 2019-11-12 15:40:38 +00:00
20afc31f3c [Docs] Fix changlog symlink and markdown issue 2019-11-12 15:37:12 +00:00
9232a52fd6 [Docs] Update dev environment instructions
I'm going through these instructions on a clean Ubuntu 19.04 VM

These are the changes I needed to make to get Deluge to build/run
2019-11-12 15:36:52 +00:00
23b3f144fc [#3298|Core] Fix pickle loading non-ascii state error
When trying to load a torrents.state from version 1.3 users were
encountering the following error:

    UnicodeDecodeError: 'ascii' codec can't decode byte

This was due to the way that Python 2 was pickling state with torrent
filenames that contained non-ascii characters and Python 3 was
unpickling the state using ascii encoding and failing. The fix is to
specify utf-8 encoding when loading torrents.state.
2019-11-12 15:21:56 +00:00
89d62eb509 [GTK] Remove orphaned code
Changes were made to sidebar theming in commit 5a6f202 and this code was
forgotten to be removed.
2019-10-31 10:56:08 +00:00
00176ee2cd [Docs] Typo corrections in testing.md 2019-10-31 10:04:30 +00:00
8737005b82 [GTK] Fix typo in preferences language label 2019-10-31 10:01:40 +00:00
d08c3f72e9 Fix privilege dropping when setting process ownership
`os.setgid()` should be called to set the GID, and it should be called
before `os.setuid()` to prevent reinstatement of privileges.
2019-10-31 09:57:33 +00:00
40ebdf3f39 [GTK] Add missing translation markup
Found some text needing marked for translation.
2019-10-31 09:40:59 +00:00
eeeb7fb69b [GTK] Fix Status tab download speed and uploaded
Previous work on the status tab caused these labels to not be in the
correct position so this commit swaps them back..
2019-10-31 09:38:37 +00:00
3f9ae33793 [Label] Fix Options/Add windows not reopening
When a user clicked ESC key or X button, the Options and Add windows
didn't open again. This happened because the windows were closed and
not hidden, which deleted the instance of those windows.

This fix changed the behavior of the close action to 'hide'.
2019-06-25 11:51:59 +01:00
0c7f53e305 [WebUI] Fix class-header for Deluge.EditTrackersWindow 2019-06-25 11:51:59 +01:00
63a4301a8b [Notifications] Fix unhandled TypeErrors on Python 3
- Notify requires GLib.Variant for set_hint
- Twisted defer.fail only accepts Exceptions.

Fixes: #3267
2019-06-25 10:44:51 +01:00
1b4ac88ce7 [Common] Fix creation of pidfile via command option
Python 3 raises a TypeError for binary file mode and writing text string.

Fixes: #3278
2019-06-25 10:39:49 +01:00
4b29436cd5 [Core] Fix for peer.client UnicodeDecodeError
Some users have been reporting unhandled UnicodeDecodeErrors and the
traces show it occuring in the call to `peer.client`. Although unable to
replicate it seems prudent to put a try..except around the call to
ensure it does not break the UIs.

Refs: https://github.com/arvidn/libtorrent/issues/3858

Closes: #3279
2019-06-24 16:34:15 +01:00
833b5a1f30 [Common] Fix show_file unhandled dbus error
If dbus org.freedesktop.FileManager1 service is missing then show_file
raised an unhandled exception. The service is not available on certain
desktop environments e.g. i3wm.

The solution is to fallback to xdg-open.

Fixes: #3272
2019-06-24 11:44:29 +01:00
24b094a04a [WebUI] Handle torrent add failures
Closes #2253.
2019-06-21 09:09:12 +03:00
3365201011 [Docs] Fixes for spelling
Running on Ubuntu Xenial results in spelling warnings so update wordlist.
2019-06-18 09:07:48 +01:00
c1ba403d4e [Docs] Add service how-tos 2019-06-18 09:07:48 +01:00
8b62e50eb8 [Docs] Add spellchecking with pyenchant
- Use sphinxcontrib.spelling with custom wordlist.
- Skip the checking of the modules documents as they raise
false-positives.
- Add a setup.py spellcheck_docs command.
- Fix spelling and other issues.
- Add a doc favicon.
2019-06-15 21:06:27 +01:00
5b315e90c5 [Docs] Cleanup updating plugin page 2019-06-15 21:01:04 +01:00
b711cd258a Release 2.0.3 2019-06-12 18:47:11 +01:00
e1c4069a72 [Gtk] Refactor presenting window
Include the correct usage for other display servers.

Still not sure how to get the proper timestamp for Wayland or Quartz but
I read that using 0 equals the GDK_CURRENT_TIME which suffices for now.
2019-06-12 16:57:48 +01:00
a2dee79439 [GTK] Improve detecting X11 display server
GdkX11 still imports on Wayland so check display server is X11 before
importing.
2019-06-12 16:05:15 +01:00
7a54db3179 [Docs] Fix typo and url for Windows install 2019-06-12 14:56:21 +01:00
03e7952d26 [GTK] Only import wnck on X11 display
Wnck is only supported on X11 and raises errors in Wayland so only load
it when X11 present.

Fixes: #3265
2019-06-12 10:21:23 +01:00
7ee8750be4 [GTK] Fix peers tab flag tooltip error
Hovering over a country flag resulted in an AttributeError.

This is due to get_tooltip_context now returning a bool value instead of
the tooltip object.

Fixes: #3219
2019-06-12 09:40:51 +01:00
f61001a15d [GTK] Fix missing argument for GtkMenu.popup()
Missed while converting from pygtk to Gtk3

Fixes: #3266
2019-06-12 09:40:14 +01:00
86ddadacf7 [Extractor] Fix startup error
On Python 3 need to create a copy of the dict to iterate

Fixes: #3264
2019-06-12 09:40:14 +01:00
632089940c [Web] Fix unable to change password
The hashlib update method requires bytes and raised a TypeError for salt
passed as text.

Added a test for auth change_password

Fixes: #3262
2019-06-11 20:14:11 +01:00
5d7db3e727 [Web] Change request.base path encoding to utf-8
A user reported a problem with setting base path resulting in this error:

    encoding with 'idna' codec failed (UnicodeError: label too long)

It is likely the base path is longer than 63 chars, which is unusual,
however the idna codec is for domain name not paths so switch to utf-8.

Fixes: #3261
2019-06-11 20:14:11 +01:00
4dd1f63b8b [Web] Fix TypeError with reverse proxy x-deluge-base header
The request header needs decoded otherwise string comparisons fail.

Fixes: #3260
2019-06-11 20:14:11 +01:00
fc134cdffb [Docs] Add more info to release notes 2019-06-11 20:14:11 +01:00
36cb4c5a4f [Docs] Updates to release checklist 2019-06-11 20:14:11 +01:00
676bdb26e0 [Docs] Remove incomplete Windows install instructions
The instructions are in-progress and missing steps so instead point to
the issue ticket for now.
2019-06-11 12:35:04 +01:00
dff778ceeb [i18n] Try loading intl.dll on Windows 2019-06-11 12:35:04 +01:00
bdadd2b515 Fix typo in install instructions for macOS 2019-06-11 12:35:04 +01:00
a34543100c [Web] Fix peers tab failing to set flag location
The request.country returns bytes not a string so decode.
2019-06-11 12:35:04 +01:00
b8b044f451 [lint] Fix pre-commit config key name 2019-06-10 14:24:47 +01:00
2d87cde887 Make a 2.0.2 release 2019-06-08 21:34:27 +01:00
212efc4f52 [Packaging] Move user out of systemd files and add to tarball
With the `deluge` user specified in the unit files it ties it to
that user and makes it unavailable for re-use by systemd user instance.

Remove the user and group from the unit files and put them in a separate
`user.conf` file that should be installed as an override file e.g. for
deluged.service this would be placed as follows:

    /etc/systemd/service/deluge.service.d/user.conf

Add the systemd files to the tarball for package maintainers.

Closes: #2034
2019-06-08 21:31:49 +01:00
879a397215 [Packaging] Add updated launchd scripts
Copy from Trac UserGuide and updated with proper naming and deluge-web
version.

The bin location is default for brew with pip install.

Closes: #3073
2019-06-08 21:31:49 +01:00
957cd5dd9c [Core] Fix SimpleNamespace on Python2 2019-06-08 21:31:49 +01:00
25087d3f2d [Docs] Add release notes and update pages 2019-06-08 16:42:25 +01:00
d24109f0a2 Update Changelog for 2.0.1 2019-06-07 20:27:02 +01:00
647baebcf0 [Docs] Update release checklist 2019-06-07 14:47:49 +01:00
98ce3cd385 [Packaging] Create tar.gz with sdist for PyPi
PyPi does not accept `tar.xz` source tarballs!
2019-06-07 14:47:02 +01:00
0c87d9bd7d [Packaging] Fix get_version with no git command
An unhandled FileNotFoundError was encounted if git command was not available.
2019-06-07 14:45:49 +01:00
aa35247e95 Back to dev 2019-06-06 17:27:49 +01:00
0dc4e18ac4 Updates for 2.0.0 release 2019-06-06 17:12:58 +01:00
d4185505d1 [Docs] Cleanup changelog and docs 2019-06-06 17:12:58 +01:00
04e58659fe Update translation files 2019-06-06 16:50:16 +01:00
5e738cf73a Simplify the get_version method
Use post segment instead of dev for non-dev tags.
Default to 'deluge-' and '.dev0' to simplify getting version.
Refactor to use subprocess.check_output
Use deluge.common.get_version as fallback in docs conf.
2019-06-06 11:30:45 +01:00
ce8595e8dd [Tests] Remove python2 from tox config 2019-06-06 11:30:45 +01:00
be74d96c6a [Core] Copy lt alerts to avoid segfaults
Changes in libtorrent 1.1 mean that alerts are no longer allowed to be
accessed after the next call to pop_alerts.

> It is safe to call pop_alerts from multiple different threads, as
long as the alerts themselves are not accessed once another thread
calls pop_alerts. Doing this requires manual synchronization between
the popping threads.

The solution is to copy the alert attributes and pass that to the
handlers.

Refs: https://github.com/arvidn/libtorrent/issues/2779
      #3159
2019-06-05 15:10:35 +01:00
4212bd6800 [Travis] Add unit test for libtorrent 1.2
Skip test_torrent_error_resume_original_state on libtorrent 1.2 as it
is failing for an unknown reason.

Refs: #3255
2019-06-05 15:09:40 +01:00
d40d40af31 [Core] Update to support libtorrent 1.2
Some changes between lt 1.1 and 1.2 require updates to core code.
 - Switch from proxy_type to proxy_type_t
 - Replace hardcoded flag value with add_torrent_params_flags_t since
   1.2 uses different flag values.
 - add_torrent_params requires flags set instead of dict values.

Refs: #3255
2019-06-05 15:09:00 +01:00
cbf9ee8978 fix blurry icons in gnome
Fixed blurry icon by changing "StartupWMClass" value from "Deluge" to "deluge" in "deluge.desktop".
2019-06-04 17:39:06 +01:00
7abeb4ee0f [packaging] sdist use xztar and exclude .mo files 2019-05-24 11:21:35 +01:00
bd4a3cba38 [Docs] Update install details and add more pages 2019-05-23 15:41:58 +01:00
3cfa39a2ad [macOS] Fix GTK windowing issues
On macOS the Quartz windowing is used instead of X11 so make ensure
that the X11 window calls are optional.

Also if gtkosx_application is not available then don't create osxapp.

It would be useful to find out how to pass window timestamps on Quartz.
2019-05-23 13:00:02 +01:00
a3b6d8d8e5 [Appveyor] Switch to Python 3.6
- Change build from Python 2.7 to 3.6 64-bit.
 - Specify py36 for tox since using py3 will choose latest py3 e.g. 3.7!
 - Use python 3.6 libtorrent.pyd build
 - Use pre-installed OpenSSL 1.1 (matches libtorrent build)
 - Add python version output to tox.ini for debugging.
2019-05-23 00:15:49 +01:00
7e3692bb5a [Docs] Fix missing path in RTD config 2019-05-22 18:01:05 +01:00
aa3a9a15cc [Docs] Update readthedocs config
- Add the missing package install so pkg_resources can find version.
2019-05-22 17:48:33 +01:00
0f92ea401f [Travis] Remove Python2 tests 2019-05-22 14:14:44 +01:00
260d55aeae [Travis] Fix getting version from git tags
Travis clones the git repo with a shallow depth and the git describe
command cannot find the version tag. Setting depth to 1000 should be
enough but can be increased if required.

Refs:
  https://docs.travis-ci.com/user/customizing-the-build/#git-clone-depth
  https://stackoverflow.com/a/51727114/175584
2019-05-22 12:12:54 +01:00
a9609a197d [Docs] Fix ReadTheDocs config path 2019-05-22 11:39:37 +01:00
a8fac1381b [Packaging] Cleanup README for Pypi
- Set a minimal Python version 3.5 and remove universal wheels.
- Tidy up the README
- Add Project URL for issues and docs.
2019-05-22 11:15:32 +01:00
65f6ede8b2 [Docs] Updates and fixes to build on Python 3
- Updates to the sphinx conf
  - Applied Mock fixes to build on Python 3.
  - Group patches at bottom of conf file.
  - Use just a major.minor for version.
  - Specify Sphinx 2.0 version requirement.
- Move requirements.txt to docs dir.
- Add readthedocs config
- Fix docstring code block rst formatting issue.
2019-05-21 15:23:45 +01:00
515dbcc5d9 Minor updates to log.py 2019-05-20 21:23:20 +01:00
827987fe7d [GTK] Fix drag and drop files in files_tab
Encoutered an error reordering files by dragging in the files tab:
   TypeError: can't pickle TreePath objects

The issue was get_selected_row  now returns a list of TreePath objects which
cannot be pickled. Also the set_text method only accept unicode text to
pickled bytes cannot be used.

The fix is to convert the TreePaths to strings and use json to encode
the list of strings for set_text.
2019-05-20 21:14:42 +01:00
1357ca7582 [i18n] Ignore non-translation dirs in get_languages
The `__pycache__` dir was showing up in list of available languages so
ensure only those directories with languages are returned.
2019-05-20 21:02:13 +01:00
72d363968e [Logging] Fix line numbers missing on Python 3
The findCaller method returns a 4-element tuple on Python 3 whereas it
was a 3-element tuple on Python 2.
2019-05-20 16:49:49 +01:00
c6b6902e9f [Core] Fix prefetch magnets missing trackers
When adding magnets that have been prefetched the tracker details were
lost. A result of returning only the lt.torrent_info.metadata which
does not contain full torrent details, such as trackers.

- Modified torrentmanager prefetch_metadata to return dict instead of
  base64 encoded bencoded metadata dict...
  - Used a namedtuple to ease identifying tuple contents.
  - Updated tests to reflect changes with mock trackers added to
    test_torrent.file.torrent.

- Refactor TorrentInfo to accept dict instead of bytes and add
  a class method to accept metadata dict with lists of trackers.
  - Rename class arg from metainfo to torrent_file, matching
    lt.torrent_info.
  - Rename metadata property to correct name; metainfo.
  - Simplify class variable naming with _filedata and _metainfo for
    torrent file contents encoded and decoded respectively.

- Update GTK Add torrent dialog to pass trackers to TorrentInfo.
2019-05-20 16:49:25 +01:00
6a5bb44d5b [Core] Write torrent file with full magnet metainfo
The use of torrent_info.metadata misses saves trackers and other torrent
metainfo fields so use lt.create_torrent generate method to create this
data.
2019-05-18 16:15:27 +01:00
cbcf8eb863 [GTK] Fix missing magnet trackers with Add dialog (non-prefetch)
When adding magnets (without prefetch) the trackers were missing.

The issue was that the magnet uri was being xml escaped twice so that
the ampersand was still escaped when passed to core and everything after
the magnet info_hash was ignored.

Also found unneeded call to core.add_torrent_files when only adding
magnets with core.add_torrent_magnet so check torrents_to_add before
calling.
2019-05-18 16:15:27 +01:00
09cfd9b89e [bencode] Fix unhandled TypeError with string
Passing a non-bencoded dict to bdecode resulted in an unhandled
TypeError.

- Catch TypeError in decode_func.
- Add bdecode tests.
- Replace KeyError and IndexError with base LookupError.
2019-05-18 16:15:27 +01:00
b961e11df6 [GTK] Fix handling failed magnet prefetching in Add dialog
If a torrent already exists when trying to prefetch magnet metadata the
exception is not handled and dialog does not update correctly.
2019-05-18 16:12:08 +01:00
2ca683e8fe [Daemon] Fix showing translation warning messages
Disable the warn_msg in daemon_entry since the argparse option are all
marked for translation and warnings are being output. The original
intent of this warn_msg was to identify anything in core code that was
incorrectly marked for translation.
2019-05-17 10:32:07 +01:00
fd20addead Raise Twisted minimum version to 17.1
The use of CertificateOptions with raiseMinimumTo requires this new
minimum version so update requirements and documents.
2019-05-17 10:08:48 +01:00
535b13b5f1 [Plugins] Convert plugins to deluge_ module prefix convention
This commit reverts namespace for the plugins and uses a module prefix
"deluge_" in it's place. The distribution package name remains the same
for now but will also be considered to use a prefix to help find the
third-party plugins e.g. Deluge-{Plugin} and the pluginmanager will
strip the prefix for displaying.

The change is a result of problems trying to package Deluge with
pyinstaller and the pkg_resources namespaces is not compatible.
Testing alternatives to using the pkgutil or PEP420 (native) namespaces
did not yield any joy either as importing eggs with namespaces does not
work. [1]

At this point importable eggs are considered deprecated but there is no
viable alternative yet. [2]

[1] https://github.com/pypa/packaging-problems/issues/212
[2] https://github.com/pypa/packaging-problems/issues/244
2019-05-15 19:20:08 +01:00
d6a0276a78 Update gitignore file
- pip install creates dist-info directories
- add __pycache__ for compelteness and other byte compiled file types.
2019-05-14 11:48:58 +01:00
9c0325b129 [Plugins] Remove stray unneeded init files 2019-05-13 18:55:35 +01:00
f885edd7fc [Console] Add move completed option to add torrent command
- Added a -m|--move-completed option for specifying a move completed
  path when adding a torrent.
- Re-used existing console test and renamed for generic usage.
- Moved setup_translation to tests.__init__ so it is always setup
  instead of relying on tests.common import.

Closes #2847

Co-authored-by: Calum Lind <calumlind+deluge@gmail.com>
2019-05-11 22:33:18 +01:00
2b171e58a3 [Web] Fix missing deregister_object
pluginbase has the complementary deregister_object but the actual
method was missing in JSON component.
2019-05-11 21:04:34 +01:00
d417c4b0f9 [Core] Refactor the base argparser and translation code.
- Move baseargparser out of deluge/ui since it is also used by the
  Daemon and could cause packaging issues if UI code is not available.
  - Renamed baseargparser to argparserbase to follow existing Deluge
    naming.
  - Renamed get_version to distinguish from deluge.common.get_version.
- Translation code is usable by more than just the UIs so also move it
  to Deluge namespace and re-use i18n directory and make it a package.
  - Renamed setup_translations to singular as it felt more correct.
  - Renamed set_dummy_trans to be more descriptive.

Closes: #3081
2019-05-11 20:40:20 +01:00
653f80eac8 [#3250|Console] Fix errors dispaying magnets with no files
Trying to display the files for magnet that has no metadata and thus no
files resulted in `'NoneType' object is not iterable` errors.

Only call file prio update method if we have a list of files.
2019-05-11 19:09:44 +01:00
76b89a7943 [#3250|Console] Fix unable to remove torrent
Trying to remove a torrent had no effect and resulted in the following
error: `'TorrentList' object has no attribute 'clear_marked'`

 * The clear_marked call needs to be made with torrentview instead.
 * Ensure the popup dialog is closed upon deleting the torrent.
2019-05-11 19:05:42 +01:00
6ff7a5400f Remove detox development requirement
As of tox 3.7, detox is no longer needed as tox added a native
parallel environment execution.
2019-05-09 12:02:59 +01:00
db021b9f41 [#3244|Web] Add support for accept-encoding header
* Use EncodingResourceWrapper to replace compress function so that the
proper checks for accept-encoding header are made.
* Ensure only text is compressed and images are left uncompressed.
2019-05-09 11:41:00 +01:00
ab4661f6fd [Packaging] Remove distro from setuptool requirements
The distro package is only available for Ubuntu 18.04 onwards so don't
require it as it will runtime error about missing module.
2019-05-09 09:20:29 +01:00
396cadefda [Tests] Fix console test fail on AppVeyor
Curses is not available on Windows so skip AppVeyor test that errors
with:

    E       NameError: global name 'curses' is not defined
2019-05-08 21:41:28 +01:00
2296906ed3 [Common] Replace platform.linux_distribution function
As of python 3.5, this function is marked as deprecated.
So, [distro][1] is the one we will use (this package is listed at the
example package in the python's [docs][2]).

[1] https://pypi.org/project/distro/
[2] https://docs.python.org/3/library/platform.html#platform.dist
2019-05-08 21:24:45 +01:00
1a134cab1b [#3248|Console] Fix not accepting input under Python3
On Python 3 the chr function returns unicode so trying to decode will
result in an error. Applied a workaround to assign without decoding.
2019-05-08 21:02:09 +01:00
7d67792493 [Lint] Update pre-commit linter versions
- Default to python3.
- Needed to add six to isort config.
2019-05-03 17:50:42 +01:00
3c18e890e8 [Tests] Fix AttributeError in test_core with Twisted 19
Should be setting header contents to string not ints and latest version
of Twisted raised an error encountering int. Also correct the header
name for setting length.
2019-05-03 15:35:32 +01:00
615500e6e6 [Plugins] Fix missing deregister for JSON 2019-05-03 14:57:30 +01:00
1425fe5413 [Tox] Pin pip version to fix PEP517 issues
* Using pyproject.toml for black config pip version 19.1 errors out
   about using editable install with pyproject.toml.
   Workaround is to not use pip 19.1 in tox.
 * Pin to 18.1 to avoid pip-wheel-metadata-folder creation

Ref:
 - https://github.com/pypa/pip/issues/6434
 - https://github.com/pypa/pip/issues/6213
2019-05-03 14:53:34 +01:00
84643fb6f7 [GTK] Remove running reactor in Gdk thread
The Gdk threading code is causing issue on Windows and this method
of moving the main loop to a thread has been deprecated and advised
against so removing without adding replacement as it currently
only creates one main thread and should still be fine.

If a blocking operation occures and needs solving, see the pygobject
guide for recommened way to use threads in Gtk:

https://pygobject.readthedocs.io/en/latest/guide/threading.html
2019-03-29 15:13:02 +00:00
c8b621172e [Lint] Fix flake8 3.7 warnings
- Fix new flake8 warnings from latest version.
  Note: The `addSlash` variable was orphaned with no reference in
        Twisted or Deluge code so removed.

- Update pre-commit config
  - New pinned versions.
  - Fix prettier output.
  - Use new flake8 hook config and add naming plugin.
2019-03-29 14:27:30 +00:00
02e07dda2a [Docs] Fix recommonmark monkey patch and pin version
The refactored patch did not work so revert it.

A new release of recommonmark breaks the docs build so pin it to working version.
2019-03-29 14:27:18 +00:00
b2e19561e6 [GTK] Fix file manager window popup behind Deluge
Added 'TIMESTAMP' key to startup-id string for dbus method. Unsure if
this is the correct way to specify startup id but it seems to work.

Recreate the dbus session with each call since if there is an error
with the dbus method then it will crash and subsequent calls will fail
with a cryptic message:

   dbus error the name was not provided by any .service files
2018-11-17 14:36:38 +00:00
389f4167b2 [i18n] Fix incorrect GB translation 2018-11-17 12:17:30 +00:00
63cc745f5b [Core|Py3] Fix fastresume data not being loaded
Decode the resume_data dict keys to fix lookups with torrent_id strings
not finding resume_data.
2018-11-17 12:12:55 +00:00
1a4ac93fbb [Lint] Bump prettier version to 1.15.2 2018-11-16 15:06:30 +00:00
582f60ea0b [Tests] Fix failing tracker_icons test
Disable the testing with seo.com as the site certificate has expired.

Ideally should not be testing against live sites and instead use request
replay tool such as VCR.py.
2018-11-16 15:06:30 +00:00
157f6ff62a [WebUI] Catch unhandled 'Bad host id' exception
The bad host id error usually occurs on webui when the 'default_daemon'
key in web.conf does not exist in hostlist.conf.

Added a errback method to output a more useful log message.
2018-11-16 15:06:30 +00:00
bf4244e8b2 [GTK] Fix adding non-ascii torrents and paths on Py2
Added decode_bytes to all widgets returning text to ensure unicode on
Python 2.
2018-11-16 15:06:30 +00:00
25cfd58792 [GTK] Refactor deluge.common usage 2018-11-16 15:06:30 +00:00
09d04aaac0 [Core] Fix showing incorrect file priorities
Removed previous workaround to ensure sync of file priorities with
libtorrent. This did not work when loading torrents as the status is
called before setting the file priorites and resets them to default.

Removed the call to set_file_priorities when writing the torrent file
to disk as it resets the options to default so although the torrent
file priorities do not change, the priorities for UIs is incorrect.
2018-11-16 15:06:30 +00:00
27b4e2d891 [Docs] Fix formatting of exported docstrings 2018-11-16 15:06:30 +00:00
043344b986 Modify the transfer protocol in a couple ways.
Replace the 'D' header with an unsigned byte that indicates the protocol version. This will allow easier changes to protocol in the future.
Replace the signed integer used for message length with an unsigned 32-bit integer. There is no need for a signed value here as a message length must always be positive. This also doubles the max message length.
2018-11-12 19:44:00 -08:00
3b8f71613b [Packaging] Fix deps for win32
- Fixed trying to install py2-ipaddress breaking on Python3.
- Add wheel universal option so Py2 and Py3 wheel built.
2018-11-12 10:10:41 +00:00
10fcbecc04 [Common] Fix win32 set env issue on Python 3
- On Python 3 find_msvcrt returns None and _wputenv should be used with
unicode strings.
- Removed the alternative msvcrt set env since `cdll.msvcrt` should suffice.
- Removed the broad exception catching.
2018-11-12 10:05:45 +00:00
ab7f19fbb8 [GTK] Fix no torrent selected on startup 2018-11-09 10:41:08 +00:00
b665a4a6f7 [#3211|Packaging] Fix missing tray icon
Fixed not including deluge-panel.png in the packaging install.
2018-11-09 10:40:03 +00:00
2c45e59900 Fix UnicodeDecodeErrors with files containing non-ascii chars
The main issue here is a user trying to start deluge and the XDG
`user-dirs.dirs` file contains dir names with non-ascii chars causing
a UnicodeDecodeError when comparing with unicode chars since Py2
default encoding is ascii.

The solution is to use io.open as used elsewhere in code with
encoding set to utf8. Applied to all usage of open in common.
2018-11-08 22:37:26 +00:00
89868cc944 [GTK] Fix needing bytes with hashlib on Py3 2018-11-07 15:52:26 +00:00
841cb889aa [Execute] Fix Glade layout and Py3 bytes issue 2018-11-07 15:52:26 +00:00
6b2f14e51e [GTK] Fix windows not showing topmost on desktop
When showing the main_window, Add dialog or file manager windows they
would not appear at the top of the display stack, always one below.

This is due to needing the windowing timestamp to be passed when making
these calls. The recommended Gtk solution to use present_with_time and
use an event.time timestamp. However, this does not always work so
instead used the lower level Gdk set_user_time and fetch timestamp from
X11 server.

Notes:
- Using int(time.time()) for timestamp is not correct as the
  windowing timestamp is different.
- Gtk.get_current_event_time only works when there is an event being
  processed.
- It might be useful for non-X11 windowing systems to store event
  timestamps so that we have a value to use instead of 0.
2018-11-07 15:52:26 +00:00
7e2192e875 [GTK] Fix showing sidebar and tabsbar
- Fixed the sidebar position not being restored by applying the config
  value in main_window first_show and updating config in position
  callback.
- Renamed the main_window vpaned and hpaned widgets to aid identifying
  purpose.
- Fixed filtertreeview KeyError when not conneted and hiding tabsbar.
- Fixed the tabsbar notebook not being hidden on restart by adding a
  new config value.
2018-11-07 15:52:26 +00:00
f11a42b9bf [GTK] Remove old builtin notification config values 2018-11-06 18:15:23 +00:00
845204178b [AutoAdd] Fix GTK3 AttributeErrors 2018-11-06 14:57:55 +00:00
d937a323fb [GTK] Replace all deprecated VBox and HBox
Use the recommended Gtk.Box.new() signature to match the GTK usage.
2018-11-06 14:57:55 +00:00
d7c48d27d8 [Label] Fix mnemonic labels
Remove the icons to simplify code since ImageMenuItem is deprecated.
2018-11-06 14:57:23 +00:00
1bc766213c Remove stray debug logging lines 2018-11-06 14:57:12 +00:00
775aef5f9b [WebUI] Fix creating icon on GTK3 prefs page 2018-11-06 11:38:21 +00:00
83cac4978a [GTK] Fix and cleanup storing window position 2018-11-06 11:19:00 +00:00
2bb9a8e71c [GTK] Fix tray preferences greyed out
When not connected the tray preferences should still be available.

There is no need to have the `is_connected` applied to widget
sensitivity here as that is set elsewhere in the code.
2018-11-06 11:16:20 +00:00
39783c7703 [GTK] Fix systray popup TypeError
An incorrect number of arguments supplied to GtkMenu.popup
2018-11-06 10:47:17 +00:00
9f9f564e62 [GTK] Fix unicode warnings on Python 2
GTK3 on Python 2 returns bytes so decode before comparisons.
2018-11-05 16:47:58 +00:00
ab1b2bcf14 [Exceute] Fix GTK3 pack_start missing paramters 2018-11-05 16:47:06 +00:00
bb0c61bb3f [GTK3] Replace deprecated set_data with attribute assignment 2018-11-05 08:38:54 +00:00
a7dcf39a32 [GTK3] Fix pathcombo getting folder name on wrong widget 2018-11-05 08:26:23 +00:00
e43796ae51 [GTK] Fix missing sidebar tracker icons
The filename for tracker_icons is an absolute path so check the
path before calling get_pixmap which is for relative ui/data paths.
2018-11-05 08:26:23 +00:00
6655fe67c3 [UI|Core] Fix problems with file priorities
- Fixed the core not correctly settings the current file_priority
settings and added a test.
- Fixed the console not setting file priorities.
- Change the label for not downloading of a file to 'Skip'.
2018-11-05 08:26:23 +00:00
2104b9831c [Core] Fix file_renamed alert returning method
Fixed a typo that resulted in the new_name method being emitted
instead of the string.
2018-11-02 09:00:42 +00:00
e7127637cf [Dependency] Remove bundled rencode 2018-11-02 08:47:57 +00:00
6233e5c844 [Blocklist] Fix detecting compression type on Py3
The magic number is in bytes so ensure bytes in COMPRESSION_TYPES
2018-11-02 08:47:57 +00:00
a01481b26f [Plugins] Update create script and add GTK3 how-to doc
- Updated create_plugin script to create a GTK3 plugin.
- Added a document for updating a 1.3 plugin to be compatible with
  2.0.
2018-11-02 08:47:57 +00:00
3d24998577 [Docs] Fix duplicate description warnings 2018-11-02 08:47:57 +00:00
f24e9d152c [Common] Remove oldest archive if too many exist
Prevents the archive folder bloating.
2018-11-02 08:47:57 +00:00
f47089ae7d [Core] Archive corrupt torrent.state on load
If the torrent.state was corrupted then loading would create a new
state with no backup to examine.

The solution is to use the archive function to save a copy of the
torrent.state.

Added a message argument to archive_files so that the error message
with a reason for archiving can be included in the tarball.
2018-11-02 08:47:57 +00:00
d70abd2986 [Plugins] Refactor plugin scan code
Simplify adding entries to the working_set.
Also fixes adding files rather than just dirs to working_set.
2018-11-02 08:47:57 +00:00
7d998a45f2 Shorten code to declare namespace
This is the recommened way of declaring namespace.

Also remove unneeded unicode_literals import.
2018-11-02 08:47:57 +00:00
3433a911cc [Plugins] Allow enabling any plugin Python version
Users encounter issues when trying to install plugins with differing
python versions. If the plugin was built with Py2.6 but they are using
Py2.7 the plugin would not load. With the move to Python 3 this could
become more of an issue. The workaround is to let the plugin manager
to try to load the deluge plugin regardless of the python version it
was built with.

This will put the onus on plugin author to keep the plugin code
compatible with more Python versions.
2018-11-02 08:47:57 +00:00
967606fa0f [Tests] Fix str/bytes issue on Python 3
- argparser does not accept bytes and raised an error with encoded vars.
2018-11-02 08:47:57 +00:00
97e7d95dd3 Cleanup tox configuration
There were issues with dependencies and tox environments under Python 3
so refactored the tox configuration to be more consistent and clearer.

- Moved travis to default to Python 3 for linting and tests.
- Fixed missing mock for cairo in sphinx config.
- Collated the base deps sections to improve readability.
- Added PYTEST_ADDOPTS env to override pytest verbosity in just tox
  tests as this was a common option being used.
- Renamed env 'testcoverage' to the more concise 'coverage' and moved
  html creation under single env as handy to have this output as well
  as report.
- Cleaned up the isort config for gtk3.
- Added `bad-continuation` to pylint config as conflcts with black
  formatting.
- Fix isort issue with bbfreeze script. This will likely be removed
  in future so just skip sorting it.
2018-11-02 08:47:57 +00:00
26c28445a5 [GTK3] Fix showing piecesbar 2018-11-02 08:45:40 +00:00
74a459274c [GTK3] Cleanup widget placement and spacing 2018-11-02 08:45:40 +00:00
bb6e290bf8 [GTK3] Fix UnicodeWarning in row comparison on Python 2 2018-11-02 08:45:40 +00:00
4a79e1f100 [GTK3] Save ui files with Glade 3.22
To ensure properties are updated this is a simple open and save with the
glade designer. Always a bit messy with the diff but should not
change functionality.
2018-11-02 08:45:40 +00:00
bff93bb162 [Appveyor] Remove PyGTK and disable win32 packaging 2018-11-02 08:45:40 +00:00
bffd091429 Update DEPENDS for GTK3 2018-11-02 08:45:40 +00:00
70d5931622 [GTK3] Fix column header right-click menu popup
The popup_at_pointer method is only available in GTK >=3.22 so for
compatibility restore using popup method.

Right-clicking on column headers popped-up torrent menu so only show
this menu when in torrentview.
2018-11-02 08:45:39 +00:00
ce49cde49d [GTK3] Fix cmp sorting on Python 3 2018-11-02 08:45:39 +00:00
a3bd2e547a [UI] Use Pillow for .ico icons
Pillow added the code in Win32IconImagePlugin to v2.1 (in 2013) so we can remove it.
Refactored the tracker_icons code to reflect this change.
2018-11-02 08:45:39 +00:00
64710ad226 [GTK3] Disconnect after editing host in connection manager 2018-11-02 08:45:39 +00:00
cd6bad0e35 [UI] Fix passing bytes config path to subprocess on Python 3
The % substitution was causing the bytes prefix to become part of the
string and created a `b'/` prefixed config directory. Ensure the config
arg is byte prefixed too.
2018-11-02 08:45:39 +00:00
1310645f55 [GTK3] Translate daemon status in connection manager
- Added a tooltip to show text status which also required translation
  so created a new liststore column for the translated text to ensure
  status is parsed correctly.
- Forced the status to lowercase to avoid translation issues and
  simplify comparisons.
2018-11-02 08:45:39 +00:00
e6a7119595 [GTK3] Replace stock icon and text usage 2018-11-02 08:45:39 +00:00
0b39b529dd [PY3] Fix tray password encoding issue
The tray password need to be in bytes but GTK on Py3 returns unicode.

Use decode_bytes and then encode to ensure Py2/3 compatibility.
2018-11-02 08:45:39 +00:00
1d0e40c66b fix move_completed sensitivity 2018-11-02 08:45:39 +00:00
bcc89c73dd [GTK3] Fix statusbar clicking issues 2018-11-02 08:45:39 +00:00
a6b47e18c9 Fix package_data namespace in setup.py 2018-11-02 08:45:39 +00:00
5183c92543 [GTK3] Migrate to AppIndicator3
Replace the old appindicator imports with AppIndicator3.

- Only few changes required due to Enum renaming.
- Updated the preference import to include require_version and set a bool.
- The password preference needs to be encoded for hashlib on Python3 but
also need to keep Python 2 support so attempt decode then encode.
2018-11-02 08:45:39 +00:00
7c1c3f62d1 [Tests] Ensure GTKUI tests are skipped upon import errors
Need to catch any issues with importing GTK modules to ensure
GTKUI tests are skipped in non-GTK environments.
2018-11-02 08:45:39 +00:00
729f062ea1 [GTK3] Fix RadioMenuItem group error
Fixes a difference from GTK2->3 where the group can no longer be passed
as a RadioMenuItem so use get_group method to set group.
2018-11-02 08:45:39 +00:00
d879ee06a3 [Notifications] Migrate to GTK3
- Switch from pynotify to gi libnotify binding.
  - Ideally would drop libnotify for [GNotification] but requires more
    work with the desktop file needing renamed to DNS format.
    e.g. `org.deluge-torrent.deluge`

[GNotification]: https://developer.gnome.org/GNotification/

Co-authored-by: Calum Lind calumlind+deluge@gmail.com
2018-11-02 08:45:39 +00:00
ed1b2a50fa [Scheduler] Migrate plugin code to GTK3
- Added new svg icons for cleaner look.
- Use widget get_allocated_width and get_allocated_height instead of window size.
- Tweaked margins to fix spacing issues.
- Removed yellow background from 'slow settings' and applied only to label.

Co-authored-by: Calum Lind <calumlind+deluge@gmail.com>
2018-11-02 08:45:39 +00:00
c51e01ac46 [GTK3] Migrate plugins to GTK3
Add a new Gtk3PluginBase to prevent problems with Gtk2 plugins.
2018-11-02 08:45:39 +00:00
4df5bd05ec [GTK3] Replace stock icons for named icons 2018-11-02 08:45:39 +00:00
cf4012bb60 [GTK3] Fix and remove FIXME comments
- Several of the FIXME comments seem to be outdated so removed.
- The status_icon comment was resolved by fixing the arguments supplied to
tray_menu.popup().
- The TreePath no longer returns a tuple so cast path to int.
- Fix an error with Pixbuf signature.
2018-11-02 08:45:39 +00:00
bbcebe1306 [Tests] Fix use get_iter_first for treestore 2018-11-02 08:45:39 +00:00
bcaaeac852 [GTK3] Use explicitly named functions for creating menuitems
See https://wiki.gnome.org/Projects/PyGObject/InitializerDeprecations
2018-11-02 08:45:39 +00:00
4111f94597 [GTK3] Fix GError required attr id for GtkTreeSelection 2018-11-02 08:45:39 +00:00
dd7cc31918 [GTK3] Fix catching Wnck not available 2018-11-02 08:45:39 +00:00
d8d094cab6 [Travis] Fix missing pygi gtk3 packages 2018-11-02 08:45:39 +00:00
dc6e93541b [Docs] Fix mocking external modules
With move to GTK3 needed to update the mocking of external modules.

There is a new autodoc option `autodoc_mock_imports` so use this instead
of the custom mock class.

There are some build warnings output using autodoc mock:

    TypeError: unsupported operand type(s) for |: '_MockObject' and '_MockObject'

Will resolve these later as the build passes.
2018-11-02 08:45:39 +00:00
f6ffb940ab [Tests] Update tests for GTK3 new paths 2018-11-02 08:45:39 +00:00
6fbb1bb370 [GTK3] Fix ui_entry tests for gtk3 2018-11-02 08:45:39 +00:00
8285b226eb [GTK3] Fix Python 3 issues
In Python 3 builtin next function instead of the next method.

Unpickling with translated strings in state file causes ascii decode
error so ensure UTF-8 encoding is specified.
2018-11-02 08:45:39 +00:00
194129c027 [GTK3] Fix create torrent dialog warning
The ui liststore had an extra blank value causing a GTK value type
warning.

Also set the default value displayed to be 128 KiB.
2018-11-02 08:45:39 +00:00
7d5a429466 [GTK3] Fix column lookup not i18n-ised 2018-11-02 08:45:39 +00:00
ac5db1b262 [GTK3] Fix gettext translation code
Add translation setup for Gtk.Builder ui files.

Refactor and cleanup up the translations_util:
- Remove old gtk.glade code.
- Add macos libintl support.
- Remove unneeded setup_translations parameters.
2018-11-02 08:45:39 +00:00
a2857a318d [GTK3] Remove unneeded code in path chooser
Not sure the reason for the added introspection code but originated in
GTK3 changes so remove as path chooser doesn't appear to need it.
2018-11-02 08:45:39 +00:00
13e1fa355d [GTK3] Fix path chooser warnings and errors 2018-11-02 08:45:39 +00:00
2e88fa1dfc [GTK3] Remove listview orphaned code
Not sure why/where this originated from but seems to serve no purpose so
removing it.
2018-11-02 08:45:39 +00:00
366b10f07b [GTK3] Fix displaying column popup menu
Right-clicking on column header resulted in this error:

    TypeError: could not convert type EventButton to GdkEvent required for parameter 0

The following fixes and cleans up the issue:
- Move the signal creation to the class, using the __gsignals__ dict.
- Replace `Event` with `object` since we are passing an EventButton as
Gtk3 no longer accepts it as an Event.
- Replace deprecated menu `popup()` with `popup_at_pointer()` which also
fixes a critical gdk error when using `popup()`.
2018-11-02 08:45:39 +00:00
92a048625a [GTK3] Fix the transient parent for PathChooser
The filechooser dialog was wrongly transient to the main window causing
weird behaviour, namely the main window moving but dialog remaining in
place when attempting to move the child dialog.

The solution is to pass the parent dialog to PathChooser so it can be
properly set the filechooser dialog transient property.

Fixed the Preferences dialog not being set to be modal to main window.
2018-11-02 08:45:39 +00:00
8199928160 [GTK3] Use a non-CSD filechooser dialog for PathChooser
My personal feeling is that GTK client-side decoration (CSD) putting
main dialog buttons in the titlebar is wrong so create a non-CSD dialog.

There was no simple way of changing GtkFileChooserDialog to play nice
with non-CSD buttons and resulting in these GTK warnings:
    Gtk-WARNING : Content added to the action area of a dialog using header bars

There is an unwanted dialog border with this custom filechooser dialog
with no apparent way to remove them. Would require switching to a
GtkWindow implementation.
2018-11-02 08:45:39 +00:00
545aca9a4c [GTK3] Fix piecesbar Pango methods
Fixes 'Context' object has no attribute 'create_layout'
Fix the gi cairo import warning
2018-11-02 08:45:39 +00:00
9f113eab23 [GTK3] Fix ImportError has no attribute message
Python 3 exception objects now use `msg` but casting with `str()` is
better.
2018-11-02 08:45:39 +00:00
bc6bc017cb [GTK3] Fix TextBuffer.get_text() arguments
This fixes an error that it takes exactly 4 arguments (3 given)
2018-11-02 08:45:39 +00:00
535fda90e3 [GTK3] Use core.pause_torrents with list of torrents
Use the new api method.
2018-11-02 08:45:39 +00:00
0ace086de4 [GTK3] Fix About 'MainWindow' object has no attribute 'get_window' 2018-11-02 08:45:39 +00:00
bbb1b44a23 [GTK3] Fix piecesbar window attribute error
Fixes the error: object has no attribute window
2018-11-02 08:45:39 +00:00
dfed17ac0d [GTK3] Fix import and attribute warnings
Fixes:
- warning import GConf
- Gtk is not defined
- 'ResponseType' has no attribute 'Yes'
- selection.data should be selection.get_data
2018-11-02 08:45:39 +00:00
2f879c33f3 [GTK3] Fix path_combo_chooser warnings
Fixes
 - Please remove the widget from its existing container first
 - object has no attribute 'height'
2018-11-02 08:45:39 +00:00
14b6ba10cf [GTK3] Use decode_bytes from method returns
Python3 PyGObject automatically encodes/decodes strings to and from
methods. This does not happen on Python 2 so for compatibility use
decode_bytes.
2018-11-02 08:45:39 +00:00
ae0b072b75 [GTK3] Fix config default_load_path keyerror 2018-11-02 08:45:39 +00:00
250afa6e0b [GTK3][OSX] Restore windowing lookup for quartz 2018-11-02 08:45:39 +00:00
b29b6fe69f [GTK3] Restore and update expand_row code 2018-11-02 08:45:39 +00:00
f160d6312f [GTK3] Fix piecesbar warnings
Fixes:
- get_style to get_style_context
- use str with gsignals
2018-11-02 08:45:39 +00:00
a8d01fd52f [GTK3] Fix GObject deprecation warnings
GObject.idle_add is deprecated using GLib.idle_add instead
GObject.timeout_add is deprecated using GLib.timeout_add instead
GObject.SIGNAL_RUN_LAST is deprecated; use GObject.SignalFlags.RUN_LAST instead
GObject.GError is deprecated; use GLib.GError instead
GObject.timeout_add is deprecated use GLib.timeout_add instead.
ListStore(str, str) using unicode_literals get_value return utf8.
2018-11-02 08:45:39 +00:00
3a5ec4f5f4 [GTK3] Fix Glade ui margins and spacing 2018-11-02 08:45:39 +00:00
eebb93d4ee [GTK3] Cleanup Glade UI deprecated widgets and properties
- VBox is Box(vertical);
- HBox is Box;
- HButtonBox is ButtonBox;
- HSeparator is Separator;
- VPaned is Paned(vertical);
- Table is Grid;
- use_action_appearance is purged;
- yalign is purged;
- xalign is purged;
- xoptions are purged;
- yoptions are purged;
- add some align: start;
2018-11-02 08:45:39 +00:00
01fafd4fe0 [GTK3] Change module structure from ui/gtkui to ui/gtk3
This moves the directory structure so that there is no conflict with the
old gtk2 UI. Also changes the conf and state files being loaded.
2018-11-02 08:45:39 +00:00
ca0db4d1a7 [GTK3] Save ui files with Glade 3 2018-11-02 08:45:39 +00:00
ea72164798 [GTK3] Large rename/modify code for GTK3 2018-11-02 08:45:39 +00:00
e2ba980299 [GTK3] Marked FIXME code changes for GTK3 2018-11-02 08:45:39 +00:00
98051bdea2 [Docs] Move apidoc command to Sphinx config
The apidoc modules were not being generated on ReadTheDocs because
there is no way to run sphinx-apidoc manually.

Moved the running of sphinx-apidoc into conf.py.

Added zope.interface minimum version to fix Readthedocs warning.
2018-11-02 00:21:50 +00:00
20431cc771 [Docs] Fix build errors getting Deluge version
The use of pkg_resource.require caused an unwanted requirements lookup
that errored out the sphinx build when no dependencies are installed.

This is fixed by switching to pkg_resources.get_distribution.

Also changed the tox docs env to not install Deluge as the setup.py
now contains install_requires which is unwanted.
2018-11-01 23:18:05 +00:00
82ecf8a416 [Docs] Reorganise and add sections from wiki
- Change the layout and contents of docs to be better organised and
  follow ideas from: https://www.divio.com/blog/documentation/
- Use markdown for non-technical documents to speed up writing.
- Added new sections and imported documents from Trac wiki.

Build fixes:

- Added a patch to fix recommonmark 0.4 and doc referencing:
    https://github.com/rtfd/recommonmark/issues/93
- Set docs build in tox to Py2.7 since there are problems with autodoc
  mocking multiple inheritance on Python 3 resulting in metaclass errors.
- Supressed warning about `modules.rst` not in the toctree by creating
  a static `modules.rst` with `:orphan:` file directive and add to git.
  Also skip creating this toc file with sphinx-apidoc in setup and tox.
- Simplified finding exported RPC and JSON API methods by adding an
  autodoc custom class directive. Removed unneeded __rpcapi.py.
2018-11-01 17:38:10 +00:00
9dcd90056d [Lint] Fix flake8 warnings
- Use six to silence flake8 undefined Python 2 names on Python 3.
- Fix W605 invalid escape sequence.
- Cleanup unused exception variables.
2018-10-25 15:14:19 +01:00
e2c7716ce2 [#1903|UI] Add super seeding option to interfaces
- Fix applying the setting to libtorrent, passing the value without
  modification so it decide when to enable it.
- Enable super_seeding option when adding torrents to core.
- Update UIs with option in tabs and add dialogs.
2018-10-25 15:14:07 +01:00
e6c61c3f8c [Core] Fix potential renaming unicode folders issue
- Found an issue while fixing `get_name` where `handle.rename_file`
  would raise a UnicodeDecodeError with non-ascii on Python 2. The
  fix is to catch this and pass unicode string to method instead.

- Add a test `test_rename_unicode` to verify no errors are generated.
- Updated test to use core.session instead of creating another one.
2018-10-22 21:58:06 +01:00
b834e33568 [#3204|Core] Fix unicode get_name unicode error
The recent change to torrent.get_name does not handle non-ascii paths
on Python 2.

- Add a decode_bytes to resolve the issue.
- Add tests.
- Refactor to reduce nesting.
2018-10-22 21:58:05 +01:00
9ab2a50097 [Console] Refactor single letter variables
- Replace usage of `s` for variable names to make it easier to read the code.
- Remove unneeded and unused encoding parameter from parse_color_string
  It should not be encoded by this function, only on output.
2018-10-22 16:05:55 +01:00
1838403e3b [#3199|Console] Fix UnicodeEncodeError in addstr
The following error was encountered by user:

   ...deluge/ui/console/modes/basemode.py, line 290, in add_string
       screen.addstr(row, col, string, color)
   UnicodeEncodeError: 'ascii' codec can't encode character...

The `add_str` method is defaulting to using the Python 2 ascii
encoding with a unicode string so use the encoding passed to the
function.
2018-10-22 16:00:12 +01:00
9e7c9fc1d3 [AutoAdd] Fix packaging autoadd_options data files
There was a warning about missing javascript file in the package and
found the `data/autoadd_options` subdir was not being included.

Bump version
2018-10-21 16:05:01 +01:00
9264cb749e [WebUI][#2009] Add About window
- Add an About window to see version details like GTKUI.
- The author and license text were left out as unnecessary.
- Added a daemon get_version method since daemon version was not
  available through the json-api.
- Fix LookupResource to ensure path exists when rendering.
2018-10-21 15:43:29 +01:00
c01679de1f [Config] Prevent symlinked config files being overwritten
If a user keeps the deluge config file under source control and symlinks
to the config files in deluge config dir then when deluge saves config
files it will replace the symlink with actual file.

Using realpath will resolve these symlinks and file will be updated in
the correct location.

Use a temporary file for new config new before moving it to the
resolved location.

Co-authored-by: Calum Lind <calumlind+deluge@gmail.com>
2018-10-21 14:08:30 +01:00
3645feb486 [GTK] Fixup translation strings
- Use named placeholders to allow translators to change text order.
- Refactor fpcnt to use format() and markup strings properly.

- Remove gettext.js creatation from generate_pot script since this step
  is now always done at build-time.
2018-10-21 13:51:30 +01:00
d85f665091 Fix large ETA overflow C int
The following error was encountered in GTK3 which is a result of trying
to cast a very large ETA value to C int and raising an Overlflow error.

   <type 'exceptions.OverflowError'>: 3072227291 not in range -2147483648 to 2147483647

The solution is to limit the ETA to 1 year and represent any values over
that as -1 which the UIs can display as infinity.
2018-10-19 17:30:27 +01:00
5ec6ae3ad0 [Packaging] Minimal requirements for test_requires in setup.py
Remove extra_requires since requirements-*.txt files provides these now
plus the extras_requires is for extras at installation time which does
not apply to docs or dev.

For test_requires include the minimal requirements for pytest to run.
This is not the same as the longer tox test requirements that include
linting, docs etcs.

Fix license field.
2018-10-19 14:14:03 +01:00
860730d43c [Packaging] Update make_release script for Py3
xz compression is included in Python 3 so simplify script.
2018-10-19 14:14:03 +01:00
c1ddcf6012 [Packaging] Add install_requires to setup.py
- Add an install_requires list to allow dependencies to be automatically
  installed via setuptools or pip installation.
- Needed a workaround for twisted service_identity install.
2018-10-19 14:14:03 +01:00
85bbdfe143 [Packaging] Cleanup dependencies
- Tweaked the layout a bit with optional part of dependency description.
- Updated descriptions to help understand dependency usage.
- Made intltool and chardet packages optional. This will help with
  installation where these might be missing and are not crucial.
- Remove gettext from dependency as is part of Python.
2018-10-19 14:14:03 +01:00
9f9827ca58 [Packaging] Fix appdata.xml details
- License should be GPL3+.
- Use the Deluge HTTPS URLs.
- Wrap the description long lines.
- Add launchable tag to launch from software centre after install.
- Removed name tag to use .desktop file name field instead.
2018-10-19 14:14:03 +01:00
dcb3dad435 [Core] Fix renaming folder not updating torrent name
The new get_name method needs to function as it did in 1.3-stable so
when renaming a torrent file or top-level folder update torrent name
to reflect that. If UI supports renaming the torrent then the options
value with be used instead.
2018-10-19 14:02:36 +01:00
0e69b9199c [GTK] Fix toggling auto_managed in Options tab
The refactoring of the options code didn't update to use the new status
key `auto_managed` and `is_auto_managed` is not a valid torrent option.

Related: 1637da84e4
2018-10-19 14:02:22 +01:00
88a3600ce3 Fix sdist missing test files
The exclude 'deluge.tests' in setup.py is for excluding from package
installation but we want the files when distributing as source so
include the entire deluge/tests dir (excluding .pyc files).
2018-10-16 14:59:00 +01:00
91164d8dbf Cleanup and use markdown for source text files
Use markdown to aid readability.

Update the README and use it for the long_description in setup.py
Add detailed requirement information to the DEPENDS files.
2018-10-16 14:59:00 +01:00
ec47720686 [WebUI] Enable debug URL parameter to parse false values
When installed as a development version there was no way to load the
normal js scripts so improve the debug arg handling by parsing for false
values to force use of normal type scripts. Since debug arg overrides dev,
leave dev as is.
2018-10-16 11:52:04 +01:00
467ade1eb7 [WebUI] Fix closure minified size increase
All of the non-standard docstring file headers were being added to
minified files, increasing the file size. Replace with jsdoc `/**`.

Remove ext-extensions from git as will be generated by minify script.
2018-10-16 11:38:13 +01:00
bb93a06fff [WebUI] Fix prettier javascript issue
Prettier removed too many parentheses in asIPAdress and when minifying
the plus unary combined with the plus operator to create an incorrect
increment operator. So skip prettier formatting this secion of code.

Also fix an ECMA5 warning from closure about function scope in FilesTab.
2018-10-16 11:37:11 +01:00
80178f7310 Update javascript minifying script
- When both minifying modules are missing, creating a copy of the debug
  file is not actually desirable, a missing file is more obvious than a copy.
  WebUI can handle a missing 'normal' script and fallback to 'debug' script so
  modified script to skip and warn instead.
2018-10-16 11:34:55 +01:00
ee354eb107 [WebUI] Keep debug js in packaging and fix script lookup
Packaging:

- Decided that the debug files are useful for end-user so keep them in
  package installation. For debug script_type to be usable all debug
  file need to be avaialble so extjs debug files also included.

Script type selection:

- Fixed dev and debug request args to be properly decoded on Python 3,
  otherwise comparison would fail and allowed any case for values.

- Modified the choosing of the script type to pick debug if specified
  as previously always choosing dev type if dev version was True. A rare
  scenario but useful but now debug is used if specified otherwise use dev.

- Changed the order when looking for alternative script types to start
  with dev so that if debug is specified but missing it uses a similar
  script type as previously would fallback to normal which is likely
  undesired.
2018-10-16 11:29:41 +01:00
7d896599b8 [GTK] Fix speed appearing in blanks cells
In TorrentView and PeersTabView, when moving the mouse pointer through
rows, the value in download and upload speed columns can be overwritten
by value from previous row cell.

The solution is to disable return by cached condition in function
cell_data_speed.

Discussion: https://github.com/deluge-torrent/deluge/pull/200#issuecomment-424907571

Removed debugging code.

Co-authored-by: Calum Lind <calumlind+deluge@gmail.com>
2018-10-14 10:52:08 +01:00
55aee2b00f [Common] Fix incorrect path in TorrentInfo
Refactoring for Python 3 did not account for the `self._files` using an
updated info_dict so simplify code by updating in the files for loop.

Added test that TorrentInfo.files returns the correct structure.
2018-10-14 10:51:08 +01:00
10d39c83cb [WebUI] Fix error escaping translated text
In a previous commit d4023e7dde removed a decode for Python 3 but
with translated text returned by gettext encoded on Python 2 the
escape function would raise a UnicodeDecodeError trying to use ascii
to decode.

The fix is to decode the message returned by gettext on Python 2.
2018-10-13 22:57:28 +01:00
0b2cb7539f Cleanup Tox and CI configs
- Use the apt addon for installing libtorrent package.
- Start the py3 test sooner as it is slow to complete.
- Add if conditions for gtkui test dependencies.
- Remove Appveyor tests that are taken care of by Travis.
2018-10-10 18:50:41 +01:00
6fdbf0ba5d Update tox and CI for Python 3 2018-10-10 17:57:02 +01:00
a980f8e959 [WebUI] Allow multiple torrent uploads in Add dialog
Add a new `multiple` field to FileUploadField to allow selecting
multiple files. Include a fallback for if browser does not support
multiple file selection.

Update Add window to upload and parse multiple torrent files at once.
2018-10-10 17:57:02 +01:00
c90cf301df [WebUI] Use application/json in header 2018-10-10 17:57:02 +01:00
6f06cd5ebc [WebUI|Py3] Refactor content_type check
Simplify getting content_type from request to prevent str/bytes mixup.
2018-10-10 17:57:02 +01:00
86de5657ff [WebUI|Py3] Fix and refactor torrent upload 2018-10-10 17:57:02 +01:00
4a335eeb61 [Tests] json loads Python 3.5 compatible
json.loads in Python 3.6 accepts str or bytes but Python 3.5 is str
only so decode.
2018-10-10 14:41:10 +01:00
86d582d52a Remove debugging log line 2018-10-10 14:41:10 +01:00
673b6653a3 [Py3] Fix TorrentInfo info_dict decoding 2018-10-10 14:41:10 +01:00
41732fe38b [WebUI|Tests] Fix json_api tests for Python3 2018-10-10 14:41:10 +01:00
5964bcf897 [Tests|Py3] Fix prefetch metdata test 2018-10-10 14:41:10 +01:00
3ed4a6e834 [WebUI] Fixes for login auth on Python 3
Remove obsolete password check code.
2018-10-10 14:41:10 +01:00
20fa106b8b Update pre-commit config
The prettier hook was missing a trailing slash so omitting css files.

Add a trailing space fix hook and fix issues.
2018-10-08 14:49:36 +01:00
654e2af4e5 [WebUI] Fix browser Flash plugin warning
Do not perform flash player version detection using the fix from here:
  https://github.com/georchestra/georchestra/issues/902
2018-10-08 14:47:27 +01:00
d5dea44689 [WebUI] Update extjs to 3.4.1.1
Better late than never...

http://cdn.sencha.com/ext/commercial/3.4.1.1/release-notes.html
2018-10-08 14:47:27 +01:00
5743382c65 Remove Pipfile and pipenv
For now using requirements files and tox to setup a dev env so to
prevent confusion or stagnation of Pipfile remove it and pipenv
documentation.
2018-10-08 12:21:00 +01:00
39f37e6133 [Tests] Remove slimit dependency
The changes to the minify script mean we no longer require slimit.
2018-10-08 12:19:03 +01:00
0ed3554f95 [WebUI] Copy non-minified JS file if slimit missing
This will remove the setup dependency in "slimit" package.
In case "slimit" is missing, the non-minified JS files will be copied
as is to the build.
"slimit" is marked as a dependency for development process only.
2018-10-08 12:13:21 +01:00
ba6af99b05 [Notifications] Set notification desktop entry hint
Due to Gnome Guidelines https://wiki.gnome.org/Initiatives/GnomeGoals/NotificationSource
2018-10-08 12:11:07 +01:00
9e29fe4111 [Tests] Lint with pre-commit
- Add lint section to tox.
- Replace flake8 with lint on Travis and remove commented out sections.
- Remove flake8 from appveyor to reduce sequential testing time.
2018-10-05 18:45:37 +01:00
a8a4fb69c0 [Lint] Exclude js and css from EOF fixer
- When running pre-commit on all files it is picking up minified js and
  css files. Since prettier will format correctly the source files ignore
  them in end-of-file fixer.
- The template files in web docs can be ignored too.
- Removed the unneeded `pre-commit-hooks` dependency as pre-commit
  resolves that itself.
- Include files fixed by pre-commit.
2018-10-05 18:45:37 +01:00
6cf13d112b [Tests] Remove debug traceback 2018-10-05 13:23:45 +01:00
6973f96f8c [Tests] Update tox and CI configs
- Add new requirements files to make it easier to install deps.

- Tox changes
  - Update tox to use new requirements files.
  - Tweak heading styles.
  - Add development environment command `devenv`.
  - Remove testenv command as it would run on devenv creation.

- Travis changes
  - Now uses xenial as trusty is very old now.
  - Trial run disabled to speed up tests.
  - Add tox-venv for Python 3 support.
  - Only install testssl if running security tests.

- Appveyor
  - Add tox-venv for Python 3 support.
  - Use requirements file for non-tox.
  - Remove trial run to speed up testing.
2018-10-05 13:23:45 +01:00
0548bdb655 [Lint] Add pre-commit config
- Added a pre-commit config for code linting and formatting. It will
  auto-format python, javascript, CSS, YAML and markdown files to save
  manually doing so. To install:

      pip install pre-commit
      pre-commit install

- Added a default virtual environment directory to gitignore.
2018-10-05 09:45:42 +01:00
36606fc448 [Docs] Add markdown support
- Use recommonmark to enable use of markdown files in docs.
- Fix theme not specified
- Remove unused spelling module.
- Cleanup mocking modules in conf so building docs requires only Sphinx.
- Simplify tox section, including use of requirements-docs file. Added
  slimit dependency for sdist-ing deluge package.
2018-10-04 15:53:42 +01:00
c415b097fe Cleanup outgoing_interface code and help text
- Remove is_ip check as libtorrent does accept IP address for this setting.
  See: https://github.com/arvidn/libtorrent/issues/3087
- Use consistent wording for help text.
2018-10-04 10:51:20 +01:00
970fad7557 [GTK] Fix column name missing translation markup
With non-English languages this lookup would fail without gettext
translation of the column name.

A better solution is to not use the translatable column title as an
index but this is a quick fix for now.
2018-10-04 10:39:48 +01:00
358ff74d0e [Lint] Format files with Prettier
Use Prettier to auto-format javascript, CSS and YAML files so that less
manual work is involved and style is consistent across project.
2018-10-03 18:16:09 +01:00
b1cdc32f73 [Lint] Use Black to auto-format code
The move to using auto-formatter makes it easier to read, submit and
speeds up development time. https://github.com/ambv/black/

Although I would prefer 79 chars, the default line length of 88 chars
used by black suffices. The flake8 line length remains at 120 chars
since black does not touch comments or docstrings and this will require
another round of fixes.

The only black setting that is not standard is the use of double-quotes
for strings so disabled any formatting of these. Note however that
flake8 will still flag usage of double-quotes. I may change my mind on
double vs single quotes but for now leave them.

A new pyproject.toml file has been created for black configuration.
2018-10-03 15:21:53 +01:00
bcca07443c [Common] Fix config missing value assignment 2018-09-30 14:58:11 +01:00
67d9c2efb4 [Core] Fix saving listen_interface as None
A mistake in refactoring meant that listen_interface was reset to None
on shutdown.
2018-09-30 14:58:03 +01:00
34b0fdff1d [Core] Retain magnet details when loading state
It is useful to keep the magnet uri even with the torrent_info. When
adding the torrent magnet details are only used if torrent_info is not
available.
2018-09-28 15:01:34 +01:00
f93e5e60b5 [Core] Refactor session status code
Simplify the methods by initialising the session_status dict using
libtorrent session_stats_metrics and rate keys.

Instead of first looking for deprecated keys use exception then lookup.

Added a few more tests.
2018-09-28 15:01:34 +01:00
d8b1e2701c [#3080] Fix torrent reappearing on restart
If a magnet is added to new Deluge state, then deleted, it will reappear
on restart.

The problem results from torrents requiring both state and torrent file
but magnet only rely on the state file and the save_state code not
saving if the torrent list is empty. So torrents won't be loaded as
their torrent files have been deleted but magnets details remain in
state file and are loaded again on restart.

The fix is to always save the state file even if the state is empty.
2018-09-27 10:56:58 +01:00
abf4c345f0 [#2398|GTK] Update prefetching magnet metadata in AddTorrent dialog
The new code automatically attemps to fetch magnet file details from
core while displaying a 'waiting' message.
2018-09-26 14:18:52 +01:00
a09334e116 [GTK] Refactor AddTorrent dialog update config scoping
- Fix a potential scoping issue with callback function by moving to
class method and adding requried parameters.
- Remove unneeded return statements and variable.
2018-09-26 14:18:52 +01:00
57ad9a25da [GTK] Fix AddTorrent dialog title count
Use the treemodel signals to keep the torrent count in the dialog
title correct.
2018-09-26 14:18:52 +01:00
5a2990ff90 [Core] Handle already prefetching magnet metadata 2018-09-26 14:18:52 +01:00
759a618f74 [Core] Tweaks to prefetch metadata method
- Disable the magnet from being auto_managed so it starts immediately.
- Reduce the default timeout to 30secs.
- Use the generic tempfile dir.
- Move callback method to be class method
2018-09-26 14:18:52 +01:00
23f1cfc926 [Core] Assign magnet arg if magnet URI in filename
A magnet that prefetched the metadata is added as a normal torrent but
with the filename set to the magnet URI. So we need to assign the URI to
magnet arg and set filename to None before creating Torrent object.

Updated the is_magnet function to prevent AttributeError with None type.
2018-09-26 14:18:52 +01:00
57ea5ef5da [GTK] Set default file priority to 4 in add dialog 2018-09-26 14:18:52 +01:00
944dc1659f [Core] Fix UI file priorities out-of-sync with libtorrent
The file priorities were not updating correctly in the UI and it was
found that in lt 1.1 file priorities are now updated asynchonously so we
cannot get the values immediately. So only update the options
file_priorities if they are empty.
2018-09-26 14:18:52 +01:00
2dc157578e [GTK] Refactor torrent_liststore appending in AddTorrentDialog
The add_from_torrent and add_from_magnet shared common code so refactor
into methods for reuse.
2018-09-26 11:08:30 +01:00
8a59216061 [#2398|GTKUI] Fetch magnet files details in Add Dialog 2018-09-26 11:08:30 +01:00
cc1807cf97 Fix travis docs failing with Sphinx 1.8.0
Sphinx pinned to 1.7

See sphinx-doc/sphinx#5417
2018-09-14 16:09:20 +01:00
63b7f6d382 [Tests] Add pytest-twisted to tox deps 2018-09-14 16:06:06 +01:00
5c4cbf58c5 [Tests] Fix UnicodeWarning for gzipped file comparison 2018-09-14 16:06:06 +01:00
5959a24d4c [Lint] Flake8 cleanup 2018-09-14 16:06:06 +01:00
d4023e7dde [Py2to3] More fixes for web ui 2018-09-14 16:06:06 +01:00
0fd3c25684 [Py2to3] Fixes to display Web UI 2018-09-14 16:06:06 +01:00
4125e35ebd [Py2to3] Fix test_tranfer strings should be bytes 2018-09-14 16:06:06 +01:00
18d448d4a5 [Py2to3] Ensure httpdownloader saves data as UTF-8
Python 3 raised a decoding error with the google page which appears to be
encoded with 'latin-1', so extract the content charset to decode and
re-encode in 'utf-8'.
2018-09-14 16:06:06 +01:00
d5133f789a [Py2to3] Fix opening torrent files in byte mode 2018-09-14 16:06:06 +01:00
1cce6a297c [Py2to3] Further maketorrent fixes 2018-09-14 16:06:06 +01:00
ad20ec62f2 [Py2to3] Fix TorrentInfo metainfo dict key lookups 2018-09-14 16:06:06 +01:00
af2bed8a0f [Py2to3] Fix tests for maketorrent and metafile 2018-09-14 16:06:06 +01:00
b93e868048 [Py2to3] Fix ui_entry default indicator 2018-09-14 16:06:06 +01:00
8d90ae5ffb [Console] Fix cmdline output and tests 2018-09-14 16:06:06 +01:00
ae4449642c [Py2to3] Fix log.warn deprecation warning 2018-09-14 16:06:06 +01:00
bc2f4a30eb [Py2to3] Fix putChild requires bytes 2018-09-14 16:06:06 +01:00
dc8766874e [Tests] Fix testing core.add_torrent_url on Py3 2018-09-14 16:06:06 +01:00
a33171732d Upgrade Pipfile lock for twisted
Due to a security warning for cryptography update twisted and deps.
2018-09-14 10:54:22 +01:00
b9a9e06c1d [WebUI][Daemon] Enhance TLS Security
This applies the following for both WebUI and Daemon:
1. Raised minimal TLS version to TLSv1.2
2. Added specific cipher suite list
3. Added support for ECDSA auth keys
4. Added support for ECDHE key exchange algorithm

We disabled the ability to perform TLS/SSL renegotiation and therefore
will prevent the clients from renegotiating, which can be exploit for
DoS attacks.

New security tests now will be skipped when running `pydef` and `trial`
testenvs. To run the test, use the testenv `security` or add the environment
variable `SECURITY_TESTS` before running the tests. Also should only run when
adding to the commit message the string `SECURITY_TEST`.
2018-09-06 19:14:13 +01:00
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
ae9bbdbae7 [Core] Add tests for pausing and resuming torrents 2018-08-10 17:48:53 +01:00
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
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
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
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
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
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
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
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
089c667d7f [AutoAdd] Add WebUI interface 2018-07-12 19:18:08 +01:00
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
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
c655da38c8 [Console] Ensure time string is unicode 2018-07-10 16:46:49 +01:00
4c0be7ddd4 [Common] Fix missing return for de/encode methods 2018-07-10 16:46:49 +01:00
38961d4253 [Console] Fix char encoding in preferences 2018-07-10 16:46:49 +01:00
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
be02be75be [GTKUI|Py3] Ensure backward compatible pickle dumps 2018-07-01 20:34:42 +01:00
7b5ed9f1d6 [Py3] Fix dict iter item deletion 2018-07-01 10:08:16 +01:00
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
3fab799dbf Fix flake8 trailing comma 2018-06-27 16:41:21 +01:00
24c100d9b7 [Py3] Decode new_release version to unicode string 2018-06-27 16:41:21 +01:00
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
1fa2de066f Fix mistakes in test code 2018-06-27 16:41:21 +01:00
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
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
200e8f552b Add dependecy on six 2018-06-27 16:41:21 +01:00
4247013446 [bencode] Fix errors with unicode dict keys or values 2018-06-26 12:42:26 +01:00
6ec32a85e4 [GTKUI] Fix AttributeError with clipboard strip 2018-06-26 12:42:26 +01:00
633c56f54e [Core] Add prefetch metadata methods for magnets 2018-06-26 12:42:26 +01:00
23171ad205 Fix missing _metainfo attribute in TorrentInfo 2018-06-26 12:42:26 +01:00
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
74aa0db956 Manually compress png with zopflipng 2018-06-21 14:50:19 +01:00
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
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
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
587b9afefe [GTKUI] Fix count of torrents in dialog title 2018-06-19 09:34:46 +01:00
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
d45dbfe064 [Core] Add is_session_paused method 2018-06-18 20:06:35 +01:00
3176b877a4 [Core] Add methods pause_torrents & resume_torrents 2018-06-18 20:06:35 +01:00
18541bce86 Fixed a minor grammatical error in the deluge console command documentation 2018-06-18 20:04:22 +01:00
bebe08d92b Add X-GNOME-UsesNotifications
Due to Gnome Guidelines https://wiki.gnome.org/Initiatives/GnomeGoals/NotificationSource
2018-06-18 20:00:49 +01:00
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
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
7a3b164060 [WebUi] Fixed Install Plugin window creation 2018-06-12 03:50:30 +03:00
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
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
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
4fd51a4ef9 Skip Failing Tests On Windows 2018-06-02 22:09:50 +01:00
333c81c1d7 Add Appveyor support for Windows builds 2018-06-02 22:09:50 +01:00
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
edd431a304 Make Tox Multi-OS Friendly 2018-06-02 11:29:51 +01:00
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
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
decd7aca71 Update gettext for outgoing interface 2018-06-01 12:57:18 +01:00
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
196aa48727 [#3171] Add Option To Specify Outgoing Connection Interface 2018-05-21 13:14:15 -04:00
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
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
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
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
ee196f5035 [Flake8] Fix import and docstrings issues 2018-05-20 08:45:59 +01:00
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
0c574f33e1 [Tests] Ensure tear_down deletes rpcserver and core 2018-05-19 21:23:46 +01:00
a7c7309027 Use context manager for open in metafile 2018-05-19 21:03:36 +01:00
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
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
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
12f7345d0c Use a constant for versions 2017-12-17 11:47:08 +00:00
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
7787aa975f Delay assert in test_torrent for Travis 2017-12-16 17:29:30 +00:00
c13622a1e6 Fix state not loading after async API change 2017-12-16 13:21:47 +00:00
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
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
5988f5f04f Fix flake8 error 2017-11-18 22:14:04 +00:00
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
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
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
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
53f818e176 [#3070] Fix httpdownloader error with missing content-disposition filename
The parsing of the content-disposition in httpdownloader was not able to
handle missing parameters e.g. "Content-Disposition: attachment" and would
result in an IndexError. Added a test for this use-case.

Fixed the issue using the cgi.parse_header to extract the parameters.
2017-10-29 12:32:32 +00:00
00dcd60d56 [Lint] Fix flake8 issues with l as var 2017-10-29 11:39:52 +00:00
1730230244 [#3124|GTKUI] Fix comparing Name str if value is None
The original fix was not correct as the strcoll function cannot
accept None only strings. This fix ensures that the value is an
empty string if None for comparison.
2017-10-29 11:16:13 +00:00
0728c03c1c [#3066|Core] Add rather than replace dht bootstrap nodes in lt 2017-10-29 10:36:45 +00:00
354372b2ea [Notifications] Remove duplicate heading on prefs page
The heading is provided by prefs add_page so remove from glade file.
2017-10-16 21:57:08 +01:00
d169aca8bd [Notifications]Fix no text in tab list
The tab in the Preferences window is created and clickable - only the
text is missing.
2017-10-16 14:15:17 +03:00
26720ca4c2 [AutoAdd] Fix handling deferred torrents
* The changes to core api now return a deferred instead of torrent_id
   so need to update autoadd to use callbacks.
 * Minor refactor to save one indentation level and reuse fail callback.
 * Add exception handler for any errors from label plugin.
2017-10-14 21:39:30 +01:00
510a8b50b2 [AutoAdd] Update gtkui from libglade to gtkbuilder 2017-10-14 21:30:45 +01:00
d190f149d1 [WebUi] Update gtkui from libglade to gtkbuilder 2017-10-14 20:13:53 +01:00
24a31b1194 [Notifications] Update gtkui from libglade to gtkbuilder 2017-10-14 20:13:53 +01:00
470490769f [Extractor] Update gtkui from libglade to gtkbuilder 2017-10-14 20:13:53 +01:00
1259eca8ad [Execute] Update gtkui from libglade to gtkbuilder 2017-10-14 20:13:53 +01:00
f0316d3e31 [Blocklist] Update gtkui from libglade to gtkbuilder 2017-10-14 20:13:53 +01:00
9b580a87fa [GKTUI] Fix high priority files tab trigger 2017-10-14 20:06:14 +01:00
4bee1ce811 [Travis] Use current Trusty image
The issue with virtualenv site-packages was fixed: travis-ci/travis-cookbooks#878
2017-10-14 20:00:14 +01:00
e3f537770f [UI] Fix setting gettext to unicode for Py2 compat 2017-07-05 12:18:35 +01:00
9b92bc2baf [#3076|UI] Add ngettext and alias _n for plural translations
* Fixes use of _n() in console rm command
2017-07-05 09:46:12 +01:00
51b99caf24 [Common] Add decode_string (deprecated) for compatibility 2017-06-29 15:28:52 +01:00
850fd34522 [#3084] Fix error changing ownership on torrents 2017-06-29 15:07:11 +01:00
9164dafe69 [#3083] Fix missing common.utf8_encoded for backward compatibility 2017-06-29 14:42:16 +01:00
33e9545cd4 [#3079] Fix config parsing for json objects
* If a curly brace was used in a string then find_json_ojects would
   fail to find objects correctly. To fix this ignore double-quoted entries.
2017-06-28 10:32:45 +01:00
7b87a93862 [#2848|Core] Fix incorrect share ratio in torrent status
* Use total_wanted_done to increase the accuracy of the calculated ratio.
2017-06-27 19:02:15 +01:00
51bde704b5 [Packaging] Simplify release script using sdist
* setup.py sdist now creates a pristine tar which can be used for release.
 * Uses the version currently checked-out in git.
 * Removed unneeded lines in manifest.
2017-06-27 18:12:51 +01:00
3f13c24362 Update MANIFEST for wanted/unwanted files 2017-06-27 15:12:13 +01:00
6837d83f5b Fix setup.py requiring gen_web_gettext 2017-06-27 15:11:19 +01:00
3c1d7da698 [Packaging] Apply fixes to OSX app scripts
* Fix path to dist dir
 * Rename dylib with new soversion for lt 1.1.x
 * Create Info.plist with version and year automatically
2017-06-27 14:00:06 +01:00
d6731b8cee [#3078|GTKUI] Apply workaround for showing the OSX menu
Commenting out the remove_accelerator fixes showing the menubar correctly.
2017-06-27 09:16:51 +01:00
fe80703f95 [Packaging] Fix py2app build 2017-06-27 09:16:51 +01:00
1808ac506a [GTKUI] Restore removed os_check for systray icon
status_icon_new_from_icon_name does not work on OSX
2017-06-27 09:16:51 +01:00
3174c7534d [Core] Ensure tracker error message is decoded 2017-06-27 09:16:51 +01:00
065729a389 [OSX] Fix converting mac_ver to string 2017-06-27 09:16:51 +01:00
d250e0a486 [Packaging] Ensure sdist tarball contains correct files 2017-06-25 19:22:13 +01:00
3f1ff54887 [Packaging] Fix using wrong commit id 2017-06-25 19:22:13 +01:00
0424543e36 Update author details 2017-06-25 19:22:13 +01:00
d0cb45808c Exclude test and plugin files from build dir 2017-06-25 19:22:13 +01:00
0cc0882ac9 [WebUI] Refactor out AuthError for NotAuthorizedError 2017-06-23 12:19:39 +01:00
a7c4228ce7 Update systemd service files
- Add man page link
 - Ensure deluge-web is not daemonised
2017-06-23 10:12:07 +01:00
ce3a8c0c17 [Travis] Pin to older trusty build 2017-06-17 04:00:22 +01:00
ace531e8ae [WebUI] Fix testing array after removing torrents 2017-06-17 03:49:30 +01:00
2c66a4c29e [#2707|WebUI] Ensure var test for getSelectedRecords value
* Fixes potential for TypeError undefined in browser console.
2017-06-17 03:47:48 +01:00
6e66452cf3 [GTKUI] Add a prefix space for seed rank k unit 2017-06-17 03:29:16 +01:00
cb646f3a4f Update changelog and gettext 2017-06-16 19:15:05 +01:00
32d5392776 [#2499|GTKUI] Add key shortcuts for changing queue position
- Ctrl+Alt+[Shift]+{Up|Down}
2017-06-16 16:56:33 +01:00
03ca4cfa46 [#2354|GTKUI] Fix alt-f conflict between Tabs and Menu 2017-06-16 14:41:54 +01:00
fb4307f748 Revert "[#2341] Use common.resource_filename in plugins"
Using common.resource_filename broke plugins so need to find a better solution for non-ascii dirs.

This reverts commit bdb3b509ad.
2017-06-16 14:23:10 +01:00
3893d3e214 Revert "[Plugins] Replace pkg_resources for abspath and decode path"
This reverts commit 85364dc8ab.
2017-06-16 11:15:19 +01:00
2b90f309a6 [WebUI] Refactor host connect methods 2017-06-16 08:03:42 +01:00
fb71d049b1 [#3068|WebUI] Fix not connecting to default daemon 2017-06-16 07:45:26 +01:00
89e245e2d3 [#3058|GTKUI] Fix unable to add user to daemon 2017-06-16 01:18:34 +01:00
3330e97d05 [#3067|GTKUI] Fix the daemon stop button sensitivity 2017-06-16 00:47:05 +01:00
15741047ed [Common] Catch tarfile exception if no filepaths exist 2017-06-16 00:31:26 +01:00
eeccc47dde Enable migration from hostlist.conf.1.2 to hostlist.conf 2017-06-16 00:31:26 +01:00
c169d8909f [#3059|GTKUI] Fix starting and autoconnecting to daemon
* Fix start_daemon using callback for non-deferred method.
 * Ensure autostart checks daemon status before attempting to start it.
 * Remove initial delay with autoconnect, it will retry anyway.
 * Found method __connect that needed renaming to _connect.
 * Tweak the timing for refresh and retries.
 * Fix use of reason.trap instead of reason.check, causing code to silently error-out
   and not retry connecting.
 * Set the stop daemon button to insensitive when not connected. The client cannot stop
   a daemon with daemon.shutdown() if daemon is not instatiated. Perhaps in future use
   config and pidfile to allow shutdown without connecting to daemon.
2017-06-15 18:45:26 +01:00
dc27d873b3 Fix metafile.makeinfo trying to decode pieces
* The use of unicode_literals causes join to decode pieces if 'b' prefix not used.
 * Added test.
 * Fixed session_id keyerror when running with tests.
2017-06-15 18:25:13 +01:00
32dc683d5c [#3037] Add creator field to details tabs 2017-06-15 16:33:24 +01:00
06dfeed750 [#3064|WebUI] Fix server not sending TLS intermediate certs
* Sending of cert chain was unintentionallly removed in commit c1902e43 (#2792).
2017-06-15 13:47:10 +01:00
60c764ac33 [Core] Save torrent state only if state has changed 2017-06-14 10:56:19 +01:00
5410c44bb1 [Lint] Fix import position 2017-06-12 21:53:25 +01:00
d372be9b65 [#3055|GTKUI] Fix unable to auto-start localhost daemon 2017-06-12 21:36:52 +01:00
131b9f86a9 [GTKUI] Fix saving host details in connection manager 2017-06-12 10:38:22 +01:00
45e0d10932 Update archiving of state file to use tarfile 2017-06-09 15:08:11 +01:00
596b5d5cd4 [GTKUI] Add prefs liststore col for translation 2017-06-09 11:31:38 +01:00
bb5dafc61d [GTKUI] Small refactor prefs remove_page 2017-06-09 11:31:38 +01:00
7e9a8b801c [#2467|GTKUI] Fix prefs tabs sync adding/removing page 2017-06-09 11:18:00 +01:00
f30f421f50 [Label] Fix common import from parent dir 2017-06-08 14:32:17 +01:00
bbce304f5a [WebUI] Fix attempting to connect to blank host_info 2017-06-08 14:31:38 +01:00
de3a6c443d [WebUI] Set debug to false for gettext script 2017-06-08 14:03:55 +01:00
7ad8431dd9 [Plugins] Update create_plugin script
* Tidyup copyright block
2017-06-08 11:48:42 +01:00
85364dc8ab [Plugins] Replace pkg_resources for abspath and decode path
- Use a BASE_PATH constant.
 - pkg_resources caches the files in python_egg_cache which is not
   required for plugins and causes issues with non-ascii paths.
2017-06-08 11:47:59 +01:00
bdb3b509ad [#2341] Use common.resource_filename in plugins 2017-06-08 11:25:11 +01:00
8326206f87 Ensure configmanager config dir path is unicode 2017-06-08 11:25:11 +01:00
85a1e478fe [#3044|Core] Stop libtorrent checking file timestamps in resume data
* The verfication of timestamps of files on disc against those in resume data
   can be buggy and sends torrents to error state for no apparent reason. It has
   also been removed in latest version of libtorrent so disabling this check.
2017-06-08 11:12:07 +01:00
29191e6a58 [Tests] Remove duplicated override code 2017-06-07 12:36:09 +01:00
15e0e0f30a [Console] Refactor quit code and cleanup conn mgr 2017-06-07 12:36:09 +01:00
d474576104 [Tests] Suppress JSONRequestFailedTestCase printing to stdout 2017-06-07 12:36:09 +01:00
31555ee5ed [UI] Further refactoring of the connection managers
* Add host Edit button to WebUI.
 * Updated and fixed associated tests.
 * Refactored related gtkui code to better understand code flow.
 * Removed dead code in gtkui.
2017-06-07 12:36:09 +01:00
2f11bb8303 [GTKUI] Update connection manager layout 2017-06-07 12:36:09 +01:00
ac48ad982e [UI] Refactor duplicated code out of connection managers 2017-06-07 12:36:09 +01:00
54a081bdfd [Tests] Remove orphaned ubuntu favicon 2017-06-07 12:25:23 +01:00
989137ddc3 [OSX] Default to 64-bit builds 2017-06-07 11:47:58 +01:00
c72459d3ef Replace pep8 with pycodestyle in tox.ini 2017-06-07 11:08:50 +01:00
5c1faf3d5e [Tests] Unpin isort as 4.2.13 contains fixes 2017-06-07 10:31:09 +01:00
4feef3be78 [GTKUI] Fix showing main window when starting in tray
* Also fixes the prefs and dialogs now showing due to first_show not
   connecting signals when starting in tray.
2017-06-07 10:24:11 +01:00
3032e5eb21 [Lint] Fix pylint warnings 2017-06-07 10:05:48 +01:00
481f779349 [Python3] Fixes to make code backward compatible
* Continuation of updating code to Python 3 with Python 2 fallback.
 * Using io.open allows files to be encoded and decoded automatically on write and read. This
 maintains the python boundaries of unicode in code and bytes for output/files so less
 explicit encoding or decoding.
 * io.StringIO is the replacement for StringIO and will only accept unicode strings.
 * io.BytesIO is used where bytes output is required by the enclosing method.
 * Update bencode for full compatibility.
2017-06-05 22:25:29 +01:00
ede0f710f8 [Core] Replace usage of deprecated new.classobj
* type is new module to use
2017-06-05 09:03:34 +01:00
66718f6d8e [Docs] Remove chardet mock to fix requests version check
* chardet is an easily installed pure python module so doesn't need mocking.
2017-06-05 08:10:13 +01:00
fd5833c1d8 Fix build failing on removed icon 2017-06-05 06:37:18 +01:00
6f8a6e5045 [Tests] Remove failing ubuntu icon test
* Changes to website make this test unusable now.
2017-06-05 00:01:39 +01:00
78dc75d55d [Tests] Specify module versions to fix tox tests 2017-06-05 00:01:07 +01:00
579f56b0bf [Lint] Fix triple-quoted to use double-quotes not single
* according to pep8 triple-quotes should use double-quote.
2017-06-05 00:01:07 +01:00
9ebe30edfc Remove unused lock icon 2017-06-05 00:01:07 +01:00
e045d5e5c2 Add new deluge icons and update icon generation script 2017-06-05 00:01:07 +01:00
fefe742ea1 [Packaging] Add a make_release file for source packaging 2017-05-17 13:56:56 +01:00
0c36b63f22 Cleanup infolist and changelog 2017-05-16 12:00:28 +01:00
c9692bb5bd [Plugins] Add webui pref pages for Label and Autoadd
* Add info-only preference pages for these plugins in WebUI.
2017-05-16 11:12:53 +01:00
0353b82c0c [GTKUI] Fix typos in text strings 2017-05-08 10:11:18 +01:00
23a34c6bac [Core] Update new release url 2017-05-03 15:19:08 +01:00
4e7b2e5b41 Update gitignore
Ignore .cache
2017-05-03 10:29:59 +01:00
3668e77a75 [GTKUI] Fix column sort state not saved in Thinclient mode
* In torrentview.stop the listview is cleared however this meant in thinclient mode
   that listview sort details are empty and overwrites existing data when save_state is
   then called in torrentview.shutdown.
2017-05-02 16:29:17 +01:00
a727ee67bc [Core] Ensure absolute dirpath for config dir 2017-03-29 21:22:33 +01:00
aa28d73f47 [Console] Fix super usage breaking console 2017-03-29 21:21:45 +01:00
d485eb5c8f [#2786] [GTKUI] Fix showing connection manager with malformed ip 2017-03-29 18:39:18 +01:00
8a0b7d970a [#2837] [WebUI] Create gettext.js when building 2017-03-22 12:55:17 +00:00
a76fde5feb [GTKUI] Enable multi-row selection with mouse 2017-03-22 12:41:25 +00:00
648dc93655 [#3003] [Label] Fix duplicate context menu entries 2017-03-22 00:21:37 +00:00
f32c8aff90 Minor gettext script improvements 2017-03-21 22:05:54 +00:00
9aed7a7f0c [AutoAdd] Handle AddTorrentError exceptions 2017-03-21 20:21:28 +00:00
c8d084c563 [AutoAdd] Fixes for adding magnets
* Combines three commits from 1.3-stable that fixed splitting magnets from file.

      b52de1549e, 8a3f15e5c0, 2d4dec669e
2017-03-21 20:08:34 +00:00
7e04abd1e5 [AutoAdd] Minor cody tidyup 2017-03-21 20:08:34 +00:00
e2e13103b8 [Core] Catch keyerror in add torrent alert 2017-03-21 18:47:31 +00:00
d8e5cbe689 [#2928] [GTKUI] Fix missing name and trackers adding magnets 2017-03-21 18:47:31 +00:00
19fdd2f88c [Core] Fix saving torrent info metadata
* Unicode dict entry should be bytes.
2017-03-21 18:46:40 +00:00
e5e49f68ba [GTKUI] Fix adding from clipboard 2017-03-20 22:53:37 +00:00
5a3625f6cd Add systemd service files to packaging dir 2017-03-20 19:16:50 +00:00
bc50f6e5f6 [#2913] [Notifications] Fix webui passing string for port value 2017-03-20 18:46:36 +00:00
8ff1bfc0b2 [Console] Add time_added to info status keys 2017-03-20 11:48:55 +00:00
744ab08dfb [GTKUI] Reduce default size of prefs dialog 2017-03-20 11:32:59 +00:00
d01100a258 [GTKUI] Implement multi-torrent support in Options Tab 2017-03-20 08:39:09 +00:00
722ca41584 [GTKUI] Cleaup/refactor mainwindow 2017-03-20 08:39:09 +00:00
1637da84e4 [GTKUI] Refactor torrent details Tabs code
* Move common code into Tab parent class
 * The Tab init now accepts creation with name, child_widget and tab_label but
   will still accept the 'oldstyle' contructor to keep backwards compatibility
   with 3rd-party plugins.
 * Create namedtuple TabWidget with widget, format func and status_keys. The
   TabWidget are stored in a tab_widgets dict making it easier to create, save
   and update large numbers of gtk widgets.
2017-03-20 08:39:09 +00:00
6d28f2c885 [GTKUI] Refactor connect_signals to use 'self'
* If the handler method names match the signal names then it is possible
   to refactor out the mappings and simply pass 'self' to connect_signals.
2017-03-20 08:39:09 +00:00
482606d80a [#2990] [Core] Fix torrent priorities mismatch
* The old priorities instead of updated call to lt were being saved to self.options.
2017-03-20 08:28:10 +00:00
73ea123f1a [#2966] [Tests] Rename deprecated method aliases 2017-03-19 22:15:07 +00:00
d09df063a5 [Stats] Remove blanket try..excepts and stop timers correctly 2017-03-18 11:54:01 +00:00
676574ff19 [Stats] Update gtkui from libglade to gtkbuilder
- Additionally fixes #2977 num_connections KeyError and #2947 AttributeError.
2017-03-18 11:34:40 +00:00
665c047541 [Label] Update gtkui from libglade to gtkbuilder 2017-03-17 23:35:03 +00:00
939835cef1 Fix warning with label glade files 2017-03-17 16:44:23 +00:00
9e303b58a0 Refactor common magnet funcs 2017-03-17 10:26:17 +00:00
112a872bc1 [#2716] [Common] Update magnet funcs for tracker tiers tr.x 2017-03-17 10:26:17 +00:00
6424333c35 [GTKUI] Refactor adding list of trackers 2017-03-17 10:26:17 +00:00
267d331fac [#2476] [GTKUI] Fix adding mistyped trackers urls 2017-03-17 10:26:17 +00:00
d1daeb4cb0 [Trans] Fix unicode issue in msgfmt
- The offset was being calculated on unicode rather than byte strings lengths.
2017-03-17 01:05:58 +00:00
7c6c9eae7f [WebUI] Fix error displaying tracker icons 2017-03-16 23:22:58 +00:00
036154fc36 [#2417] [UI] Add Last Transfer to torrent status and torrentview columns
- Create new status entry `time_since_transfer` and getter that is
   calculated from lt time_since_upload and time_since_download.
 - Add/update all UIs and formatters.
 - Included update to console layout to match other uis
2017-03-16 23:22:58 +00:00
e3abdf9901 Use super class call where possible 2017-03-16 23:20:57 +00:00
af7e83bc76 Replace/remove usage of dict.keys() 2017-03-16 23:20:56 +00:00
4a274466ac Add python 3 section to tox 2017-03-16 23:20:56 +00:00
eb38e0ffff [Py2to3] Large set of changes for Python 3 compat
- Preparation work for using six or future module for Py2/3 compat. The
   code will be written in Python 3 with Python 2 fallbacks.
 - Added some Py3 imports with Py2 fallbacks to make it easier to remove
   Py2 code in future.
 - Replace xrange with range (sort out import as top of files in future).
 - Workaround Py2to3 basestring issue with inline if in instances. This means
   every usage of basestring is more considered.
 - Replace iteritems and itervalues for items and values. There might be a
   performance penalty on Py2 so might need to revisit this change.
2017-03-16 23:20:56 +00:00
321677e05a [WebUI] Return 404.html for files not found
- This ensures a proper request response is returned.
2017-03-15 23:12:36 +00:00
960f3a6552 [WebUI] Check render template files exist and raise 404 if not
- Check render/* requests match to .html files in the 'render' dir
 - Protects against directory (path) traversal
2017-03-15 23:12:36 +00:00
35c78eee41 Update to 1.1.2 libtorrent requirement 2017-03-15 09:56:19 +00:00
5348465e60 Fix 1d1bb2a2a issue by defining init in DelugeRPCProtocol 2017-03-14 19:29:45 +00:00
1d1bb2a2a7 [#2964] Fix RPC TypeError using namedtuple 2017-03-14 18:02:33 +00:00
767503ad88 [#2979] Fix Deluge start error with missing entrypoints
- An ImportError is raised if a module is listed in the entrypoint
   but is not actually installed. The code will now catch this and
   will de-list the ui module that failed.
2017-03-14 17:22:58 +00:00
1e696fe6ca Fix type in manpage 2017-03-14 17:21:38 +00:00
90631cca88 Fix console test 2017-03-14 15:48:20 +00:00
50c476c41d Update man pages to reflect ui arg changes
- Also fixup help output details
2017-03-14 14:58:59 +00:00
8232505961 [#2996] [Console] Fix duplicate commands in help output
- The duplicate entries were actually the aliases for commands
   but the command name not the alias was being returned.
2017-03-14 14:57:53 +00:00
966678196e [WebUI] Use error logging and add exception message detail 2017-03-01 14:47:42 +00:00
11e8957dea [WebUI] Only accept application/json content-type requests
- Protects against CSRF (Cross-site request forgery)
2017-03-01 14:47:42 +00:00
ec5c8bafb6 [#2815] [Console] Fix 'add' cmd path inconsistency on windows
When adding a torrent with a download location from command prompt
2017-02-23 19:30:42 +00:00
fb8dc42acf [Core] Catch None type country in get_peers 2017-02-23 19:16:04 +00:00
4df88c0df3 [UI] Refactor appdata.xml code and markup translatable text 2017-02-23 19:02:32 +00:00
3529036f55 [UI] Add an appdata.xml file
For Linux software gallery integration.
2017-02-23 19:01:44 +00:00
f2b77c8635 [WebUI] Linting trailing comma 2017-02-23 16:52:06 +00:00
49e5611f65 Remove unicode_literal from plugins setup.py
There is a bug in Py2 setuptools where the build fails if unicode dict keys
 are passed to package_data:

    `package_data must be a dictionary mapping package names to lists of wildcard patterns`

 The easiest workaround is to remove unicode_literals use in setup.py as it is not that important.
2017-02-23 16:48:05 +00:00
d75afc007d [GTKUI] Parse u:p@host:port pasted into proxy or connection manager 2017-02-23 09:46:39 +00:00
b32c5d8247 [Daemon] Improve logging when another process is using listen port 2017-02-23 09:31:58 +00:00
b2db96e4df [Py2to3] Refactor out usage of unicode and basestring
- Python 3 renames `unicode` type to `str` and introduces `bytes` type.
 - Python 2.7 has `bytes` but is only an alias for `str` so restricted
   to comparisons but helps keep compatibility.
 - To test for unicode string on Py2 and Py3 uses the "''.__class__" type.
 - Remove usage of utf8encode and just encode, problems with bytes being passed
   in code will be picked up faster.
 - Where possible refactor out isinstance for try..except duck-typing.
2017-02-23 00:35:43 +00:00
52a85cb91c [Console] Fix showing file priorites 2017-02-23 00:30:56 +00:00
beb4f8c8f9 [Common] Rename decode_string to decode_bytes
- Switch to using Python 3 naming convention where str now refers to unicode
   and bytes are encoded strings.
 - Cleanup docs and code
 - Also rename convert_to_utf8 to utf8_encode_structure to clarify functionality.
2017-02-23 00:30:10 +00:00
3b1eeb0818 Use Ubuntu Trusty on Travis 2017-02-23 00:21:33 +00:00
9ad2f50fa4 [Common] Decode byte strings for TorrentInfo 2017-02-23 00:21:33 +00:00
bbd2661acb [WebUI] Fix missing low.png for file priority 2017-02-23 00:21:33 +00:00
b2a2995c0d [GTKUI] Use int not string number for select_path 2017-02-23 00:21:32 +00:00
5a9784ff4d Fix msgfmt for Python 3 and unicode_literal 2017-02-23 00:21:32 +00:00
ba41110c27 [WebUI] Markup byte strings for twisted request 2017-02-22 12:45:12 +00:00
608ecae5fd [Console] Use raw string for regex compile 2017-02-22 12:45:12 +00:00
04b8b14828 [Console] Use io.open to en/decode utf8 files 2017-02-22 12:45:11 +00:00
4619b31aa3 [Console] Ensure opening torrent files in binary mode 2017-02-22 12:45:11 +00:00
e3b8aaf276 [Tests] Markup byte strings to fix tests 2017-02-22 12:45:11 +00:00
1d9733014a [Core] Fixup maketorrent for unicode_literals
* Added a new convert_to_utf8 function to common that is handy for
   any nested dictionaries etc.
 * Small refactor to get rid of duplicate code and comment will be
   encoded by convert_to_utf8 function.
 * Passes test_maketorrent.
2017-02-22 12:36:33 +00:00
304ad1e72d [Lint] Add missing copyright header to files 2017-02-22 12:36:33 +00:00
ff6cec251a [Core] Markup byte-strings to fix httpdownloader and core tests
* Twisted methods require byte-string arguments.
 * The headers str conversion in httpdownloader _download_file was
   incorrent and left the dict key still as unicode so replaced with
   a dict comprehension (py2.7 requirement).
2017-02-22 12:36:33 +00:00
84802da29b [Py2to3] Force unicode_literals and fix related issues
* Added `from __future__ import unicode_literals` to every file so
   now all strings in code are forced to be unicode strings unless
   marked as byte string `b'str'` or encoded to byte string `'str'.encode('utf-8')`.

   This is a large change but we have been working towards the goal of unicode
   strings passed in the code so decoding external input and encoding
   output as byte strings (where applicable).

   Note that in Python 2 the `str` type still refers to byte strings.

 * Replaced the use of `str` for `basestring` in isinstance comparison as
   this was the original intention but breaks code when encoutering unicode strings.

 * Marked byte strings in gtkui as the conversion to utf8 is not always handled, mostly
   related to gobject signal names.
2017-02-22 12:36:32 +00:00
011afe3e89 [#2879] [OSX] Fix dyld error opening file from within Deluge
- Using DYLD_LIBRARY_PATH seems to have the unintended effect of making associated apps
   unusable (unable to locate dylds) when opening a file from within Deluge. The workaround
   for now is to switch to using DYLD_FALLBACK_LIBRARY_PATH.
2017-02-22 11:20:51 +00:00
b7162fab36 [#2956] Fix empty file_priorities with magnets 2017-02-21 10:37:09 +00:00
f6e2dab58a [#2826] Fix create_torrent filedump not encoded 2017-02-21 10:13:30 +00:00
4a62c5eac2 [Core] Switch move_storage flag to dont_replace 2017-02-21 10:10:57 +00:00
dd30bad96a [WebUI] Log successful logins with associated ip 2017-02-20 18:37:44 +00:00
c2c0fe86f9 [#2957] [GTKUI] Fix AttributeError in torrentview column sort 2017-02-20 13:28:36 +00:00
14d9b6cfcb Temp workaround for critical pickle trackers lt bug 2017-02-20 12:45:44 +00:00
df4d97c447 [Tox] Twisted version pin to 16.6
* There is a problem with Twisted 17 and the setup for travis and tox
   using site-packages with an old openssh package.

       AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'

 * The simplest workaround for now is to pin Twisted to 16.6.
2017-02-14 18:59:34 +00:00
a7826c4f90 [Core] Use fallback message for empty tracker error status 2017-01-28 15:23:08 +00:00
8c26c83c4d [#2960] Fix typo in storage moved alert 2017-01-28 14:27:27 +00:00
6b49f844dc [GTKUI] Fix showing cache status ratio 2017-01-26 12:49:56 +00:00
4a344e382b [UI] [Core] Update and refactor proxy settings
* Combine I2P into proxy settings.
2017-01-26 12:49:55 +00:00
108dd9e4b8 Add temporary libtorent git RC_1_1 branch requirement 2017-01-26 12:49:55 +00:00
b71a2fa549 [Tox] Remove py26 and add lt version output to trial 2017-01-26 12:49:55 +00:00
3ca012ee63 Change libtorrent minimum dependency to 1.1.1
* Change PPA to develop for Travis to use libtorrent 1.1
2017-01-26 12:49:55 +00:00
706d53ab4a [Core] Move readonly key setting closer to config init 2017-01-26 12:49:38 +00:00
2321f32f84 [Core] Fix double alert messages 2017-01-26 12:49:36 +00:00
d1dd35d4b1 [Tests] Suppress file descriptor limit warning 2017-01-26 12:49:27 +00:00
a5de64a19c [Stats] Update session status keys 2017-01-26 12:49:25 +00:00
5d7c1336b9 [Core] Use new lt torrent moving_storage status 2017-01-26 12:49:04 +00:00
93898d6475 [Core] Use single underscore for private methods 2017-01-26 12:49:02 +00:00
4caf05c092 [Core] Refactor torrent.set_file_priorities 2017-01-26 12:49:02 +00:00
6083a3078e [Core] Minor cleanup of preferencesmanager 2017-01-26 12:49:01 +00:00
0160bb1c91 [Lint] Fix pylint warnings in setup.py 2017-01-26 12:48:52 +00:00
e7ce389e84 [Tests] Fix test_ui_entry failure with libtorrent 1.1
- With libtorrent 1.1 dht is enabled from startup and the returned status
   contains DHT node values (i.e. non-zero). Should be sufficient to only test for start
   and end of the status string to be correct.
2017-01-26 12:48:50 +00:00
0f2083db62 [UI] [Core] Convert to session_stats_alert for session status
* Use session disk stats for cache status
2017-01-26 12:48:50 +00:00
3ed7202253 [Core] Remove deprecated lt torrent priority 2017-01-26 12:48:43 +00:00
089c0be89b [Core] Replace deprecated lt.fingerprint with peer_fingerprint setting 2017-01-25 12:35:33 +00:00
fc902af10c [Core] Remove all lt 1.1 deprecated code references 2017-01-18 14:19:37 +00:00
a481c4d243 [UI] Update UIs for new default piece priority
- libtorrent 1.1 changes default piece priorty to 4 so changes to
   the UIs are required. Some refactoring and improvements were made as well:

    - A new 'Low' priority introduced that is values 1-3.
    - 'Normal' priority is now value 4.
    - Removed 'Highest' with the addition of 'Low' and 'High' is now values 5-7.
    - Renamed 'Do not download' to 'Ignore' so it is more succinct.
    - Moved file priority constant to ui.common.
2017-01-18 12:33:27 +00:00
bb44411a50 [Core] Check valid torrent first in alert handlers 2017-01-18 12:33:26 +00:00
1e4a24c474 [Docs] Fix docstring return type format in config.py
* With new version of Sphinx 1.5 the warning below was generated, caused
   by incorrect formatting of return type in docstring.

     docstring of deluge.config.find_json_objects:None:
     WARNING: more than one target found for cross-reference u'start'
2017-01-12 11:13:28 +00:00
993a0f71af [UI] Fix usage of 'with Image.open' in tracker_icons
* Revert changes made to fix 'too many files open' as Image.open does
      not return a file descriptor and generated the following error:

          exceptions.AttributeError: 'NoneType' object has no attribute 'startswith'
2017-01-12 10:11:08 +00:00
283ad6137d Fix isfile() typo in setup.py 2017-01-09 18:02:28 +00:00
6743b0c813 [Core] Relocate add_torrent_alert to alerts section 2016-11-30 23:21:46 +00:00
b69ba02652 [Core] Refactor default add torrent flags into a constant 2016-11-30 23:21:45 +00:00
915f2bf9e7 [Core] Move alert logging to alertmanager 2016-11-30 22:53:18 +00:00
59b01b363c [Core] Refactor TM register of alert and set funcs 2016-11-30 22:53:18 +00:00
c5e623ae45 [Core] Refactor of priorities code and test 2016-11-30 22:53:18 +00:00
425af00ebf [GTKUI] Fix the translation of tracker status 2016-11-30 20:43:34 +00:00
373c8a14b0 [WebUI] Remove duplicated translation code 2016-11-30 20:43:29 +00:00
5f4a16630e Fix a typo in minify script 2016-11-28 19:20:05 +00:00
3260db416a [Core] Add a quick fix for lt1.1 default priority change 2016-11-28 19:18:48 +00:00
9cefbc6e5d [Setup] Refactor BuildWebUI class 2016-11-28 18:59:25 +00:00
14a5156e15 [Setup] Move package variables to top of file
- Refactor _data_files list so icons paths are auto-generated.
2016-11-28 18:58:45 +00:00
259c9f11e6 [Setup] Rearrange order of some classes 2016-11-28 17:44:22 +00:00
fd1261ab65 [Setup] Create a CleanTranslations class 2016-11-28 17:44:20 +00:00
37d9e1f8fe [UI] Move and rename util/lang to translations_util
- The name needed to be more descriptive of it's function.
 - Moved into ui directory because of upcoming  changes being made to setup.py
   meant it would be easier to include all the 'common' ui files if there
   are no sub-dirs such as 'util'.
2016-11-28 17:41:56 +00:00
a924cb73b0 [Setup] Fix wording and syntax in descriptions 2016-11-28 13:00:24 +00:00
3cbafec68d [Setup] Move deluge egg-info clean to Clean 2016-11-28 13:00:09 +00:00
a48c01c3a5 Cleanup up minify js script
- The slimit package is now widely available so make the script
   only rely on it and closure. Keeping closure as it makes the most
   compact and lints the javascript but it is not as easy to install
   as slimit.
2016-11-28 12:59:03 +00:00
7468078b71 [Setup] Add a CleanDocs class 2016-11-28 12:58:34 +00:00
98add5fecd [Lint] Fix issues raised by minify script 2016-11-28 12:58:27 +00:00
5e1603317a Revert "Rename version.py to calc_version.py to fix buildd error"
This reverts commit 943a9ded00.
2016-11-26 19:35:53 +00:00
943a9ded00 Rename version.py to calc_version.py to fix buildd error
- There is a version.py included with buildd that is conflicting
   with the deluge one. Rather than messing with sys.path it is
   simplest to rename version.py to calc_version.py
2016-11-26 17:51:07 +00:00
04370b38ec Revert "[Setup] Fix buildd error with version.py import"
This reverts commit 3aff57600f.
2016-11-26 17:10:13 +00:00
3aff57600f [Setup] Fix buildd error with version.py import
- The deb buildd command also has a version.py so need to use relative import
   to specify that we really mean deluge supplied version.py.
2016-11-26 16:36:31 +00:00
874249655d [Tests] Replace isort test with flake8-isort
* Move the known_third_party back to setup.cfg with comments.
2016-11-25 12:43:50 +00:00
7ebd69218f [Common] Fix is_ipv6 when using ipaddress module
* The ipaddress module require unicode string for 'packed' addresses.
 * Also include minor corrections to the tests.
2016-11-23 11:04:12 +00:00
0edebda1c7 [WebUI] Log correct http address if listening on IPv6 2016-11-22 22:07:03 +00:00
7283e8b668 [Core] Deprecate prioritize_first_last for prioritize_first_last_pieces 2016-11-22 20:45:58 +00:00
f3f380553a [Core] Fix KeyError if only file_priorities in options 2016-11-22 20:45:57 +00:00
4a9d2d2129 [Core] Decorate methods deprecated 2016-11-22 20:45:57 +00:00
cf343c21a8 [Base] Add new deprecated decorator 2016-11-22 20:45:57 +00:00
179de3b0ff [#495] Deprecate core.set_torrent_* for core.set_torrent_options 2016-11-22 20:45:57 +00:00
720d113a9a [GTKUI] Fix typo in About dialog if-statement 2016-11-21 21:47:07 +00:00
59c9584fe0 [GTKUI] Revert use of non-existent mainwindow.get_window method 2016-11-19 10:36:51 +00:00
674610ef7d [GTKUI] Use get_window for GdkWindow instead of attribute 2016-11-19 10:32:31 +00:00
b8135617ae Revert "[GTKUI] Add MainWindow.get_window() and replace window attr usage"
Made a mistake with types of window, get_window actually refers to GdkWindow
rather than GtkWindow... The use of self.window.window is confusing and is
still deprecated in Gtk3 so will fix that in following commit.

This reverts commit ccfe6b3c80.
2016-11-19 10:27:34 +00:00
6ac296118d [GTKUI] Replace decode_string with decode(utf-8)
* We know that GTK widgets will return utf-8 encoded so no need to decode_string.
2016-11-17 12:33:23 +00:00
ecf9822ac0 [Docs] Fix example and param notation in reST docstrings
* For future parsing into other docstring styles.
2016-11-17 12:33:23 +00:00
c1249a2f3a [GTKUI] Switch to non-deprecated GTK methods 2016-11-17 12:33:23 +00:00
36cbfa8c61 [Lint] Fix files to pass Flake8 v3.2.0 2016-11-17 12:19:41 +00:00
2657cc3921 [Lint] Quote cleanup 2016-11-17 10:19:59 +00:00
441861786b [GTKUI] Add decode_string to column name comparison
* Strings from GTK are returned utf8 encoded so require decoding if
   comparing with unicode strings passed around in python code.
2016-11-11 22:22:50 +00:00
0cdf0230e9 [GTKUI] Refactor gtk imports and code
* Where possible use 'from gtk import ...', i.e. if repeated often or under 10 individual imports.
 * Remove osx_check to not show svg. It's only an issue on Windows so should work fine...
 * Rearrange and deduplicate code into d.u.g.common for getting pixbuf from files.
 * Use 'from gtk.gdk import...' to make it cleaner to apply GTK3 changes in future.
 * Move generic icon code from torrent_data_funcs to common.
 * Fix pylint import warnings and add WindowsError to pylintrc file.
2016-11-11 22:21:51 +00:00
c8e6a4476d [GTKUI] Another update of methods to latest GTK2 API 2.24
* These updates make the code more compatible with GTK3
2016-11-11 14:08:25 +00:00
ccfe6b3c80 [GTKUI] Add MainWindow.get_window() and replace window attr usage
* In GTK3 the use of `window` attribute is no longer valid so need to
   use get_window(). This updates MainWindow to follow the same convention.
2016-11-11 14:08:25 +00:00
86549eb3ee [GTKUI] Cleanup references to MainWindow 2016-11-11 14:08:25 +00:00
243004c551 [GTKUI] Remove About dialog unneeded url_hook
* This is removed in Gtk3 and clicking url in Gtk2 still works.
2016-11-11 14:08:25 +00:00
8ba8aec277 [GTKUI] Listview use lambda func for set_default_sort_func
* gi complains about `None` value being passed to set_default_sort_func
   so for compatibility use lamba func that does nothing.

   There is an unanswered question on SO about how to set the default func to None in gi:
   http://stackoverflow.com/questions/20940324/how-to-remove-the-default-sort-function-from-a-treesortable
2016-11-11 14:08:25 +00:00
a5b07aa4ef [GTKUI] Update methods to latest GTK2 API 2.24 2016-11-11 14:08:24 +00:00
c619674cf9 [GTKUI] Import gobject module names directly 2016-11-11 14:08:24 +00:00
52d591c83b [GTKUI] Remove unneeded pygtk requires check 2016-11-11 14:08:24 +00:00
4313974f07 [Lang] Add fallback dll for Windows libintl 2016-11-11 14:08:24 +00:00
bde13515e6 [Common] Only attempt dbus import on non-Win/OSX 2016-11-11 14:08:24 +00:00
93ab2445a1 [GTKUI] Update version string in ui files 2016-11-09 15:01:44 +00:00
eea3cb0553 [GTKUI] Tweak spacing of main window tabs 2016-11-08 21:09:01 +00:00
6bd3c6fa88 [#2922] [Core] Fix using incorrect type for peer_tos in lt 1.1 2016-11-08 20:25:16 +00:00
b6e2ec3a3c [Core] Remove redundant utf8 encoding
* Should only be encoding in config.py and this is already occurs.
2016-11-08 20:16:59 +00:00
bbe9de9463 [Core] Disable apply_settings for enc policy until fix can be found 2016-11-06 00:14:07 +00:00
2bdbcf9a39 [#2922] Fix interfaces and outgoing ports for lt 1.1 2016-11-05 23:30:01 +00:00
fd80ed75fe [#2922] Fix proxy settings and torrent status for lt 1.1 2016-11-05 15:49:39 +00:00
0890cc1a33 [#2922] Fix session.apply_sessings alert_mask 2016-11-05 11:30:31 +00:00
e31acfc31c [GTKUI] Restart application when switching modes 2016-11-04 23:54:46 +00:00
d0d070aaf0 [Lint] Fix flake8 2016-11-04 23:54:23 +00:00
1e41891943 [Oops] Bugfix for previous commit: e37c817 2016-11-04 18:07:59 +00:00
e37c817151 [Lint] Refactor flake8 noqa's and add msg numbers
From pep8-naming:
 * N802: function name should be lowercase
 * N803: argument name should be lowercase
2016-11-04 18:03:21 +00:00
af6b277d28 [Lint] Add flake8-quotes to tox and fix bad quotes 2016-11-04 00:10:23 +00:00
3a2ff0c188 [Lint] Convert all python double quotes to single quotes
* A rather disruptive change but for a few reasons such as easier to read,
   easier type, keep consistent and javascript code uses single quotes.
 * There are a few exceptions for the automated process:
    * Any double quotes in comments
    * Triple double quotes for docstrings
    * Strings containing single quotes are left e.g. "they're"

 * To deal with merge conflicts from feature branches it is best to follow
   these steps for each commit:
     * Create a patch: `git format-patch -1 <sha1>`
     * Edit the patch and replace double quotes with single except those in
       comments or strings containing an unescaped apostrophe.
     * Check the patch `git apply --check <patchfile>` and fix any remaining
       issues if it outputs an error.
     * Apply the patch `git am < <patchfile>`
2016-11-03 21:45:45 +00:00
d4a8a38586 [Core] Refactor out duplicate prefsmgr log lines 2016-11-03 12:05:55 +00:00
a87ce825ad [Core] Remove old geoip.dat code and fix log line 2016-11-03 11:37:20 +00:00
ac011d7f55 [Tests] Remove deprecated pip cache setting from travis config 2016-11-03 10:45:01 +00:00
03c7a2b108 [Common] Refactor unit functions 2016-11-03 10:45:01 +00:00
ca83ed79c5 [Lint] Pylint enable simple-if-statement 2016-11-03 10:45:01 +00:00
54685226c4 [Tests] Remove redundant pillow dep from tox 2016-11-03 10:45:01 +00:00
61b059f015 [Lint] Fix couple of pylint complaints 2016-11-03 10:45:01 +00:00
f96b9c8a23 [Lint] Enable pylint warning super-init-not-called 2016-11-03 10:45:00 +00:00
d8242b4ef0 [Lint] Replace R with actual symbols in Pylint rcfile 2016-11-03 10:45:00 +00:00
f664fcb7a6 [Lint] Update pylint rcfile
* Merge in pylint 1.6.4 rcfile changes.
 * Add future_builtins to redefined-builtins-modules ignore list. (should be pylint default!)
	- Removed pylint disable comments from files.
 * Rearrange disable section, comments must be at start of line but can be
   interspersed to highlight categories.
 * Conventions enabled:
	wrong-import-position
	wrong-import-order
2016-11-03 10:45:00 +00:00
5c7a4549f7 [Tests] Add pillow dep so pylint parses Win32IconImagePlugin 2016-11-03 10:45:00 +00:00
a04718ebe5 [#2797][Lint] Enable no-init pylint warning 2016-11-03 10:44:48 +00:00
59d8fc9a14 [Lint] Fix pylint warnings 2016-11-03 10:31:38 +00:00
a438f13647 Rename classic to standalone 2016-11-02 23:14:05 +00:00
23ba57313a [Core] Support new libtorrent 1.1 alert and status attributes
* Keep deprecated lt attribute support for the interim.
2016-11-02 22:08:28 +00:00
7f24a1a42d [Core] Add support for new lt settings_pack 2016-11-02 22:08:21 +00:00
05566894ad [Core] [UI] Remove deprecated lt extensions
* These extensions have been deprecated in 1.1 so simply remove usage.
2016-11-02 21:55:53 +00:00
4dc59b5255 [Core] Remove compact allocation references
* This has been removed from lt 1.1 so no longer relevant.
2016-11-02 21:55:24 +00:00
08192033fb [GTKUI] Refactor piecesbar code 2016-11-01 14:27:50 +00:00
2f4cb0156c [Tests] Fix for isort config package handling
* Force gtk modules to be third_party for tox/travis testing.
2016-11-01 14:04:14 +00:00
e26a3dc0e7 [Tests] Move test torrents into data subdir 2016-11-01 12:28:08 +00:00
e827420569 [Tests] Increase file descriptor limit
Increase the file descriptor limit to avoid 'Too many files open'
error when running tests.
2016-11-01 12:28:08 +00:00
e379e035c7 [#2849] Fix WebUI error without translation MO file 2016-11-01 12:05:36 +00:00
6de2813c3d [#2784] Fix typo in bugfix 5f92810f 2016-11-01 11:57:11 +00:00
20bae1bf90 [Console] Rewrite of the console code
This commit is a rewrite of larger parts of the console code. The
motivation behind the rewrite is to cleanup the code and reduce code
duplication to make it easier to understand and modify, and allow any
form of code reuse. Most changes are to the interactive console, but
also to how the different modes (BaseMode subclasses) are used and set
up.

* Address [#2097] - Improve match_torrent search match:
  Instead of matching e.g. torrent name with name.startswith(pattern)
  now check for asterix at beginning and end of pattern and search
  with startswith, endswith or __contains__ according to the pattern.

Various smaller fixes:
* Add errback handler to connection failed
* Fix cmd line console mixing str and unicode input
* Fix handling delete backwards with ALT+Backspace
* Fix handling resizing of message popups
* Fix docs generation warnings
* Lets not stop the reactor on exception in basemode..
* Markup for translation arg help strings

* Main functionality improvements:
 - Add support for indentation in formatting code in popup messages (like help)
 - Add filter sidebar
 - Add ComboBox and UI language selection
 - Add columnsview to allow rearranging the torrentlist columns
   and changing column widths.
 - Removed Columns pane in preferences as columnsview.py is sufficient
 - Remove torrent info panel (short cut 'i') as the torrent detail view
   is sufficient

* Cleanups and code restructuring
  - Made BaseModes subclass of Component
  - Rewrite of most of basic window/panel to allow easier code reuse
  - Implemented better handling of multple popups by stacking popups. This
    makes it easier to return to previous popup when opening multiple popups.

* Refactured console code:
  - modes/ for the different modes
    - Renamed Legacy mode to CmdLine
    - Renamed alltorrent.py to torrentlist.py and split the code into
      - torrentlist/columnsview.py
      - torrentlist/torrentsview.py
      - torrentlist/search_mode.py (minor mode)
      - torrentlist/queue_mode.py (minor mode)
  - cmdline/ for cmd line commands
  - utils/ for utility files
  - widgets/ for reusable GUI widgets
    - fields.py: Base widgets like TextInput, SelectInput, ComboInput
    - popup.py: Popup windows
    - inputpane.py: The BaseInputPane used to manage multiple base widgets in a panel
	- window.py: The BaseWindow used by all panels needing a curses screen
    - sidebar.py: The Sidebar panel
    - statusbars.py: The statusbars
  - Moved option parsing code from main.py to parser.py
2016-10-30 12:45:04 +00:00
2f8b4732b4 [#2838] [Console] Fix formatting on 'Moving' color 2016-10-30 12:45:03 +00:00
79c59a2b1e [#2099] [Console] Fix: console does not support monochrome terminals
When a terminal does not support colors we invert the
default color pair white,black to indicate selection with
white background and black foreground
2016-10-30 12:45:03 +00:00
51c44a7c5a [Console] Remove the delay after pressing ESC key
The env variable ESCDELAY specifies the time in ms which ncurses waits
for a character sequence. With a default value of 1000, it produces a
1 second delay when pressing the ESC key to close dialogs.

Set this variable to 0 to get instant respons when pressing ESC.
2016-10-30 12:45:03 +00:00
64da09675e [#1119] [Console] ignore logging when no file specified
Add wrapper around the stream passed to the loggers streamhandler
when no log file is specified. Console in interactive mode now
ignores the log output with no logfile specified.
2016-10-30 12:45:02 +00:00
82fd5e6e8a [UI] Fix sorting in ui/util/lang.py.get_languages() 2016-10-30 12:45:02 +00:00
1e183a3258 [UI] Add gettext.ngettext to __builtin__.__dict__
Handle plurality with getttext using ngettext. Added to
__builtin__.__dict__ as _n
2016-10-30 12:45:02 +00:00
891209d925 [Common] Add overrides function decorator 2016-10-30 12:45:02 +00:00
4d3cf756e4 [#2914] Fix: Specifying file version for default config 2016-10-30 12:45:02 +00:00
27c87d56bb [Config] Sort the json keys in conf files 2016-10-29 13:26:56 +01:00
72c588ad33 [WebUI] Modify UI to display single incoming port 2016-10-28 16:01:18 +01:00
41fed16d08 [#2900] Fix Error loading torrent: invalid bencoded value
* Testing the torrent with other bencode libs doesn't raise exceptions
   so just revert the 'small fix' applied in b193d87499.
 * Add BTFailure exception so bdecode issue can be caught in deluge code.
2016-10-28 14:43:06 +01:00
5607bb3d61 [GTKUI] Move Tab data funcs to new common file 2016-10-27 23:10:27 +01:00
fab0af1b40 [Oops] Remove introduced dead code by prev commit 2016-10-27 22:33:17 +01:00
b5afe90764 [GTKUI] Rearrange items in the UI tabs
* Move Private label to Trackers Tab.
 * Move Owner to Options Tab with a future plan for a dropdown box
   to change ownership.
 * Put the torrent status message into the progress bar.
 * Remove duplicate Shared label in Details Tab.
 * Details Tab allow more horizontal room for long folder paths
   and fix horizontal scrolling.
2016-10-27 22:19:00 +01:00
fef160e7a7 [Common] Use log.warning instead of error for download failure 2016-10-27 22:17:29 +01:00
e408dc14cc [#2417] [GTKUI] Add Last Active and modify layout of Status & Details Tabs 2016-10-27 13:11:50 +01:00
257c31c05f [#2846] Fix splitting IPv6 from external IP alert message 2016-10-26 23:26:01 +01:00
3f72905b3f Revert "[Py2to3] Clean-up the use of keys() on dictionary objects."
This reverts commit 8b50f3cdbd.
2016-10-26 19:14:10 +01:00
c4282f29ab [GtkUI] Refactor out duplicate code in piecesbar draw pieces 2016-10-26 10:50:22 +01:00
642913b0f8 Revert "[Py2to3] Replace iteritems and itervalues"
This reverts commit 7ad8a3cbb5.
2016-10-26 10:49:41 +01:00
2c3887ece9 [Py2to3] Use open() instead of file() 2016-10-26 09:58:44 +01:00
9fab98a6ce [Py2to3] Passes libfuturize.fixes.fix_division_safe 2016-10-26 09:58:44 +01:00
81334389a9 [Tests] Fix tests to run on Twisted < 13
* Also includes pylint fixes for W0233(non-parent-init-called)
 * Remove failing openbittorent icon test
2016-10-26 09:58:43 +01:00
d579efa041 [Lint] Fix various pylint warnings and fixup code
* Use print function
 * Fix except as statements
 * Remove old twisted 8 code
 * Remove empty docstring
 * Refactor try statement to only contain the relevant import and
   disable pylint import msgs.
 * Use flake8 noqa and pylint comment and drop pyflakes workarounds.
2016-10-26 09:58:43 +01:00
da4b2b4849 [Py2to3] Make VersionSplit Python 3 compatible.
The builtin cmp() and the __cmp__() special method is no longer used in Python 3, instead we use functools.total_ordering decorator and the __lt__/__eq__ special methods to get the same effect.
2016-10-26 09:58:43 +01:00
da51e3a3d5 [Py2to3] A group of small compatiblity code changes
* Replace the uses of long with int.
 * Replace im_func with __func__ as it has been provided for Python 3 forward-compatibility.
 * Fix next/__next__ for Python 3 compatibility.
 * Remove the long number literal
 * Ensure freespace() returns int
2016-10-26 09:58:43 +01:00
837dae242c [Py2to3] Use future_builtins zip instead of izip for Py3 compat 2016-10-26 09:57:18 +01:00
7ad8a3cbb5 [Py2to3] Replace iteritems and itervalues
* Replace the use of iteritems() and itervalues() on dictionary objects
   with items() and values() respectively for Python 3 compatibility.
2016-10-26 09:53:32 +01:00
8b50f3cdbd [Py2to3] Clean-up the use of keys() on dictionary objects.
To make the code more Python 3 compatible, I've made a few changes to how we handle keys() or iterkeys() calls on dictionaries. All functionality should remain the same.

 * Remove the use of .keys() or .iterkeys() when iterating through a dictionary.
 * Remove the use of .keys() when checking if key exists in dictionary.
 * Replace dict.keys() with list(dict) to obtain a list of dictionary keys. In Python 3 dict.keys() returns a dict_keys object, not a list.
2016-10-26 09:53:32 +01:00
16da4d851e [#2850] Fix duplicate ui log entries 2016-10-25 23:22:06 +01:00
a5bc73f0b3 [GTKUI] Use less verbose units to improve look and gain physical space
* Use markup in gtkui to reduce font size of displayed units.
 * Reduced statusbar item sizes using markup and <small> tag. Provides an
   interim solution to #1326 and has reduced width from 930px to ~600px.
 * Integer value for Progress bar value in Peers and Files Tabs.
 * Remove trailing zeros for Pieces size in Details Tab.
 * Change position of Share Ratio in Status Tab.
 * Increase minimum width of column from 10px to 20px for listview.
 * Use shortform units e.g. Columns, Title speed, Status tab, Status bar.
 * Use less precision displaying values in columns.
2016-10-25 23:22:06 +01:00
258ad95b7a [Common] Enable use of precision and shortform units in unit funcs
* Also fixes #2562; add TiB unit.
2016-10-25 23:21:18 +01:00
75714b60ca [Docs] Clean module sources dir before generating docs
If old and outdated sources are present in docs/sources/modules,
python setup.py build_docs will fail to generate docs.
2016-10-21 10:36:24 +01:00
ca7cbd291f [#2861] [Core] Switch to using python-geoip for geoip lookups
* libtorrent >= 1.1 dropped support for GeoIP so this adds support
   again using MaxMind GeoIP Legacy Python Extension API.
   For reference it is known by the following package names:
       * Maxmind: geoip-api-python
       * Linux: python-geoip
       * PyPi: GeoIP
2016-10-21 10:30:52 +01:00
d77666cd3e [GTKUI] Tidyup to use more width and no eol backslashes 2016-10-21 10:11:08 +01:00
1755347878 [GTKUI] [Console] Modify UIs to display single incoming port 2016-10-21 10:11:08 +01:00
5978b433d3 [Core] Listening ports fixes and updates
* #2133 Add flags for port reuse and disable binding to system port.
 * #2122 For random port, use single port and store it for reuse.
 * #2343 Fix 'Invalid Arg' from listen_on, likely due to whitespace as interface value.
 * Consolidate listen_on and outgoing_port into single '__set...' methods.
2016-10-20 10:57:03 +01:00
37baf3de3c [#2875][Web] Fix: WebUI Json dumps Error 2016-10-19 10:47:41 +02:00
cfdddc4469 [Web][Tests] Refactor web tests 2016-10-19 10:47:37 +02:00
d505ebe926 [Tests] Use common.rpath() in all tests 2016-10-18 21:26:36 +01:00
c8a3fd72d4 [Tests] Improve UI entry script tests
* Added parameter log.setup_logger to prevent output noise in unit tests
2016-10-18 21:26:22 +01:00
9788ca08ea [GTKUI] Autofill infohash entry from clipboard
* Create new common.is_infohash func and test.
2016-10-18 19:22:59 +01:00
b4787235b5 [#2901] [GTKUI] Strip whitespace from infohash entry before checks
* Copy-pasting from web page can include extra space at end of string.
 * Also make minor change to populate the magnet name with infohash
   for nicer UI display.
2016-10-18 18:58:49 +01:00
9dd3b1617d [#2889] Fixes for 'Too many files open' error
* Ensure all file descriptors are closed. Using the with statement ensures
   closure.
 * The main problem was with thousands of unclosed file desciptors from
   tracker_icons mkstemp.
 * Use a prefix 'deluge_ticon.' to identify created tracker_icon tmp files.
2016-10-18 18:40:25 +01:00
58835eeb2e Refactor daemon check process functions 2016-10-18 18:22:31 +01:00
3a8ed2e9cb [Core] Change deprecated lt.version to lt.__version__ 2016-10-17 12:40:28 +01:00
6b630c9fd2 [GtkUI] Fix ZeroDivisionError in piecesbar
While waiting for metadata for a magnet, self.__num_pieces is zero.
2016-10-10 18:58:28 +01:00
db1b427b3f [Tests] Fix flake8 v3 searching .tox dir 2016-10-10 18:46:09 +01:00
aa164cdbce [Core] Fix AttributeError for removed load_country_db method in lt 1.1.1 2016-09-28 10:32:35 +01:00
9c27ed29ae [#2768] [GTKUI] [OSX] Fix invalid file error at startup
When installed to the system, not using .app, error is raised on startup
as nsapp_open_file is ignoring Deluge-bin but not deluge or deluge-gtk for
potential 'filename' when connecting NSApplicationOpenFile.
2016-07-21 00:29:14 +01:00
d2385e9c75 [#2857] [Notification] Fix issues with SMTP port input 2016-07-19 15:14:47 +01:00
01d27e22f8 [#2855] [WebUI] Unable to add UDP trackers 2016-07-19 11:49:00 +01:00
abf90f1dd6 [#2784] [Execute] Escape ampersand in args for Windows
Due to the nature of passing a command and args to cmd.exe and then
to a batch file in Windows any ampersands in execute args need to be
double-escaped so prefixing with tripe-caret (^^^&) is the fix for this.
2016-06-29 23:24:23 +01:00
53215d87ee [#2077] [Extractor] Ignore the remaining rar part files
* Bump version to 0.6
2016-06-10 15:33:04 +01:00
2d5dce4954 [#2785] [Extractor] Fix successful claimed extract leaving empty folder
* The main fix here is adding os.environ to the command call otherwise in some configurations
   the extraction would fail. Was unable to reproduce locally but users confirm this fix works.
 * Refactored the code to properly report errors if the extract command fails along with actual
   command output.
 * Bump version to 0.5.
2016-06-10 15:30:52 +01:00
7e229ceb2f [Tests] Combine echo lines into python cmd for tox docs 2016-05-25 11:06:48 +01:00
2a8388d262 [UI] Fix translation setup in console
Console was incorrectly setting up pygtk translation
2016-05-24 23:59:22 +01:00
4751b33d0c [Console] Fix to console argument parsing
When starting console with './deluge-console', providing
loggin level '-L info' would fail to parse as it identified
'info' as a subcommand.
2016-05-24 23:59:22 +01:00
98eb810f89 [Docs] Minor tidyup of docstrings 2016-05-24 23:53:37 +01:00
7c07001bdc [Docs] Make tox -e docs fail on sphinx warnings
* Also cleanup isort command
2016-05-24 23:53:37 +01:00
a81f17a802 [Tests] Improve test docs 2016-05-24 23:53:14 +01:00
dbadb9b0a6 [Core] Fix core.remove_torrents return value on error 2016-05-24 23:52:24 +01:00
c204b63653 [Docs] Make tox -e docs fail on sphinx warnings
* Also cleanup isort command
2016-05-24 21:10:53 +02:00
48240db813 [Docs] Fix docs in maketorrent.py 2016-05-24 21:10:53 +02:00
94a9f17838 [Tests] Improve test docs 2016-05-24 21:10:53 +02:00
5ca7bb365e [Tests] Use tests/common.todo_test to mark tests for TODO 2016-05-24 21:10:52 +02:00
260268f62b [Tests] Inherit from BaseTestCase in testcases
* Testcases in test_torrent.py and test_torrentmanager.py creates
  components and should therefore inherit from BaseTestCase.
* Cleanup in test_json_api.py
2016-05-24 21:10:52 +02:00
a8dac9bd3a [Base] [Tests] Add more component tests 2016-05-24 21:10:52 +02:00
d1acd964a5 [Base] Fix Component docs 2016-05-24 21:10:52 +02:00
5e493f2d3f [UI] Use a shared DEFAULT_HOSTS dict in ui/common
Instead of defining a DEFAULT_HOSTS dict for each UI
use a shared dict.
2016-05-24 21:10:52 +02:00
d65ebb80c6 [UI] Reduce ui.client log verbosity 2016-05-24 21:10:52 +02:00
b9f3f549a1 [UI] Add __contains__ to deluge/ui/coreconfig.py 2016-05-24 21:10:52 +02:00
67cefb1211 [Core] Add finished_time to torrent status 2016-05-24 21:10:52 +02:00
14b576e411 [Core] Fix core.remove_torrents return value on error 2016-05-24 21:10:52 +02:00
43edea01b7 [Console] Queue prefs updated 2016-05-23 15:31:23 +01:00
262c8d71d5 [WebUI] Queue prefs updated 2016-05-23 15:19:58 +01:00
80ee713893 [#2520] [GTKUI] Queue preferences page reworked 2016-05-23 15:19:20 +01:00
3837a2c5d6 [WebUI] Constrain dialogs to browser window 2016-05-23 15:18:34 +01:00
dc56e4557b [WebUI] Create more space by removing headers from Prefs dialogs 2016-05-23 15:05:51 +01:00
717ceee0ea [Tests] Update comments in tox.ini 2016-05-22 12:43:07 +01:00
5713ff09f4 [Docs] Autogenerate module docs with apidoc
* Add sphinx-apidoc to setup.py build_docs
2016-05-22 12:11:41 +01:00
b6b1d40516 [Tox] [Travis] Fixes to test config 2016-05-22 12:11:41 +01:00
152eaa10dd [Console] Fix bug when parsing UI commands
Command line arguments like "-L info" were incorrectly
identified as console subcommands which caused parsing
to fail.
2016-05-22 02:57:40 +02:00
d689ad72e8 [UI] [#1973] Improve passing extra args to UIs
Current solution for passing arguments to UI when invoking deluge
entry script is to select an UI with the --ui option and supply quoted
arguments with the --args option.

This patch cleans this up by removing both options and change to using
subparsers for valid UIs. All command line options are now parsed
directly by the child UI which is chosen by a positional argument,
i.e. the UI name.

The help text now also shows the current default UI.
2016-05-21 15:05:01 +01:00
d6fec88932 [UI] Move Gtk console entry point class to __init__
To avoid unnecessarily importing modules from gtkui.py, move Gtk
console entry point class to __init__.py. This reduces load time
when showing help (deluge -h) with many hundred miliseconds

Also cleanup unnecessary WebUI code.
2016-05-21 15:04:59 +01:00
fd9e68e7e7 [Tests] Place logfiles from py.test run in _pytest_temp 2016-05-19 22:20:28 +01:00
6971e08b0d [#2828] [Packaging] Fix ImportError with setuptools version > 18.8 2016-05-19 17:21:19 +01:00
cea50f319d [WebUI] Print error if minify script encounters error with closure 2016-05-19 15:47:15 +01:00
6ce9f77e17 [WebUI] Handle missing script files and fallback to available files
* To help user's encountering a blank web page, log warnings if script
files for a selected mode are missing and attempt to fallback to a working mode.
 * There is no logging for dev version detection to prevent spamming output.
 * Add slimit dependency to tox
2016-05-19 15:24:37 +01:00
0f43b564c9 [WebUI] Add WebUI build class to setup.py for minifing javascript 2016-05-19 15:22:45 +01:00
6bf906a849 [Lint] Use a shorter line length for isort 2016-05-18 10:55:01 +01:00
983ee7b973 [Tests] Raise minimum isort version to 4.2.5
The use of 'isort:imports-firstparty' in gtkui.py requires version >=4.2.5
2016-05-18 10:03:06 +01:00
bd7d10b81e [Lint] [WebUI] Fix issues raised by closure 2016-05-18 09:53:09 +01:00
876e70d85f [WebUI] Remove margins from main window elements 2016-05-16 13:44:00 +01:00
590f077963 [WebUI] Tidyup Add dialog margins 2016-05-16 13:27:00 +01:00
2aa1ab2f2b [WebUI] Revert broken refactor of theme css
By combining the background-* css styles into background it overrides background
settings in ext-all-notheme.css resulting in incorrect placement of grid header gif.
2016-05-16 12:37:08 +01:00
2e08599f82 [WebUI] Disable disabling WebUi plugin in WebUI 2016-05-16 12:37:08 +01:00
b450739333 [WebUI] Remove border in Prefs for cleaner look 2016-05-16 12:37:08 +01:00
e330ff0299 [WebUI] Tidyup prefs plugins details 2016-05-16 12:37:08 +01:00
6c233da2ff [WebUI] Case-insensitive sort for plugins list 2016-05-16 12:37:08 +01:00
fa309d0d18 [WebUI] Refactor json_api._get_host 2016-05-16 12:37:07 +01:00
9f187ed027 [WebUI] Add missing deregister event handlers 2016-05-15 21:30:25 +01:00
42e5876ebe [#2293] [WebUI] Fix plugins not loading when using WebUI plugin
- Any plugins that were started before the WebUI plugin would not be loaded
   upon starting the web server and would be not show up. The fix is to use
   web.pluginmanager.start to get all enabled plugins from core.
 - Update log message output for enable/disable in pluginmanager
2016-05-15 21:20:27 +01:00
46b726a4e0 [WebUI] Fix prefs plugins page not listing enabled plugins correctly
This fixes the display of which plugins are currently running. The old
code was returned a list of enabled plugins containing WebUI code so
switched to calling the entire list of a plugins from core.

Also updated the docstring in json api to reflect actual usage.
2016-05-15 21:18:16 +01:00
0278e782e0 [#2490] Add external IP to statusbar 2016-05-14 12:29:53 +01:00
bf8f71f215 [WebUI] Update gettext script to find any missed marked-up text
Added a new function to the gettext script that will check common
extjs attributes for missing markup text strings and print the result.
2016-05-14 11:16:28 +01:00
9adc9f886c [WebUI] Add missing translation markup 2016-05-14 11:14:17 +01:00
50d504a38f [AutoAdd] Fix watch dir not accepting uppercase file extension
- Auto-add feature will now accept torrents when the .torrent extension
   has capital letters in it
2016-05-12 17:41:07 +01:00
c2d7f3c653 [#2795] [GTKUI] Reduce height of Add Torrent Dialog
- Reduced height from 575px to 495px
 - Low resolution screen users (600px high) will be unable to click
the add button with a dialog height of >550px. Keeping the height
to less than 500px leaves more room for large size themes.
2016-05-10 15:11:10 +01:00
9e92178357 [GTKUI] Fix Add Dialog tooltip text needing escaped
- An ampersand in torrent name would cause the tooltip to not be
displayed.
 - Also switched from cgi to xml.sax for escaping.
2016-05-10 15:11:03 +01:00
42c3580bf2 [Lint] [Plugins] Fix all pylint issues 2016-05-09 22:11:14 +01:00
9237c931b2 [Lint] Update pylint to only allow LF line ending 2016-05-09 20:10:51 +01:00
1a62e00066 [Lint] Add Plugins and scripts to tox pylint 2016-05-09 20:10:51 +01:00
803d94c8ac Remove old wiki_docgen script 2016-05-09 20:10:51 +01:00
ac2bbd68db [Tests] Remove flake8 complextity from travis run 2016-05-09 20:10:51 +01:00
8160cef2b3 [Lint] Enable pylint 'not-callable' 2016-05-09 20:10:51 +01:00
c7fd8f5116 [Lint] Fix redefining filename in script 2016-05-09 20:10:51 +01:00
618d2f9f58 [Lint] Enable pylint 'bad-continuation' and fix issues
There is some discrepency between pep8 and pylint for line
continuation (https://github.com/PyCQA/pylint/issues/747) but
with some minor layout changes both can pass and code looks fine,
if not better in places.
2016-05-09 20:10:51 +01:00
807d7a7aaf [Lint] Fix pylint msg for rencode 2016-05-09 19:52:47 +01:00
416fb5e1e3 [#2832] [UI] Skip blank lines in auth file 2016-05-09 16:39:10 +01:00
1fb9960168 [Base] Updated fix for missing trace with new twisted logger
Includes a commented out test to replicate the issue.
2016-05-09 13:57:54 +01:00
919e41f55e [Lint] [GTKUI] Apply isort fix for fixed placement imports
This solves the requirement for deluge imports to be placed after
installing the twisted reactor.
2016-05-09 09:44:30 +01:00
616523c732 [rencode] Update module to v1.0.4 2016-05-09 09:27:50 +01:00
bb0e699619 [UI] Add tests for ui_entry 2016-05-08 12:00:44 +01:00
d5294d5733 [Tests] Fix json_api AlreadyCancelled watchdog error 2016-05-08 10:36:44 +01:00
3769d99532 [GTKUI] Fix silly typo 2016-05-07 00:52:47 +01:00
c7b272561e [#2827] [GTKUI] Fix issue with loading GTKUI columns state
commit 1a2ff9b089 introduced a bug when loading GTKUI
column states due to changing ListViewColumnState class type.

Fixed by reverting ListViewColumnState to old style class
2016-05-06 22:59:51 +01:00
21789e0692 [#2813] [GTKUI] Fix connection manager showing daemon offline in Windows
The daemon status is not retrieved when showing the connection manager at
startup on Windows and shows it as offline.

This commit restores the removal of simulate call in commit 058b0e41d2
but applies it only to Windows OS as there were no problems in Ubuntu testing.

It would suggest then that the issue is isolated to PortableGtkReactor
but the exact cause of the problem is still unknown.
2016-05-06 22:30:20 +01:00
1a2ff9b089 [Lint] Fix and remove old-style-class from ignore warnings 2016-05-06 12:44:45 +01:00
3ec8dc6858 [Lint] Remove warnings from .pylintrc
Remove warnings from ignore list in .pylintrc:
* super-on-old-class
* pointless-except
* non-parent-init-called
2016-05-06 12:44:45 +01:00
9be1bd523a [Tests] Cancel watchdog deferreds on test completion 2016-05-06 12:44:45 +01:00
1f191c3ce1 [Base] Fix incorrect use of defer.fail in component 2016-05-06 12:44:45 +01:00
91ed621ec8 [UI] Changed ui command description and help 2016-05-06 12:44:45 +01:00
6adbd14bf8 [Base] Add custom log observer to handle twisted errors
For some reason errors are logged by twisted as
'Unhandled error in Deferred', but without a following
stacktrace. This can happen in a deferred callback that e.g.
raises an ImportError. Without an excplicit error handler for a
deferred to log such errors, finding the error can be very tricky.

Fix this by using a custom twisted.python.log.PythonLoggingObserver,
PythonLoggingObserver, that also logs the traceback in addition to
the error message.
2016-05-06 12:44:45 +01:00
5826446509 [Lint] Fix pylint signature-differs warning 2016-05-06 12:44:45 +01:00
84d2d20e13 [Web] Pylint fix for WebUtils 2016-04-29 23:23:23 +01:00
3ed4c8d636 [Lint] Add pylint to tox run 2016-04-29 23:23:18 +01:00
c15931e6f6 [Tests] Rename pylintrc and ignore .tox dir 2016-04-28 23:34:18 +01:00
7c20ed777d [Core] Save fastresume file on separate thread
To avoid blocking twisted main thread, defer file saving task to
separate thread with deferToThread.

Only queue resume data save task on shutdown
2016-04-28 23:14:29 +01:00
5d0359331b [#2821] [UI] Fix missing parameter in baseargs init 2016-04-28 22:42:59 +01:00
b255fc40af [WebUI] Remove openssl check as already a requirement 2016-04-28 11:10:09 +01:00
7b523af05b [#2819] [WebUI] Handle CannotListenError for second instance 2016-04-28 11:09:53 +01:00
bd65abd3b4 [UI] [Core] Combine common process options into baseargparser 2016-04-28 11:09:53 +01:00
b4dd90ba2b Cleanup code in web and deamon entries to match 2016-04-28 11:09:52 +01:00
c274d5114c [#2818] [WebUI] Fix AttributeError starting WebUI on windows 2016-04-28 11:09:52 +01:00
c821cdd9c7 [UI] Fix unable to use uppercase log level 2016-04-28 11:09:52 +01:00
69871506e1 Improve order of args and wording of '--help' text 2016-04-28 11:09:39 +01:00
a99e29642c [UI] Restore short arg for version '-V' (deprecate '-v') 2016-04-28 11:09:26 +01:00
acdc19df1d Add translation markup to '--help' options 2016-04-28 11:07:26 +01:00
2bad04848c [WebUI] Update gettext.js 2016-04-25 15:41:47 +01:00
bf3d6ae24b [WebUI] Add refresh dialog for language change 2016-04-25 15:35:52 +01:00
2984e2dc5d [WebUI] Fix Interface page not saving with OK button 2016-04-25 15:35:21 +01:00
3b23f69786 [WebUI] Use Apply button to change password 2016-04-25 13:26:59 +01:00
9fbc63e6fb [WebUI] Tidy Interface page layout 2016-04-25 13:26:59 +01:00
cb158ca866 [Core] Add missing warn_msg arg to set_dummy_trans() 2016-04-25 13:26:59 +01:00
857e2fd46e [#1959] [WebUI] Allow user selectable GUI language 2016-04-25 13:26:58 +01:00
74f2f45fc0 [WebUI] Fix to gen_web_gettext 2016-04-25 13:26:58 +01:00
b76d208212 [UI] Added missing languages to languages.py 2016-04-25 13:26:58 +01:00
dea43da4d2 [UI] [Daemon] Re-add --fork option 2016-04-24 22:39:16 +01:00
d32796eab0 [WebUI] Reword doctring and update gettext.js 2016-04-23 23:13:11 +01:00
1a79d7c255 [WebUI] Remove unneeded translation markup 2016-04-23 22:40:17 +01:00
1afea60c6f [UI] Indent subsequent lines in argparse help 2016-04-23 22:10:29 +01:00
a49b459a59 [UI] Remove old twisted DeprecationWarning code 2016-04-23 22:10:29 +01:00
9a051b6979 [UI] Enable translation of argparse help strings 2016-04-23 22:10:29 +01:00
64ac5fdf73 [#2677] [Web] With --base option set, serve locally on new base path
When specifying the --base option to work with reverse proxy
the WebUI is no longer accessible locally since it listens
on the server root, but serves on the path specified to work
for the reverse proxy.
Change this to also handle local requests to the base path
such that the WebUI will be available both for the reverse proxy
as well as locally on the interface/port which the twisted sever
listens on.
2016-04-22 23:04:19 +01:00
ec366c840c [Core] Fix unnecessary delay when starting components 2016-04-21 14:44:48 +02:00
edf616baca [#2805] Fix: Standalone mode not detecting local running daemon 2016-04-21 12:39:31 +02:00
58bc8b6ec7 [#2808] Fix: Deluge Log File Not Working as Intended 2016-04-20 14:09:50 +02:00
2dea6ab5a5 [Tests] Add pylint target to tox 2016-04-19 22:14:28 +02:00
c3247396f7 [Stats] Fix to tests and deleted .test.py 2016-04-19 19:00:07 +02:00
f3bfe177ce [GTKUI] Fix gtk warning on shutdown 2016-04-19 12:05:03 +01:00
7c1f39d10e [Core] Minor change to magnet info_hash fix 2016-04-19 10:50:05 +01:00
cd6669c024 [#2790] Ensure base32 magnet hash is uppercase 2016-04-19 10:44:55 +01:00
5c69b56cd5 [Core] Fix adding magnets failing 2016-04-19 10:43:59 +01:00
90d1bbbb31 [Lint] Fix pylint issues uncovered by recent changes 2016-04-18 22:54:39 +01:00
e370d7dbdd [Web] Fix error in WebApi in standalone mode
In GTKUI standalone mode, WebApi.enable would try to connect to
daemon if web.conf had the 'default_daemon' option set, causing
the client calls to break.
2016-04-18 21:03:03 +01:00
38e0bc1257 [Core] Handle error when adding torrents to session at startup 2016-04-18 19:15:27 +01:00
47f14845ca [GTKUI] Fix #2802: GTKUI classic mode shutdown procedure is broken
Fix by leaving shutdown procedure to gtkui.py:
* Daemon no longer calls component.shutdown() in GTKUI classic mode
* Mainwindow no longer calls reactor.stop but instead fires a
  'gtkui_close' signal.
* gtkui.py installs custom SIGINT handler to initiate shutdown before
  stopping reactor.
2016-04-18 16:05:46 +01:00
70d8b65f0a [WebUi] [Core] Fixes to plugin handling and WebUi plugin + tests
This should fix problems with errors occuring when failing to
enable plugins. Errors in plugin handling are handled better
and properly logged.

WebUI plugin in particular had issues when being enabled and disabled
multiple times because it was trying to create DelugeWeb component
each time it was enabled. If deluge-web is already listening on
the same port, enabling the WebUI plugin will fail, and the checkbox
will not be checked.

There are still some issues when enabling/disabling plugins by
clicking fast multiple times on the checkbox.
2016-04-18 15:49:30 +01:00
5ebe14e452 [Core] Remove old twisted DeprecationWarning code 2016-04-18 15:47:17 +01:00
36ecd5625a [UI] Cleanup logrotate option
Keeps a consistent naming for log options
2016-04-18 15:42:24 +01:00
f036c1a6c5 [Core] Fix stdout object when stopping daemon 2016-04-18 15:29:52 +01:00
64c67a07dd [WebUI] Fix #2798: WebUI plugin fails to start 2016-04-18 12:01:02 +01:00
092d496944 [WebUI] Cleanup donotdaemonize 2016-04-18 11:56:38 +01:00
5edb923904 [Base] Split main.py into ui/ui_entry.py and core/daemon_entry.py 2016-04-18 09:36:20 +02:00
6300f9154a [#1949] [UI] Allow setting max size for rotating log file 2016-04-18 09:36:13 +02:00
c90af1ce6c [UI] Add --profile to GTKUI and console and allow custom filename
Add --profile to commonoptions making the option now available for
daemon and all UIs. --profile option now prints to stdout unless an
optional filename is specified.
2016-04-18 00:54:45 +02:00
7b54a2a1ee [UI] Replace optparse with argparse for cmd arguments handling
optparse is deprecation and succeeded by argparse. See
https://www.python.org/dev/peps/pep-0389
2016-04-18 00:53:37 +02:00
aa82efd4f1 [#1974] [UI] Decouple UI selection from core.
Add entry points into setup for each of the UIs and then use this
information to determine which client UI to run.

This ensures that custom UIs may be written and run without
the need to modifify deluge source code.
2016-04-17 13:51:40 +02:00
6343f32d70 [#1973] [UI] Standardize child cmd option parsing.
Handle child args and -a args in a common way so that all children
accept the same input format. Modify UIs to pass through setup
arguments to the base class.

Instead of launching the UI directly launch the UI via the _UI
subclasses in the same way that the scripts launch the clients.
2016-04-17 13:36:15 +02:00
b86a021042 [#1972] [UI] Remove ui.UI class
The only use of the ui.UI class is a base for Web which never calls
__init__ and at the beginning when choosing which UI to launch,
however that doesn't need to be an object.
2016-04-17 13:36:15 +02:00
7af8a4cf14 [#1971] [UI] Unify common cmd options handling.
Add a CommonOptionParser which handles the standard set of options
for all UIs.
2016-04-17 13:36:15 +02:00
38a480ac14 [Core] Revert "Cache items in get_filter_tree"
This reverts commit affe47a11c
as it causes the All filter state field to be zero in classic mode.
2016-04-17 12:13:49 +01:00
3b84eb635c [GTKUI] Fix torrents not showing in classic mode
Commit 5d1aff157e implementing async_add_torrent cause torrents
not to show in classic mode.
2016-04-17 12:13:49 +01:00
6287a782a1 [Lint] Fix Redundant use of assertFalse with constant value True 2016-04-16 18:24:20 +01:00
e468436b0c [Lint] Update pylintrc and fixup code for newly introduced messages
* pylintrc is now compatible with pylint 1.6.
 * Add to ignore wrong-import-position and wrong-import-order as
   we use isort and pylint is raising too many incorrect messages.
2016-04-12 14:12:21 +01:00
10e1a2a593 [Core] Catch exception on call to lt.listen_on() 2016-04-11 11:56:34 +01:00
194d1291e1 [Core] Emit ConfigValueChangedEvent only in started state 2016-04-11 11:56:34 +01:00
085dc76e41 [Core] Set default torrent status message
Torrent status message could remain None is some cases
2016-04-11 11:56:34 +01:00
b0b9180943 [Core] Return Deferred from rename_files and rename_folder
core.rename_files and core.rename_folder now returns a Deferred
that callbacks when rename is finished.
2016-04-11 11:56:34 +01:00
af6f2b2107 [Core] Allow renaming torrent to empty string to remove the folder 2016-04-11 11:56:34 +01:00
887afa9389 [GTKUI] Fix bugs in files_tab and added tests
After renaming files/directories in GTKUI, the file list wasn't
properly updated, requiring to choose another torrent to get
a file list update.
2016-04-11 11:56:34 +01:00
d84ffa50c3 [GTKUI] Fix bug in gtkui/common.reparent_iter() 2016-04-11 11:56:34 +01:00
eda493e525 [GTKUI] Improve error handling in torrent details
If status is missing a key required for a widget a KeyError
was not always caught.
2016-04-11 11:56:34 +01:00
712b2715d4 [Tests] Fix to json tests 2016-04-11 01:36:49 +02:00
d8c4d8c1aa [Core] Fix to async_add_torrent commmit (5d1aff15) 2016-04-11 00:43:58 +02:00
5d1aff157e [Core] Implement async_add_torrent in torrentmanager 2016-04-10 11:46:22 +01:00
73220b5116 [Lint] Fix issues picked up by scrutinizer 2016-04-10 10:58:57 +01:00
d58960d723 [Tests] [Web] Make JSON independent of Web component
* Implement JSONTestCase in test_json_api.py
* Implement WebAPITestCase test case in test_web_api.py
2016-04-10 00:10:53 +02:00
bcc1db12e5 [Tests] Improved common.start_core
* Replace Popen with reactor.spawnProcess and read process
  output with twisted.internet.protocol.ProcessProtocol
* Implement support for running custom script code
* Now logs to stdout instead of stderr when not logging to file
2016-04-10 00:10:48 +02:00
533951afea [#2724] [Web] Forward exceptions in JSON-RPC back to caller
Exceptions raised by calls performed by a JSON request would
not always be handled properly resulting in no reply to be sent
leading to browser timeouts.

Fix this by including the raised error in the JSON data of a
regular (successful) HTTP response.
2016-04-09 22:19:48 +02:00
93023c5bfc [Core] Fix bug and add error testing to AuthManager 2016-04-09 22:19:48 +02:00
9319e07db5 [Webui] Show user in connection manager 2016-04-09 22:19:48 +02:00
9b18fb2b71 [Tests] Fix failing SessionProxy tests
For some reason, the time.sleep calls in the tests in
test_sessionproxy did not sleep for the expected amount
of time causing the results to differ from the expected.
Fixed by replacing time.time function with twisted's
task.clock.seconds and advancing the clock manually.

Also minor changes to test_client.py
2016-04-09 22:19:44 +02:00
cae8a18437 [Tests] Fixes to improve terminal output from unit tests
Add __str__ to WrappedException so that the stacktrace is printed when a
unit test raises a WrappedException.

Change the log output from error to warning in DelugeRPCProtocol.dispatch
when sending back a raised exception on an RPC request.
2016-04-08 16:35:09 +02:00
374989a2ad [Tests] Catch and print errors in setup/teardown 2016-04-08 16:35:09 +02:00
fc6672adda Fix #2789: Test for google tracker icon redirect is failing 2016-04-07 22:11:25 +01:00
0b17b52c9a [Tests] Consistent tox config layout 2016-04-07 19:11:32 +01:00
9d13234e23 [Tests] Fix for flake8 in tox
Force install flake8 in tox to avoid the system flake8 being used if
available.

Remove unneeded whitelist entries
2016-04-07 18:44:20 +01:00
815f67467a [Tests] Update ubuntu icon, skip google & openbt icon tests 2016-04-07 09:52:33 +01:00
bebc414136 [Core] Ensure magnet name passed to lt in string 2016-04-04 02:02:28 +02:00
d91e5d894f Add command-line option for the daemon to restrict some config keys to being read-only.
This only affects the core.set_config() RPC method which will drop items if the key
is listed as read-only.
2016-02-02 19:25:46 -08:00
d13fca251e [Core] Defer save state function to separate thread
With large amounts of torrents, saving the state file becomes
a performance bottleneck, mainly due to the required processing
in pickle.dump. When run in the main thread, the server will
hang and be unresponsive for a significant time.

Solve this issue by running the save state job in a separate thread.
2015-12-14 21:35:55 +00:00
e632ca4418 [WebUI] Use the short-form copyright text 2015-12-14 13:39:41 +00:00
a987c3ed39 [Core] Raise AttributeError on RPC call to invalid function
Also catch and log errors in rcpserver.sendData
2015-12-14 12:08:18 +00:00
382a99ad61 [GTKUI] Cleanup code duplication in Tabs 2015-12-12 22:10:53 +00:00
50bde1a607 [Core] Cleanup duplicate version callback code 2015-12-12 21:46:28 +00:00
080d137af8 [Tests] Move test_torrent_error code into test_torrent 2015-12-12 14:29:07 +00:00
02f6bfd578 [#1260] Handle redirection better with httpdownloader 2015-12-11 22:48:36 +00:00
77aa540dc3 fix isort 2015-12-11 22:34:19 +00:00
1793e36127 [Core] Fix use of parent class parameter 2015-12-11 22:30:10 +00:00
979ad972fe [#2767] [Packaging] Don't include .py files in OSX App 2015-12-11 18:51:08 +00:00
ee7e632b94 [#2783] [GTKUI] Case insensitive sort for name column 2015-12-11 18:01:54 +00:00
075542e4a5 [OSX] Fix starting deluged from connection manager 2015-12-11 12:11:38 +00:00
c1902e4396 [#2782] [WebUI] Fix HTTPS negotiating incorrect cipher 2015-12-11 11:44:37 +00:00
aaac697a98 [WebUI] Remove old code 2015-12-11 11:39:16 +00:00
ac9e11d732 [Core] Ensure valid torrent state value after init 2015-12-09 22:24:23 +00:00
f36ecc470b [Core] Fix move_storage exception handling 2015-12-09 19:00:06 +00:00
bd14657055 [GTKUI] Revert remove_column change from 550ddc010 2015-12-06 16:53:19 +00:00
6892a00b86 [GTKUI] Implement show ownership option in GTKUI 2015-12-04 19:05:59 +00:00
620a4eb409 [Base] Catch and log exceptions raised in component.update 2015-12-04 19:05:59 +00:00
ad7a1ec89f [Core] Add ClientDisconnectedEvent 2015-12-04 19:05:59 +00:00
ca1eaa5e15 [Core] Add TorrentTrackerStatusEvent 2015-12-04 19:05:14 +00:00
431357f623 [Core] [WebUI] Increase RSA key size and improve hashing
* Replace weak hashing functions, key sizes, and random number
      generation techniques with less weak versions to prevent
      crashes when running with the fips module loaded.
2015-12-04 19:04:13 +00:00
7eb037b3f4 [GTKUI] Fix import mistake 2015-12-04 17:12:28 +00:00
c619f05f94 [Label] Fix gtk warnings when removing menu 2015-11-30 23:01:19 +00:00
550ddc0109 [GTKUI] Fix treeview columns not saving 2015-11-30 22:49:42 +00:00
eaae568c7c [Core] Update tracker_host when setting new tracker status 2015-11-27 13:54:07 +00:00
d932c3ab99 [GTKUI] Fix installing plugin from non-ascii path 2015-11-27 13:41:44 +00:00
803a33efde [GTKUI] Ensure drag-n-drop urlparsed path is unicode 2015-11-26 15:07:16 +00:00
227863faf7 [#2777] Update MSVC SP1 check to latest release CLID 2015-11-23 23:30:50 +00:00
0e1582702a [#2485] [WebUI] Fix unconnected Options in context menu 2015-11-23 23:19:21 +00:00
42b9f22a81 [GTKUI] Fix for flake8 2015-11-22 14:03:14 +00:00
7e971550de Set tox version==2.1.1 due to bug in latest tox 2015-11-22 13:58:37 +00:00
6cf0ef080b [GTKUI] Fix broken sequential_download in options tab 2015-11-22 13:54:47 +00:00
c796acf791 [Core] Remove int casting as args should be int 2015-11-15 14:14:12 +00:00
27bf05f2fe [#2738] [Core] Fix illegal argument with torrent_handle.set_max_connections 2015-11-15 14:00:52 +00:00
c62c604418 [GTKUI] Fix unselect error with treeview selection returning None
In standalone mode treeview.get_selection returns None resulting
in an AttributeError for call to unselect_all.
2015-11-15 13:22:06 +00:00
fc9bc2976f [GTKUI] Fix open dialogs preventing gtk app closing 2015-11-15 12:47:07 +00:00
058b0e41d2 [GTKUI] Remove old twisted and gnome code
* Can't see any issue removing the twisted similate call and it
   seems to already be done by gtk2reactor so duplicated.
 * The gnome die handled never appears to be called and most signals
   are handled by twisted so remove this code as well.
2015-11-15 12:44:19 +00:00
0a3404fa55 [GTKUI] Move imports to top 2015-11-12 23:29:03 +00:00
ac09caefac [UI] Add Python and OS info to version output 2015-11-12 23:13:37 +00:00
ed6355fe86 [GTKUI] Refactor rpc stats code 2015-11-12 23:10:37 +00:00
471276716b [GTKUI] Refactor shutdown signal code 2015-11-12 22:03:27 +00:00
b754f9f908 [Core] Add line numbers to non-dev logging 2015-11-12 18:56:30 +00:00
cde17925fc [Lint] Autopep8 aggressive run
* Uses isinstance() instead of type()
 * Uses sorted() where possible
2015-11-04 11:54:15 +00:00
05ab06e3a5 [Console] Refactor build_file_list()
* Remove usage of sys.maxint and rename variable to make method more readable.
2015-11-04 11:06:35 +00:00
f1e70829af Fix linting mistakes
Missed renaming file to _file. This commit now uses better naming with
some minor refactoring.
2015-11-03 19:43:29 +00:00
f500d78487 [#2775] Update state and fastresume save methods
* Issue introducted in a previous commit meant the state file is never
   saved when starting with a fresh config.
2015-11-03 12:39:50 +00:00
ed48c4a0c5 [Core] Remove return true for timer from save_state
Obsolete code for old gobject timer
2015-11-03 11:36:26 +00:00
1ff189c63a [Lint] Standardise except code
* Using 'ex' variable name for exceptions.
2015-10-30 18:40:03 +00:00
2583e9d888 [Lint] Code cleanup for PyLint run by prospector tool
* Fix for pluginmanager multiple inheritance which in this case is using super incorrectly.
 * Explicitly disable pylint 'pointless-except' and 'super-on-old-class' that prospector
   tool somehow runs.
 * Make __all__ a tuple to supress pep257 warning.
 * Add a noqa for older versions of pyflakes.
2015-10-30 18:39:57 +00:00
d280fa9fbd [Lint] Cleanup helper scripts to pass PyLint 2015-10-30 18:39:52 +00:00
807fa609f9 [Lint] Cleanup code to pass PyLint Warning category
Selected Warning messages disabled in pylintrc:
  * unused-argument: Quite a large and disruptive change if enabled.
  * broad-except: Most required in-depth investigation to determine type.
  * fixme: Not important
  * protected-access: Complicated to fix
  * import-error: Too many false-positives
  * unidiomatic-typecheck: Should be fixed in the next round of checks.
  * unused-variable: Again large and disruptive changes.
  * global-statement: Most usage is required.
  * attribute-defined-outside-init: Should be fixed in next round of checks.
  * arguments-differ: Possible false-positives, needs revisited.
  * no-init, non-parent-init-called, super-init-not-called: False-positives?
  * signature-differs: False-positives?
2015-10-30 18:39:47 +00:00
ad3cba929e [Lint] Cleanup code to pass PyLint Convention category
Disabled Conventions messages:
   * missing-docstring: Not likely all methods/funcs will ever have docstrings.
   * invalid-name: Far too many too fix so will simply have to ensure submitted
     or altered code keeps to the convention.
   * old-style-class: Not a priority but would be nice to eventually fix this.
   * bad-continuation: Occasionally conflicts with pep8, not worth enabling if using
     pyflakes and pep8 as these will catch most continuation issues.
2015-10-30 18:39:42 +00:00
3288353be0 [Lint] Cleanup code to pass PyLint Error category
Disabled:

  * no-member:
  * not-callable:
  * no-name-in-module:
2015-10-30 18:39:36 +00:00
6eb46c935e [Lint] Add PyLint support and cleanup code with basic changes
* Include a pylintrc config file
 * This commit provides a basic error-only pylint config as a starting
   point with a view to adding more checks incrementally to keep the volume
   of changes low and the code able to pass pylint at each stage.
2015-10-30 18:38:56 +00:00
58388419fb [Core] Fix mistake in clear_forced_error_state 2015-10-30 18:27:38 +00:00
4ae43c5f2a [#1032] Error out torrent if data is missing on startup 2015-10-30 15:28:20 +00:00
74f5dc0a76 Add fastresume_rejected_alert 2015-10-30 15:21:07 +00:00
f4dce731e9 [Core] Supress state warnings with fresh config 2015-10-30 14:35:47 +00:00
aedb59f854 [Console] Use utf8_encoded for non-interactive mode 2015-10-29 12:22:03 +00:00
3a03bb8dd7 [GTKUI] Don't display percentage for Error'd torrents 2015-10-29 11:50:18 +00:00
e232cd812a [WebUI] Fix missing return from pep8 changes 2015-10-22 23:15:30 +01:00
ebc00f3d7c Fix config for isort 4.2 2015-10-21 01:17:08 +01:00
32bc20d8ce Fix pep8 across codebase
* Further whitespace fixes by autopep8
 * Using pep8 v1.6.2 (not currently used by pyflakes)
 * Update config for pep8 and flake8 in tox.ini
   * A separate pep8 entry for running autopep8. The ignores prevent
     blank lines being added after docstrings.
   * .tox and E133 are ignored in flake8 by default.
2015-10-21 00:06:27 +01:00
82ac1bdfe0 Use xml.sax instead of cgi for escaping 2015-10-18 18:41:58 +01:00
56f5ce6ee1 [Tests] Properly test for DeprecationWarning in test_log 2015-10-18 15:36:58 +01:00
4803600734 Remove translation markup in pluginmanagerbase 2015-10-18 15:36:58 +01:00
76cc3e79b9 [Tests] Update plugin metadata test 2015-10-18 15:36:58 +01:00
14e775cbcf Fix missing js semi-colons and refactor CSS 2015-10-07 12:50:56 +01:00
005db434f8 [#2769] [WebUI] Simplified torrent file upload UX
Previously, the process for uploading a file in the Web-UI required three
steps. Click 'File' to open the 'Add from File' window.  Click 'Browse' to
select the file. Finally, click 'Add' to upload the file. These steps have
been combined into one, making the process much easier. Now, clicking 'File'
opens the file browser directly. After a file is selected, it is uploaded
automatically.
2015-10-07 12:25:04 +01:00
d4535c6164 [GTKUI] Store width and height of 'Edit trackers' dialog in config 2015-10-07 12:17:25 +01:00
dd3aeb45ea [Core] Cleanup a few docstrings in TM 2015-10-02 19:30:04 +01:00
e4ec248eb6 [Core] Mapped files fix and torrentid correction 2015-10-02 19:30:04 +01:00
cb8e9d3018 [Core] Move add tracker merge into Torrent method 2015-10-02 19:30:04 +01:00
50200326a9 [Core] Split-up complex tm.load_state 2015-10-02 19:30:03 +01:00
40c1597c67 [Core] Split create part of save_state into create_state method 2015-10-02 19:30:03 +01:00
d34705860a [Core] Updates to writing and deleting torrentfile
* Reduces the complexity in tm.remove
2015-10-02 19:30:03 +01:00
fb95d0ef58 [Core] Fix queue_top typo in tm.add 2015-10-01 12:31:46 +01:00
0838202892 [#2703] [Core] Stop moving files if target files exist 2015-09-29 23:37:14 +01:00
7f2e06d4e2 Bump minimum version for libtorrent to 1.0.6 2015-09-29 23:30:18 +01:00
824067e238 [Core] Emit TorrentStateChangedEvent in update_state 2015-09-29 19:39:32 +01:00
084329f9f1 [#2729] [Blocklist] Fix plugin lockup with empty url 2015-09-28 12:45:39 +01:00
e1548cc974 [#1330] [Core] Fix pausing and resuming session
* The paused state of torrents is now correctly stored on shutdown if the session is paused.
 * Resume session refreshes all the torrents' state. This fixes only torrents that changed state being
   updated so queued torrents would be incorrectly displayed as paused.
2015-09-28 12:39:51 +01:00
8241b2ba3e [Core] Return all plugin status keys with empty list 2015-09-28 12:20:35 +01:00
e5e4ab4e05 [#2236] [Core] Fix filter keyerror removing plugin 2015-09-26 19:15:02 +01:00
a26101d6b9 [GTKUI] [OSX] Fix empty scrolling status (systray) menu
* Same issue as seen on Windows in #302
2015-09-26 00:03:52 +01:00
24b8baf8cc [Travis] Disable broken TODO test 2015-09-25 18:17:29 +01:00
5a6ca707e0 Fix isort and flake8 tests 2015-09-25 18:16:29 +01:00
c9d4cd2e14 [#2435] [GTKUI] Prevent user changing selection when editing tracker 2015-09-25 18:12:11 +01:00
f96f47e463 [#2705] [WebUI] Fix hostlist not being created 2015-09-25 14:02:12 +01:00
037063f24e [#2765] Add support for TLS SNI in httpdownloader 2015-09-25 14:02:07 +01:00
ca9d0abe4b [GTKUI] Fix connected issue in connection manager
* If host was not an ip address then it would not show as connected
2015-09-25 14:01:46 +01:00
a2a074fb4f osx file in wrong location 2015-09-23 00:32:54 +01:00
07fa36aa58 [GTKUI] Revert column type to uint64
* Tested fine on linux but on windows generates TypeError as this
   data is long in standalone mode.
2015-09-20 22:53:41 +01:00
774157f9b6 Fix scalable icon path 2015-09-20 21:36:46 +01:00
9df3f7b50e [Tests] Fix torrentview test 2015-09-20 19:27:03 +01:00
2c5025644c Fix data_files in setup.py 2015-09-20 18:39:20 +01:00
7b7e61485e [#2762] [GTKUI] Use correct column types for data 2015-09-20 15:58:10 +01:00
0363dddbcc [#2763] [GTKUI] Fix unhandled error with invalid magnet uri 2015-09-20 15:55:36 +01:00
356f224a25 [#2764] [Scheduler] Fix corrupt plugin prefs page on osx 2015-09-20 15:52:14 +01:00
fbf5d5287f [Packaging] Minor osx updates 2015-09-20 15:50:22 +01:00
1557bf8882 [#2754] [GTKUI] Fix Deluge isn't sorting torrents properly 2015-09-18 23:07:15 +01:00
8485fd591b [#2402] [Notification] Fix popup to show actual count of files finished 2015-09-18 23:00:00 +01:00
f834ff6ec5 [Packaging] Updates to osx scripts
* bundle_contents now appends 'Contents' without adding it twice.
 * Remove reference to non-existent gdk-pixbuf.loaders
 * Separate libtorrent in new module.
 * Update lib versions for bundle file.
2015-09-18 22:59:52 +01:00
7fccfa0651 [Packaging] Updates to the NSIS Installer script
* New message box popup if VC 2008 Redist package not detected.
 * Add Start Menu page to choose where/if to install items.
 * Add desktop shortcut install option to finish page.
 * Clean up spacing and use consistent 4 spaces to indent.
 * Exclude as many unneeded pygame libraries as possible.
2015-09-18 22:31:39 +01:00
ff6b52edc6 [Win32] Fix output exes in bbfreeze 2015-09-13 22:53:28 +01:00
7532d4d333 Fix icon paths in setup 2015-09-13 22:50:53 +01:00
40c0c8ef6a [#2325] [Packaging] Fix uninstaller deleting non-deluge files 2015-09-10 14:24:32 +01:00
3eefc81d9d [GTKUI] Select first entry in edit trackers dialog on first show. 2015-09-10 14:21:44 +01:00
da80f7cbda [Core] Only fsync the directory if GNU constant exists
* Doesn't exist on Windows.
2015-09-07 11:30:30 +01:00
e75e65b2c1 [GTKUI] Default Plugin statusbar items to the end on startup 2015-09-07 09:22:51 +01:00
0a10c8f3bf [Scheduler] Show current speed limit in statusbar
* Intercepts the updates of the statusbar and displays plugin values when in Yellow zone.
 * Core fix for resetting speed limits to core.conf values.
2015-09-07 09:21:07 +01:00
e6a6c8342f [GTKUI] Improve statusbar spacing and hide empty text labels 2015-09-07 00:59:50 +01:00
dd764a09a8 [GTKUI] Remove old and unneeded code
* Notifications now handled by plugin so remove gtkui code.
 * path_join is better done by os.path.join and replace.
2015-09-05 23:18:56 +01:00
caf35bcdf4 [Packaging] Include WebUI debug files for dev versions
* Webui will try to use debug files if deluge version contains 'dev'.
 * Include webui debug files in sdist.
 * Use exclude_package_data to remove debug files in release versions.
2015-09-04 19:43:32 +01:00
d898ba9333 [WebUI] Refactor server.get_scripts
* The directory list is now sorted so will always produce the same output.
 * Code is now shared with minify script, with some minor changes.
2015-09-04 15:02:19 +01:00
da1c07ff99 [Tests] Fixes to make tests pass
* Fix GTKUI column types mismatch (broken by 239e679)
* Updated deluge/tests/google.ico
* Remove empty line in torrentmanager.py
2015-09-02 17:14:13 +02:00
0a12d1507e [WebUI] Fix i18n of Connect button 2015-09-01 16:19:18 +01:00
1acd6e4c1c [Core] Refactor add method in tm 2015-09-01 11:28:39 +01:00
7414737cbf Tweaks to fastresume and state file saving
* Using move is not atomic on Windows so delete and rename instead.
 * Open the file with no buffering
2015-08-31 15:47:38 +01:00
bb16af3731 [GTKUI] Remove old builder file 2015-08-31 15:44:23 +01:00
239e679fee [GTKUI] Fix date columns to use int not float 2015-08-31 15:33:41 +01:00
3767a9fd27 [GTKUI] Fix issue in torrentview where columns shared datafunc 2015-08-31 15:29:59 +01:00
ff1f64d9bc [GTKUI] Fixes for tooltip deprecation warnings and signal handler warning. 2015-08-31 15:27:20 +01:00
aa5b7e7595 [#2701] [GTKUI] Fix: Move Download Folder cancel button doesn't work 2015-08-31 15:41:42 +02:00
3b82059bdb [#2731] [GTKUI] Fix potential AttributeError in is_on_active_workspace
* Without being able to replicate adding the forced updated is the likely fix for 'win'
being None but also add test in case it's not...
2015-08-31 11:30:23 +01:00
520fc23371 [Console] Remove unneeded whitespace in config output 2015-08-28 17:19:11 +01:00
62a144c730 [#2333] [Console] Fix 'set and then get' in config command
* The get method was returning old config information so use correct
 core get callback.
 * Remove redundant deferred in set method
2015-08-28 17:18:41 +01:00
f4e5fb446d Update MANIFEST and .gitattributes
* Modify `git archive` to include all source code so that creating a
release source tarball is now done with `setup.py sdist` which uses the
MANIFEST.in file to determine files to be included.
2015-08-27 22:51:43 +01:00
9e13f671ee [GTKUI] Make Add Dialog torrent name editable
* Allows copying of name and future feature of changing the torrent
display name.
2015-08-27 22:26:17 +01:00
438d49be85 [GTKUI] Fix sensitivity of indicator radio buttons 2015-08-27 22:24:55 +01:00
e883bbf10b [Core] Do not remove components from component registry on shutdown
By removing the components after they shut down, KeyErrors are raised when
trying to acccess the component. Unit tests now clear the component registry
on tear down.
2015-08-27 17:16:32 +01:00
19d1afdce0 [GTKUI] Show magnet info in Add and Queued dialogs
* Use tooltip to show orginal torrent path or magnet uri
2015-08-27 13:21:24 +01:00
8345237dcc [Packaging] bbfreeze updates
* No need for data_files to be installed on windows
2015-08-27 11:27:49 +01:00
50f6f2d3ec [Packaging] bbfreeze tweaks and comments
* Reduce output from bbfreeze and add debug option to enable again.
2015-08-26 17:25:33 +01:00
4b3684bc5d [Packaging] Fix typo in bbfreeze 2015-08-26 12:08:06 +01:00
df3a3c77eb Fix travis build version issue
* version.py script requires git tags but detached HEAD in travis clone
   requires manually creating the RELEASE-VERSION.
 * Also fix relative path issue building docs.
2015-08-26 00:27:32 +01:00
a3073c44e2 Update minify script to use closure 2015-08-25 16:18:02 +01:00
489550fd7a [WebUI] Lint js files 2015-08-25 15:43:55 +01:00
7d679eb480 Updates to helper scripts
* Python 3 compatible
 * Consistent quote symbol
2015-08-25 15:43:55 +01:00
23cbd581db Use just Taiwan in countries list 2015-08-25 11:03:20 +01:00
0466c7144c [#1389] Fix data_files installed in wrong location 2015-08-24 23:46:12 +01:00
d2a2631a70 Flake8 bbfreeze 2015-08-24 15:55:14 +01:00
1c3e14919f [Win32] Refactor bbreeze script
* In setup.py put web and deluged back into console_script as the gtkui hack in
bbfreeze is a windows only issue for popup cmd windows showing.
 * Altered the bbreeze script to find any deluge scripts in pythonpath.
 * Use setIcon now in bbfreeze and use icon from package.
 * Use version stamp from pywin32.
2015-08-24 15:35:25 +01:00
0ee8c7d70f [#2736] [Win32] Add version info to exe files 2015-08-24 14:56:53 +01:00
c55a601db9 Fix version issue with no git repo 2015-08-24 14:56:53 +01:00
71b5e0a296 [#2758] [win32] Include _cffi_backend module in bbfreeze 2015-08-24 14:56:53 +01:00
a4844f7b77 [win32] Update packaging scripts
* Update directory paths.
2015-08-24 14:56:53 +01:00
f4cb062380 [#2734] Add 256x256 to deluge.ico 2015-08-24 14:56:36 +01:00
81b3c69465 [Core] Fix set_trackers to use lt >= 0.16 tracker format 2015-08-22 15:39:22 +01:00
a36d1f6219 Exclude binary translation files in sdist 2015-08-22 15:25:56 +01:00
d7029dcfc6 [WebUI] Improve the minify script 2015-08-22 14:27:17 +01:00
24b71a400f [WebUI] Improve the gen_web_gettext script
* Create a 'minified' gettext.js by removing comments from file and simplifying js code.
 * Added creating the file to generate_pot.py, so it is not forgotten about.
2015-08-22 14:26:56 +01:00
7cc14baae3 Remove glade from package_data entry 2015-08-22 12:21:58 +01:00
9c01c87bbf Update .gitattributes
* Update path for ignoreing tests directory.
 * The deluge-all and ext-extensions source code should not be ignored.
 * Remove entries for non-existent build script and debug js files.
 * Ignore the new packaging directory.
2015-08-22 11:52:51 +01:00
941e4d7c1f Remove old glade script 2015-08-21 09:59:08 +01:00
d96633f3f7 Create a packaging directory 2015-08-21 09:58:30 +01:00
05acddcc64 Revert "Remove generated javascript gettext file from git"
This reverts commit 522815d266.
2015-08-20 22:29:13 +01:00
5c05d3d7ea [WebUI] Cleanup stray whitespace 2015-08-20 19:37:29 +01:00
7af7ecd82a [#2008] [WebUI] Fix translation marked text
* Remove labelSeparator and manually add ':' so text matches gtk translations.
 * Use consistent quotes around strings. This can affect gettext script picking up
   marked strings.
 * Added the equivalent deffered translation as gtkui for Filters and Progressbar
2015-08-20 19:37:22 +01:00
522815d266 Remove generated javascript gettext file from git 2015-08-20 18:56:17 +01:00
90db2b4c5c Minor updates to the translation scripts
* General cleanup of code.
 * Add commandline folder option to js gettext script.
 * Include webui render html files to pot template creation.
2015-08-20 18:51:09 +01:00
8dd918f2a4 [WebUI] Fix i18n issue in Connection Manager
The status strings were incorrectly marked for translation which when combined with
some translations using 'connected' and 'online' as the same word resulted in
users being unabe to connect to running daemon.

 * Removed translation markup from json_api but left as original capitalised word in
case other third-party scripts do comparison on these status strings.
 * Added translation markup prior to displaying ConnectionManager using template.
 * Reworded password prompt and added translation markup.
 * Update gettext.js
2015-08-20 13:59:02 +01:00
b1df44cf05 Update author name as per request 2015-08-17 23:03:48 +01:00
bb5f20e3de [Tests] Fixes in test_tracker_icons.py
* Removed publicbt.org test as server is down
* Replaced ubuntu.ico with ubuntu.png to make the test pass
2015-08-14 16:45:23 +01:00
9d662bf059 [Tests] Fix code for isort 4.0.0 2015-08-14 16:45:23 +01:00
379ba33bb9 [Tests] Fix Xvfb for GTKUI tests running on TravisCI 2015-08-14 16:45:23 +01:00
a39ebae0cd [#2295] [WebUI] Increased lifespan of display settings
Display settings for the WebUI are persisted using cookies created by
Ex.state.CookieProvider. When no expiration date is provided, a default
value of (now + 7 days) is used. This causes display settings to be
lost frequently.

This fix adds an 'expires' parameter with a value of (now + 10 years).
This change does not affect the lifespan of the session cookie, which
is created by a separate system.
2015-08-14 15:58:18 +01:00
cbb60e3c3a Update man pages 2015-08-14 13:27:06 +01:00
6020809462 Minor cleanup of minify js script 2015-08-14 00:17:48 +01:00
4196912966 [#2730] Fix Deluge dev versions not starting
Using latest versions of setuptools (>11.3) resulted in deluge version strings
that contain 'dev' to produce a ValueError.
2015-08-13 23:04:01 +01:00
8c4154bc1a Fix the output of minify js script
The order of the js files matters when minifying.

 * Use the '.order' files to put specified files top of the file list.
 * Sub-directory files inserted in list before root directory files.
 * Sort everything else alphabetically for consistant ordering.
2015-08-13 23:04:01 +01:00
a391bbd67b Workaround for js files generating warnings with generate_pot script
With xgettext set to python it will parse the comments in javascript files, so
single apostrophes or quotes are flagged as 'warning: untermined string'.

This change just rewrites js comments to not use apostrophes.
2015-08-13 23:04:00 +01:00
576df1f6e3 [GTKUI] Improve About dialog copyright format for translators 2015-08-13 23:03:22 +01:00
4ba98c997a Remove stray tab in label plugin text 2015-08-09 12:19:24 +01:00
9726481fb4 [#2733] [Core] Fix on_alert_performance - UnicodeDecodeError 2015-02-23 12:43:27 +00:00
2c7bbc6ade Fix for Twisted 15.0 URI class rename 2015-02-23 12:35:45 +00:00
faf3f96322 [#2250] [WebUI] [Console] Use new core.remove_torrents method 2014-12-03 17:32:47 +00:00
08363f28dd [#2250] [Core] [GTKUI] Added method remove_torrents to core
Removing multiple torrents with remove_torrents will be faster
than calling remove_torrent for each torrent, as the state file
will be written only once, after all the torrents are deleted.
2014-12-03 16:46:24 +00:00
2aaae7c6a1 [#2406] [Core] [GTKUI] Implement core.add_torrent_files
* Speeds up adding multiple torrents
2014-12-03 15:36:06 +00:00
41f08e4e29 [#2702] [GTKUI] Fix potential markup warning in Details Tab
* Comments with HTML markup cause a GTK markup warning.
 * Use cgi function to escape '&', '<' and '>' to prevent pango markup error.
2014-12-01 13:50:39 +00:00
0ea6ad0669 [GTKUI] files_tab: sort by name by default 2014-12-01 10:59:09 +00:00
cdeb3c211b [#2670] [GTKUI] optimize file trees according to pygtk tips
Use a context manager to wrap the common steps:

1) disconnect the treestore from the listview
2) disable treestore sorting
3) add rows (different in add dialog vs files tab)
4) enable treestore sorting
5) connect model to listview
2014-12-01 10:58:49 +00:00
ea028c7531 [#2670] [GTKUI] addtorrentdialog: fix O(N^2) algorithm in add_files by recalculating folder state once instead of per-child 2014-12-01 10:58:42 +00:00
8d3ba87c63 Temporarily disable testcoverage in travis build 2014-12-01 10:52:16 +00:00
448261394f [Tests] Changes to tests and test configs of Travis/tox
* Added pip chaching
* Added disable_new_release_check to tracker icons tests
* Fixed test_torrentview
* Require minimum tox version 1.8
* Fixed GTKUI tests and testcoverage by using xvfb on travis
* Separated the apt dependencies for commands requiering GTKUI deps
2014-12-01 10:52:16 +00:00
8334bf9477 [Tests] Various fixes for unit tests and tox
* Added custom trial reporter for TODO with test example in test_torrentmanager.py
* Set Stats plugin tests as todo
* Disable new_release_check when running unit tests
* Added pytest.mark.slow to test_core.test_test_listen_port
* Get rid of unit test warnings (Caused by bad names in test classes)
* Removed warnings.filterwarnings in test files.
* Added separate tox target for generating test coverage HTML report.
2014-12-01 10:52:16 +00:00
178c417fb0 [Core] [Tests] Changes to component.shutdown and unit tests
* component registry shutdown() now cleans up the component list
  this ensures that no old components are left when running unit
  tests.

* Added class BaseTestCase that all tests that create components
  should inherit from. It verifies the compoent list before and
  after the tests are run.
2014-12-01 10:52:08 +00:00
a9e7aec5b6 [#2698] [GTKUI] Fix corrupted column indexes when using multiple col_types
* Ensures that removing multiple items from liststore_columns list does not affect the index.
2014-11-29 15:40:07 +01:00
a68d836beb [#2256] [GTKUI] Indexes aren't updated properly when removing columns 2014-11-29 15:40:07 +01:00
1e75b7bd12 [#2676] Add pilow and appindicator to DEPENDS 2014-11-25 19:04:58 +00:00
dd8d2c8557 [GTKUI] [Win32] Fix 'access is denied' with magnet association
* Issue occurs with user without administrator privileges
 * See github pull request #19 for details
2014-11-25 18:51:34 +00:00
aede6f9ce5 [WebUI] Add missing column entries to Torrent Record 2014-11-21 00:12:06 +00:00
376a92f554 [WebUI] Remove unneeded grid key and fix torrent record 2014-11-21 00:06:03 +00:00
cb37198a9d [WebUI] Modify SSL Context to allow >=TLSv1 protocol
* The TLSv1_METHOD is a fixed protocol version so this change will allow higher versions to be used where possible.
2014-11-20 15:19:18 +00:00
3689eb508e [#2555] [Core] Disable use of SSLv3 for DelugeRPC 2014-11-20 15:19:09 +00:00
af95fb0828 [Core] Remove old windows cache fix
This removes a fix for #1869 (using 0.15 lt) that is now fixed properly in 0.16 lt.
2014-11-18 10:13:55 +00:00
bdca70b330 [WebUI] Security update for POODLE vulnerability
WebUI with HTTPS enabled is vulnerable to POODLE (CVE­-2014­-3566), so switch from
SSLv3 to TLSv1.
2014-10-15 19:06:35 +01:00
bd2abb0127 Update copyright year in About dialog 2014-10-04 18:37:01 +01:00
d805f99534 [#2335] [GTKUI] Fix startup failing with 'cannot acquire lock'
This issue was caused by an unclean shutdown of Deluge, usually on system shutdown, and upon rebooting
the PID stored in the lockfile is in used by another process thus the lockfile is never removed. It
affects users with Deluge set in startup applications as the PIDs are more likely to be reused.

 * Lockfile is removed if Deluge is restarted in IPC.
 * Renamed the old_tempfile variable to make it clearer as to it's role.
2014-10-02 17:34:49 +01:00
11c6e387d5 [#2510] Fix config type checking 2014-09-28 10:33:21 +01:00
3b950094af [#2510] [Tests] Add config test for overwriting None value 2014-09-28 10:33:10 +01:00
dd8e37a6ce Workaround for the isort Travis issue by using order-by-type
See isort issue: https://github.com/timothycrosley/isort/issues/185
2014-09-26 13:06:11 +01:00
62a9e3921d Revert to isort diff output 2014-09-25 23:59:49 +01:00
bdf39c1e89 Switch from PIL to pillow for tox and rtd 2014-09-25 23:57:52 +01:00
784ecb94ea Fixes for flake8 and rtd 2014-09-25 23:10:22 +01:00
23ab85e253 Refactor/cleanup of tox.ini
* Removed unused mock dep
 * Modified flake8 to run entire codebase (fixed exclude)
 * Change isort to shows files that need attention (no diff)
 * Uniform layout for tox.ini
 * Change flake8 complexity to 15
2014-09-25 22:12:09 +01:00
bb9702910b Update docs tests 2014-09-25 22:12:00 +01:00
284b86ebb6 Fix running docs build from setup 2014-09-25 21:05:57 +01:00
3d4ea71dcf Fix isort config 2014-09-25 16:12:43 +01:00
b66f313c2d minor code cleanup 2014-09-25 15:56:05 +01:00
7e86b41f92 Add isort thirdparty config for Travis 2014-09-25 15:55:32 +01:00
fedca3167d [Docs] More fixes for testing with tox 2014-09-25 15:20:15 +01:00
6a5982f3ce Small fixes for Travis and isort 2014-09-25 14:25:03 +01:00
4472c37884 Disable plugins test due to Travis issue
An unknown issue with running the Stats plugins test on travis means it
never passes.
2014-09-25 14:13:18 +01:00
66f2739be7 Added .travis.yml (for travis-ci) and tox.ini files
Targets:

* Runs the unit-tests for python 2.7
* Tests unit-test coverage
* Try to build docs
* Code style checks:
  * flake8
  * isort

Codes changes:
* Fixed tests for httpdownloader (using tmp dir)
* Implemented a couple of tests for Stats plugin but they fail to run on travis

Issues:
* Can't get py26 to work because of installing libtorrent through apt and
  the option system_site_packages fails for 2.6.
2014-09-25 14:11:51 +01:00
8dc9a0773c Fixes for building docs 2014-09-25 13:43:43 +01:00
72493e6af3 [Extractor] Add Finding Win 7z Path via Registry 2014-09-24 22:41:18 +01:00
a26c5eb56e Merge branch 'Feature/win32_associate_magnet' into develop 2014-09-23 20:23:00 -04:00
14ee13bdd4 [GTKUI] Fix magnet association button on Windows 2014-09-23 20:22:24 -04:00
3b22dcadc9 Correction for Flake8 func rename in log.py
Broke the retrieval of logging lines.
2014-09-23 10:08:50 +01:00
b19845bf93 More fixes for previously overzealous changes to setup.py 2014-09-23 09:09:49 +01:00
f2d81ff542 Update headers and isort imports 2014-09-23 08:39:29 +01:00
966f10bcb7 Fix RTD badge in readme 2014-09-22 19:18:34 -04:00
8ba0e7ce0e [Extractor] Fix absolute/relative import 2014-09-22 18:35:13 +01:00
d9522261b1 [GTKUI] Allow the Tabs area to be resized smaller
* Tabs can now be scrolled if too many for height.
 * Change window_pane_position default to 235, based on default 480 window height.
 * Set the vpaned size before show call.
 * Reduce top padding and set bottom padding to 2, to account for decender letters.
2014-09-22 15:09:21 +01:00
83262afda1 Flake8 codebase
Fixes error E265 and E714 that have been added to newest version of pep8
2014-09-22 12:46:18 +01:00
142e96b246 Autopep8 E265 2014-09-22 12:46:17 +01:00
2f68092740 Flake8 add global __request__ to config 2014-09-22 12:46:17 +01:00
c115738535 Rename README to README.rst
Update rst formatting in readme
Add RTD and Travis badges to README
2014-09-21 14:28:59 -04:00
9b2283972c Add twisted and pyopenssl to rtd_requirements.txt 2014-09-20 21:48:46 +01:00
5537d59fb8 Fix typo in rtd_requirements.txt 2014-09-20 21:32:34 +01:00
18bcf2d588 Add requirements file for readthedocs sphinx extension 2014-09-20 21:24:11 +01:00
ebcf14df06 [Console] Fix import typos 2014-09-20 20:47:13 +01:00
9a801b4b93 Fix docstring errors raised by spinx docs build 2014-09-20 20:46:03 +01:00
6b7df9ca08 Add version fallback for sphinx build with readthedocs 2014-09-20 20:44:55 +01:00
5cc5d2e811 Fix overzealous changes to setup.py 2014-09-20 18:55:21 +01:00
a4edb0080b Fix for building sphinx docs 2014-09-20 18:43:09 +01:00
fc9017cfb1 Update with new license header 2014-09-19 19:21:42 +01:00
30a0f3c9ed Flake8 pass of entire codebase
* Use the inline '# NOQA' to supress N802 lower-case warnings
2014-09-19 19:10:14 +01:00
d0b8e17873 Add workarounds for isort
* Add workaround for unicodedata issue
 * Change line length to 120
 * Skip gtkui.py to stop it moving local imports above the install reactor line
2014-09-19 15:58:43 +01:00
b8ab6e4083 [Tests] Replace module import with sys.modules 2014-09-19 13:40:39 +01:00
09c6e0cb5c Remove gtkui specific func from path_chooser_common 2014-09-19 13:39:50 +01:00
6e0e01225e [Plugins] Fix relative imports to use dot notation 2014-09-19 13:39:50 +01:00
268c8d608c [WebUI] Add reduce import for Py3 compat 2014-09-19 13:39:50 +01:00
fbcddff6ea [WebUI] Replace func_globals with __globals__ for Py3 compat 2014-09-19 13:39:50 +01:00
08b61eb50b Change imports to use absolute paths 2014-09-19 13:39:41 +01:00
45ef6ac56d [Console] Flake8 all files 2014-09-18 17:23:52 +01:00
a68c3140af [GTKUI] Fixed incorrect column for searching in treeview 2014-09-10 12:50:45 +01:00
91943ba7e3 [WebUI] Small fixes to text labels 2014-09-04 10:41:48 +01:00
403fdb31a1 [WebUI] Fix isort error in auth 2014-09-04 10:40:57 +01:00
20b05ae595 Remove unneeded ez_setup and 'isort' imports 2014-09-04 00:37:57 +01:00
5167e93d12 Flake8 core and common files
* Added N802 to flake8 ignore as certain inherited funcs cannot be changed
   to lowercase and this unresolved warning hides other errors/warnings.
 * Include new header
2014-09-03 23:48:34 +01:00
5d88504c34 [GTKUI] Fix isort error in gtkui 2014-09-03 23:30:14 +01:00
3315768b27 [GTKUI] All files Flake8'd and use new header 2014-09-03 23:30:14 +01:00
b5dcfc6f9e Sort/prettify imports with isort 2014-09-03 18:27:32 +01:00
1ca08ccf95 [Python-Modernize] Replace im_self with __self__ 2014-09-03 17:22:39 +01:00
fc7a136c70 [Python-Modernize] lib2to3.fixes.fix_numliterals 2014-09-03 17:22:39 +01:00
e24e5916e0 [Console] Replace set with list 2014-09-03 17:22:39 +01:00
4afd2513fa [Console] Fix typo in info 2014-09-03 17:22:39 +01:00
7cdedbea1f [Python-Modernize] libmodernize.fixes.fix_raise 2014-09-03 17:22:39 +01:00
38bc5d07f0 [Python-Modernize] lib2to3.fixes.fix_ws_comma
* Fixer that changes 'a ,b' into 'a, b'.
2014-09-03 17:22:38 +01:00
3a53f4002a [Python-Modernize] libmodernize.fixes.fix_print
* Replaces print with print()
2014-09-03 17:22:38 +01:00
1e6c811768 [Python-Modernize] lib2to3.fixes.fix_except
* Use 'ex' instead of 'e' to conform with pylint
 * Minimal Flake8 on some files
2014-09-03 17:22:38 +01:00
95f859673e [Python-Modernize] lib2to3.fixes.fix_has_key 2014-09-03 17:22:38 +01:00
682acc11ec [Tests] Update ubuntu icon 2014-09-03 17:22:21 +01:00
ec8d48f4fd [GTKUI] Tweaking layout of Status and Details Tabs 2014-09-02 12:48:02 +01:00
4f3fcac2bf [GTKUI] Add padding to count in sidebar 2014-09-01 22:24:19 +01:00
430f9c01d7 [#2472] [GTKUI] [WebUI] Add anonymous_mode UI prefs 2014-09-01 22:08:48 +01:00
184d6be98d [#2472] Add support for anonymous_mode 2014-09-01 21:57:09 +01:00
2a50159978 [#2497] [GTKUI] Fix the queue 'Clear' button not properly clearing. 2014-09-01 21:31:17 +01:00
5a6f202cf1 [GTKUI] Rework the sidebar layout
* Changed variable names to be less confusing.
 * Flake8'd.
 * Move the 'count' to a separate render cell.
 * Reduced size of expander icon to make it less intrusive.
 * Enabled ellipsis on labels so count is still visible.
 * Used pango markup on cell labels and count.
 * No longer set a fixed colour to fix #1193.
2014-09-01 19:25:44 +01:00
e97140cbde [GTKUI] Reduce status tab border to 1px 2014-09-01 19:06:02 +01:00
ecb4f0e9da [#2496] [GTKUI] Fix updating core_config before setting default options
* Remove duplicate entry in init.
 * Call update if empty config and prevent potential loop in update method.
 * Ensure that the queue Add button is sensitive, even when automatically adding.
2014-08-31 14:50:55 +01:00
57b594041a [#2493] [GTKUI] Fix TypeError if active workspace is None 2014-08-25 16:30:19 +01:00
2df2f882e0 Use list comprehension in get_file_progress
Should be slightly quicker with large numbers of files.

Also moved socket import to the top as it will always be imported.
2014-08-24 11:01:37 +01:00
da254a80cf [GTKUI] Add associate magnet reg in Windows 2014-08-24 10:51:47 +01:00
4ad45b2d4a No need to use get_status in Torrent class 2014-08-23 22:22:09 +01:00
a9293285a0 Flake8 rencode
Fixes a function declared twice and a few indentation issues
2014-08-23 22:22:09 +01:00
b4b58380b6 Refactor Torrent _get_pieces_info method
Code is now easier to read and should be a bit faster
2014-08-23 22:22:09 +01:00
48f79dbfca [GTKUI] Move 'Add Dialog' prefs to Download tab
Also includes more tweaks to layout for consistency and creating space.
2014-08-22 22:02:09 +01:00
5c82c144cf [GTKUI] Convert the appindicator option into a radio button 2014-08-22 22:01:23 +01:00
849101950f [GTKUI] Tidyup Preferences Dialog
* Remove unnessary page headers to save space
 * Reordered pages to be lightly grouped
 * Other changes to utilise space better
 * Fixed the plugin info panel collapsing on startup
2014-08-22 17:41:19 +01:00
210acf68c1 [GTKUI] Change tabs from top to left side 2014-08-22 17:41:13 +01:00
6bbb9832e9 [GTKUI] Remove icons from Tabs 2014-08-22 17:40:57 +01:00
1bc92ed3e3 [GTKUI] Move Piece colour chooser below checkbox 2014-08-22 17:40:25 +01:00
6496383e82 [GTKUI] Reorganise layout of tab items and add Tracker tab
* Changed layout of Status, Details and Options tabs.
 * Moved the Tracker translations to ui.common.
 * Created a new Trackers tab.
 * Added State to progressbar.
 * Translate State in piecesbar.
2014-08-22 14:43:37 +01:00
14776d86f5 Remove duplicate i2p_proxy entry 2014-08-21 13:41:33 +01:00
1de0c30bb0 Disable SSL listen port 2014-08-21 13:40:07 +01:00
b296803e01 Use int function to cast proxy type 2014-08-20 16:58:25 +01:00
68b893fa02 Log errors for invalid interface values 2014-08-20 16:55:07 +01:00
05792809b5 [GTKUI] Strip whitespace in the interface entry box 2014-08-20 16:34:43 +01:00
068cce353a Code cleanup for core files 2014-08-20 15:10:59 +01:00
82f2fc67c2 [Notifications] Small layout fixes for web page and version bump 2014-08-19 16:28:21 +01:00
b77c4682d1 [#1310] [Notifications] Add webui prefs page 2014-08-19 16:12:56 +01:00
42b3edff64 Fixed bug in Blocklist WebUI pref page 2014-08-19 16:12:55 +01:00
83c0f8a16e [WebUI] Fix tracker_host mistake 2014-08-19 15:48:25 +01:00
af9fa15636 Replace use of status key 'tracker' with 'tracker_host' in UIs
* Status key tracker can be empty so use tracker_host instead, also tracker_host
   is nicely formatted.
 * Remove unneeded tracker_host string from tracker_status.
2014-08-19 15:39:12 +01:00
061590665e Remove obsolete set_state method 2014-08-19 15:39:12 +01:00
49ed3db352 Replace try statement for LT_TORRENT_STATE_MAP lookup 2014-08-19 14:31:00 +01:00
32330f99fc Flake8 core files 2014-08-19 14:22:19 +01:00
a2c3fb3d5e [WebUI] Flake8 files
* Does not pass cleanly due to camelcase function names and __request__ global.
2014-08-19 13:01:18 +01:00
069d820d39 [WebUI] Cleanup of css files
* Consistent indent and line endings
 * Remove unused redo icon
 * Minify extensions css
2014-08-19 12:52:03 +01:00
1700b75cfe Fix firing of Finished event when moving 2014-08-16 22:49:13 +01:00
64d06f5650 Fix showing wrong state for finished torrent 2014-08-13 22:45:53 +01:00
97533145a7 Revert "Fix strange resume_data bug causing fastresume not save on shutdown"
This reverts commit 2449f5b99e.
2014-08-13 21:32:46 +01:00
8c6758720d Replace pause_all with pause_session
* Replace pause_all and resume_all with pause_session and resume_session
 * Pausing all the torrents individually loses the original paused status
   so use the libtorrent session pause instead.
 * Added a SessionPausedEvent to the method.
2014-08-12 18:21:12 +01:00
d0718df82b Refactor torrent.update_state 2014-08-12 00:31:00 +01:00
f81cc81e20 Add --sort option to deluge-console's "info" command. 2014-08-10 17:45:14 +01:00
79023eb5c6 Add seeding_time, active_time and tracker_status to deluge-console's "info" command. 2014-08-10 17:37:41 +01:00
35f7526c2a Fix spelling error in deluge-console output. 2014-08-10 17:32:16 +01:00
f8eede78ca [AutoAdd] Add Skip Hash Check option 2014-08-10 14:27:47 +01:00
a38186857d Flake8 Autoadd 2014-08-10 14:27:47 +01:00
66ae8bdd5c [#1294] [GTKUI] [WebUI] Add Skip File Hash Check
* Altered the core code so that seed_mode is now a torrent option.
 * Made some minor improvments to the Add Dialog
2014-08-10 14:27:47 +01:00
d108091511 [GTKUI] Remove dialog focus should be on Cancel button 2014-08-10 12:08:47 +01:00
29a05978ec Flake8 addtorrentdialog 2014-08-09 23:40:59 +01:00
7e4d50b406 Fix for Indicator icon label issue 2014-08-09 22:16:36 +01:00
90419a4f2d [#2450] [WebUI] Fix empty Peers tab
Also fix missing flags and tracker icons.
2014-08-09 21:54:47 +01:00
8cc96d9b89 [GTKUI] Cleanup Standalone/Thin client dialogs 2014-08-09 21:54:47 +01:00
dc7a4df39a More changes for consistent naming of download location 2014-08-09 15:04:14 +01:00
a1bc11ec09 Consistent naming of torrent download location to Download Folder
* Replaced the deprecated use of torrent status save_path with download_location.
 * UIs now use 'Download Folder', replaces 'Save Path', 'Download Path', '... Storage', etc.
2014-08-09 00:39:29 +01:00
711962da84 Flake8 files_tab 2014-08-09 00:39:29 +01:00
c5f7eeaacb [#2098] Add function to highlight the torrent folder/file
* Will show/highlight a file path in system file manager. *nix uses dbus with an xdg_open fallback.
 * [GTKUI] Open Folder still opens the download location but now shows the torrent data file/folder
 * [GTKUI] Files_tab now has a second menu item 'Show' to show a file's location
 * The open_file and show_file functions now use timestamps on *nix so that windows open in front, this fixes recent desktop changes that prevent windows randomly stealing focus.
 * Removed utf8 decode for Windows. All paths should be unicode
string, any resulting errors should be traced to source and corrected.
2014-08-09 00:39:28 +01:00
670cd21685 [GTKUI] Suppress unimportant gnome warnings 2014-08-09 00:15:47 +01:00
9ba07d3883 [GTKUI] Fix showing the open_folder menuitem
The menuitems would disappear and not reappear if switching between localhost
and remote daemons.
2014-08-09 00:07:08 +01:00
713e264061 Fix for moving progress with no data downloaded 2014-08-08 19:26:37 +01:00
21f18a75bb codepaint plugins js files 2014-08-04 23:48:35 +01:00
3e610ec5ba [#2470] [Console] Fix console parsing args
This negates the need for quoting a single command with an arg e.g.
    deluge-console del --remove_data torrrent_file

Multiple commands separated by semi-colon still require quoting.
2014-08-04 22:27:30 +01:00
e8288eec6a [WebUI] Update from config upon showing plugin page 2014-08-04 22:26:21 +01:00
936ae3b171 [Blocklist] Flake8 and bump version 2014-08-04 18:44:53 +01:00
834d30f85f [#2478] [Blocklist] Add WebUI plugin page 2014-08-04 18:44:52 +01:00
231c17f6a9 Clean up remove dialog handling a bit more 2014-08-03 21:27:46 -04:00
acf2ad2f0c Fix the remove with data checkbox not working in gtkui 2014-08-03 21:06:12 -04:00
59f82f204f Oops, accidentally renamed a variable 2014-07-31 23:20:38 -04:00
02cfc40e94 Fix move completed sometimes not moving finished torrents 2014-07-31 23:16:30 -04:00
b9338a639e Fix issue restoring torrent state 2014-07-31 22:09:23 -04:00
205444f670 [WebUI] Fix json import 2014-07-22 23:34:19 +01:00
480347296b Fix a mistake in tm finished alert 2014-07-19 20:08:47 +01:00
7b53486821 Use stdlib json
Some flake8 changes and DEPENDS tidyup
2014-07-19 11:32:17 +01:00
49c2be40ab Use flush_disk_cache as a shutdown marker
This is a hacky fix for waiting_on_resume_data not being empty on
shutdown. This issue needs further investigating.
2014-07-18 13:25:50 +01:00
a65603e10c [#1032] Keep track of torrent errors over restarts
* Add error_statusmsg to TorrentState
 * Adds a new set_error_statusmsg() method to force torrent error state.
 * Any torrent in error state will remain in that state on restart with
   additional message in status.
 * Any new libtorrent errors will override manually set ones.
2014-07-18 13:08:47 +01:00
7393d31208 Refactor TorrentState to build the class attributes 2014-07-18 12:46:56 +01:00
c82164c522 [#2161] Save magnet torrent_info to 'copy of' location
When magnet metadata is received a torrent file will also be written
to 'copy of' location if requested.
Modified the code for saving torrent file to state in Torrent class for
use by TorrentManager.
2014-07-18 00:35:26 +01:00
e30e2ef2c3 Fix mistake in convert_lt_files 2014-07-18 00:03:11 +01:00
9347a78482 Refactor and tidyup code in torrent.py 2014-07-17 21:55:57 +01:00
25c7e40574 [#2347] Add orig_files to core 2014-07-17 21:55:51 +01:00
739d8f329a [#1859] [GTKUI] Improve layout of Remove torrent dialog
* Using Shift+Del will now pre-select removing files.
 * Will now show the name of the individual torrent being removed or the
   total count if multiple torrents selected.
2014-07-17 00:12:23 +01:00
2449f5b99e Fix strange resume_data bug causing fastresume not save on shutdown 2014-07-17 00:11:15 +01:00
b3e323462c Change logging of 'creating backup' to debug level 2014-07-16 21:25:05 +01:00
bf9bd267fd Fix typo in loading peers_tab state 2014-07-16 18:21:30 +01:00
8685c7a604 Show actual error in status from storage_moved_failed_alert 2014-07-16 18:07:12 +01:00
62cca045be [#637] Add a Moving storage state along with progress
Uses attr Torrent.moving_storage for now but can be replaced with
future lt1.0 status field.
Refactored the code to use the common.TORRENT_STATE list.
Added a translating dict to ui.common to aid translation of state text.
2014-07-16 17:43:12 +01:00
bd119bccf4 Fix move storage dialog not closing 2014-07-16 17:43:11 +01:00
8920db694c Use true division 'from __future__ import division' 2014-07-16 17:43:11 +01:00
d51ad7718c Update TorrentManager docstrings and remove old load_torrent method
Passes flake8 and mostly passes pylint
2014-07-15 15:26:35 +01:00
e66c854be5 [#2238] [Scheduler] Fix undefined this.scheduleCells 2014-07-13 23:07:29 +01:00
cd8bef964a [Extractor] Tidy plugin code and add webui page 2014-07-13 14:12:31 +01:00
4d5e01abef [#1290] [Execute] Add TorrentRemoved event 2014-07-13 14:12:31 +01:00
7b44980912 [#1126] [#2322] Emit FinishedEvent after moving storage complete
Also changed the Execute and Extractor plugins to process the updated
FinishedEvent functionality.
2014-07-13 14:11:47 +01:00
7c22135bb4 [Execute] Tabs to spaces 2014-07-12 21:38:28 +01:00
21691c5cc1 [Extractor] Replace module which with twisted.python.procutils.which 2014-07-11 18:59:52 +01:00
533bdd398a [WebUI] Fix missing ext-extension files in build 2014-07-10 15:29:34 +01:00
98b54e6682 Rewrite the webui minify js script in python
Also replaced minifier 'yui-compressor' with pure-python 'slimit'.
2014-07-10 15:05:52 +01:00
5eba762a20 [GTKUI] Fix text typo and mark for translation 2014-07-09 19:39:29 +01:00
27682cb666 [#2464] [GTKUI] Fix unable add trackers in createtorrentdialog 2014-07-09 18:52:40 +01:00
67873f39dc [#2418] Fix WebUI error when adding non-ascii torrent
json.dumps attempts to decode (utf8) the 'path' entry which had a
alternative encoding. The solution is to ensure the 'path' entry is
utf8 encoded and remove the unneeded 'path.utf-8' entry.

As self.__m_metadata["info"]["files"] is updated the later code
checking and decoding the 'path' entry can be removed.
2014-07-08 15:32:03 +01:00
7aa52e5f1b Prevent private flagged torrents auto-merging trackers
When adding a torrent already in session any new trackers are merged
to the exiting torrent but this is an unwanted feature for private
flagged torrents.
2014-07-07 23:33:45 +01:00
c31c1b00b1 [#2315] [GTKUI] Potential fix for lost window on Win32 2014-07-07 23:33:36 +01:00
52db7df6d8 [GTKUI] Typo causing password dialog to show 2014-07-07 19:59:59 +01:00
c05fa40756 [GTKUI] Flake8 mainwindow 2014-07-07 19:07:35 +01:00
5fdaf73fdf [GTKUI] Fix quitting bypassing password lock 2014-07-07 18:56:47 +01:00
30e5fc83b2 [#2369] [GTKUI] Fix bypassing tray password dialog
Created a generic password dialog and moved the unlock code out of
systemtray so any call to window.present will now show the dialog.

Also fixed the appindicator not showing the correct visible status
2014-07-07 18:49:32 +01:00
4afd1fa91d Remove old sha module import code 2014-07-05 19:43:07 +01:00
c5722011e8 Pylint alertmanager 2014-07-05 16:50:14 +01:00
02592e1b5e Set alert_queue_size in AlertManager and add logging 2014-07-05 16:50:14 +01:00
ccec01b729 Minor tidyup of core code 2014-07-05 16:06:59 +01:00
6c295cd314 [#2466] [AutoAdd] Fix Copy Torrent File 2014-07-04 21:55:44 +01:00
a9274d4b52 Remove old unneeded send_redundant_have session setting 2014-07-04 21:28:03 +01:00
0a7e02bf34 [GTKUI] Hide the associate magnet button on OSX 2014-07-04 20:49:16 +01:00
19bc0fb468 [#1490] Increase the Alertmanager interval to 0.3s
The original 0.05 interval is causing excessive idle cpu usage
2014-07-04 19:15:00 +01:00
d8a00cf517 [Tests] Update ubuntu favicon 2014-07-02 19:42:57 +01:00
48fb321699 [#2463] [AutoAdd] Fix not loading torrents
The owner attribute for tm.add() method was moved to options dict
2014-07-02 19:32:38 +01:00
f1a9e2ae32 [#2462] [GTKUI] Fix clicking Edit Trackers button in Options tab 2014-07-02 18:29:51 +01:00
2c66f21cc1 [#2461] [GTKUI] Fix createtorrentdialog cell_data_size error 2014-07-02 18:20:44 +01:00
dfed6af0c0 Fixes to resume data saving routines.
* Avoid saving resume data unecessarily by checking the queue of calls
* Removed unecessary LoopingCall for resume data
2014-03-10 14:03:06 +00:00
dbf4f67c55 Update gitattributes file 2014-03-10 13:57:24 +00:00
66b54d6a27 [WebUI] Flake8 web.py 2014-03-06 19:50:40 +00:00
30705d6fc9 [WebUI] Changed --profile to use cProfile 2014-03-06 19:46:27 +00:00
6c74e2d19c [Tests] Fixed tests so that if the tcp port is used, other ports will be tested 2014-03-06 19:08:35 +00:00
973e2d2ef8 [GTKUI] Fix call on sessionproxy.get_torrent_status with bad argument 2014-03-06 19:03:12 +00:00
067ca38321 Update MANIFEST for webui file movement 2014-03-03 19:06:16 +00:00
bc7380c5d7 Add flush_disk_cache parameter to save_resume_data
Using this flag avoids potential issue with file timestamps and
is only needed when stopping the session.
2014-02-25 19:00:50 +00:00
f2535e196d Let save_resume_data build torrent list on stopping session
By having the func build the list we can skip torrents that we already have
resume data for (need_save_resume_data is False).
2014-02-25 18:57:59 +00:00
ea7ef950a3 [GTKUI] Add new OtherDialog to dialogs
This adds a new OtherDialog to dialogs so that will use Deferred to prevent
the dialog loop locking up the mainwindow.
Remove old `Other` dialog from common and cleanup up the file.
Fixes #2401, context menus for torrents not showing current value.
Fixes #2400, add a stop_at_ratio context menu.
Change the protocol rate to display as int.
2014-02-23 18:36:23 +00:00
813261df07 Update internal listview state when saving to disk
Fixes remembering sort column
2014-02-22 14:54:37 -05:00
56d216adf7 [WebUI] Fix typo in statustab 2014-02-22 18:09:26 +00:00
60e60427fc Fix for github code language detection
Moves the extjs framework into subdir that will be ignored by
github's Linguist library so that Deluge is detected correctly
as Python.
2014-02-21 22:39:25 +00:00
49d4bb4969 [#1908] [WebUI] Add bind interface option for server 2014-02-21 18:09:56 +00:00
9eb6b7c52a [WebUI] Fix custom VType 2014-02-21 18:08:06 +00:00
3d4acf7d37 Update docstrings in torrent.py 2014-02-21 10:35:31 +00:00
5e2f6b0f40 Update comment and flake8 listview.py 2014-02-20 19:16:53 +00:00
881da401e1 [GTKUI] Fix column added after restore order func 2014-02-20 19:16:12 +00:00
9290cc1f7a Fix building the code documentation with sphinx
Updated Sphinx conf and tested with Sphinx 1.2.1
Moved webui gen_gettext script
Fixed docstring warning in code
Renamed console update-tracker to update_tracker
2014-02-20 17:38:51 +00:00
c64da3ceb4 Fix missing import, pep8 2014-02-19 23:46:53 -05:00
fff75b51ce [#2373] [OSX] Fix laucher scripts for single leading slash path
On Mavericks the application path passed to scripts only has single leading slash
compared to previous double slash.
Renamed and changed shebang to bash to prevent any issues.
Updated README to rst format for display in trac wiki.
2014-02-19 19:03:53 +00:00
eb804c2a4a Remove debug log line from prev commit 2014-02-19 10:20:22 +00:00
cb87509e4f [#2082] [WebUI] [Console] Validate interface entry for IP address 2014-02-18 21:07:07 +00:00
8d74c3f22a [WebUI] Fix errors from rearranging code in 2294670 2014-02-18 20:46:53 +00:00
22946700dd [#2310] [WebUI] Fix unicode password support
hashlib requires UTF-8 encoded string
Passes flake8 but with warning for global __request__
2014-02-18 00:27:39 +00:00
32d5a0bab2 [2374][WebUI] Fix right-click selection issue 2014-02-17 22:59:10 +00:00
f415fa1a7e [WebUI] Add moved gettext file 2014-02-17 22:03:44 +00:00
66e01991d6 [GTKUI] Rearrange the Status and Details tabs 2014-02-17 22:02:55 +00:00
09b5d2252c remove unneeded gettext line from setup 2014-02-17 16:56:30 +00:00
4a917c95ab [WebUI] Move gettext.js into js dir 2014-02-17 16:52:43 +00:00
65e1f16163 [WebUI] Remove compressed web js files from repo 2014-02-17 16:52:16 +00:00
226d2bb964 [GTKUI] Remove leftover old code 2014-02-17 14:28:55 +00:00
aa5e5178d3 [WebUI][Console] Add missing columns and statuses
Rename 'Seeders' to 'Seeds'
Hide seconds from fdate unless wanted
'Last Seen Complete' renamed to 'Complete Seen'
Added columns and status for Completed date
Rename 'Seeders/Peers' to 'Seeds:Peers'
For translation added colon to WebUI status strings to match GTK
2014-02-17 14:12:32 +00:00
43f12ffdd4 [Console] Reorder prefs tabs to match gtk 2014-02-17 12:53:49 +00:00
14a55133af [#2219] Update the UIs for single Proxy and I2P Proxy 2014-02-17 01:38:02 +00:00
fa0911dbdf Convert proxy config from multi to single setting 2014-02-16 18:39:01 +00:00
a5fa5d0451 [#2219] Add i2p proxy setting to core 2014-02-16 18:34:38 +00:00
59a29d5288 Add sequential download option to webui 2014-02-16 06:12:37 +00:00
67e9787ba1 [#1923] Add pre-allocation and remove compact allocation
Compact allocation is deprecated and a new pre-allocation is available.

Any torrents already using compact will continue to do so but any newly
added only can use sparse (default) or allocate options.

The UIs have been updated to only display a checkbox in preferences for
the user to enable 'Pre-allocate disk space'.
2014-02-16 06:12:37 +00:00
4486592f04 Fix comment quotes changed by previous commit 2014-02-16 00:45:39 +00:00
2ae9a4bdbb Very large refactor and cleanup of torrent.py
Use new docstring format and added to all funcs
Pylint and flake8 fixes; only a few warnings remain for pylint
2014-02-15 23:04:58 +00:00
7dceb629ca Add name to torrent options 2014-02-15 09:27:46 +00:00
0aed074796 Move owner to torrent options 2014-02-15 09:26:08 +00:00
a9ed6fe46a refactor torrent.set_options 2014-02-15 09:26:08 +00:00
1d68579b57 Mark set_torrent_* methods deprecated 2014-02-15 09:23:18 +00:00
f66274fd9d Remove unneeded old 'public' option code 2014-02-12 11:09:39 +00:00
0a001f98e3 Add torrent bandwidth priority to core 2014-02-11 19:57:07 +00:00
0531276b9b [#2417] Add time_since_download and time_since_upload to torrent status 2014-02-11 16:52:14 +00:00
2be5474f3a [#2082] Validate ip address for listen_interface entry
This ensures that only ip addresses are accepted for
listen_interface as libtorrent cannot accept interface
names (eth0) and will cause unexpected results for user.
2014-02-11 16:37:41 +00:00
bddfb2a5c6 Change get_default_download_dir to use expanduser as fallback 2014-02-09 19:27:39 +00:00
dc0000059b GTKUI: Ensure None value from problem config is empty string for set_text 2014-02-09 19:20:06 +00:00
72753a9ccb Fix common.free_space to handle path is None 2014-02-09 19:16:34 +00:00
b193d87499 Include small upstream bencode fix and flake8 file 2014-02-03 13:37:22 +00:00
d9ce4ff634 add comment to tracker_error_alert handler 2014-01-30 13:19:21 +00:00
01ee181607 Fixed glade missing signal warning in path_combo_chooser 2014-01-30 12:01:00 +00:00
2c4af8f136 Fix empty message for certain tracker status errors
By design alert.msg will be empty if the error code is '-1' so use
a.e.message() to get the message as fallback. It was not used at
replacement because when error code is not '-1' then a.e.message()
will also include the error code, which we do not want.
2014-01-30 11:58:04 +00:00
ff8b5aca75 Fix crash if translations are missing 2014-01-27 14:44:29 +01:00
188315735b Fix #2409 : Console Non-interactive curses ImportError 2014-01-27 13:05:09 +00:00
3b79be04bc Flake8'd gtkui/path_combo_chooser 2014-01-21 10:47:16 +00:00
a47b1a28f4 Fixed small bug in path_combo_chooser
The delete-text event was triggered when setting the text in the text entry.
The completion popup was then displayed when it shouldn't. Fixed by blocking
the signal while setting the text.
2014-01-21 02:58:38 +01:00
a2fcaa15c9 Fix #2006 : Display error when moving storage location fails
Adds handler for storage_moved_failed_alert and then sets the
torrent to Error state and pauses it.
2014-01-20 18:49:22 +00:00
35842af019 Add TorrentStorageMovedEvent for #637 2014-01-20 18:49:22 +00:00
7271472e13 Ensure status message is reset after leaving Error state
Also clean up comments in core.py
2014-01-20 18:49:21 +00:00
64fd94e51e Add external ip alert handler to core 2014-01-20 18:49:21 +00:00
ce6abe0247 Fix #1466 : Performance warning: Send Buffer Watermark 2014-01-20 18:49:21 +00:00
c3477ace9b Flake8'd core files 2014-01-18 23:26:18 +00:00
ef7605f9ec Add missing entries to OPTION_FUNCS in torrent.set_options 2014-01-18 22:59:16 +00:00
58e9f66d64 flake8'd torrent.py 2014-01-18 22:14:14 +00:00
7624683710 Add torrent.get_magnet_uri() to return generated magnet uri 2014-01-18 22:07:43 +00:00
b5946c91ed Replace internal time_added with lt added_time 2014-01-18 21:10:31 +00:00
246708e222 Add super_seeding to core 2014-01-18 21:10:23 +00:00
3180bc7104 Use a tmp file when saving state and resume files 2014-01-18 15:54:43 +00:00
d12f0365d5 Handle all-zeros KeyError for removed torrents alerts 2014-01-18 14:11:44 +00:00
01d2ef84ba Fix issue with add_torrent_params flags 2014-01-17 23:43:53 +00:00
80e56eb190 Fix #1000 : GTKUI: Select first row in list if no rows are selected
Also do not remove selection when changing filter (as 1.3 works)
2014-01-17 22:51:54 +00:00
2b64d78163 Remove leftover total_uploaded state code 2014-01-17 19:28:55 +00:00
169b9b9898 Fixes for #607 : Add completed_time to core and Completed column in GTK UI 2014-01-17 19:17:18 +00:00
0da6739f94 Fixes for #367 : Don't store last_seen_complete and total_uploaded in state file 2014-01-17 19:15:38 +00:00
bcbeca4b8a Remove stray debug logging line 2014-01-17 19:08:40 +00:00
9e62304852 More removal of lt deprecated params and funcs
Due to a deprecation mistake get_settings() should be used for python
bindings and it will return a dict.
2014-01-17 18:29:53 +00:00
da6d0ba7bf Replace lt deprecated session funcs with session_settings 2014-01-17 14:18:20 +00:00
ec56ea3ebe Put setup_translation back into start_daemon
A 3rd party plugin broke because using _() in core files so reverting
to prevent issues and may also be useful in future for translating
the help text.
2014-01-17 13:37:07 +00:00
624f2f66cf Replace deprecated session.num_connections with session_status.num_peers
This commit removes get_num_connections() from core and updates UIs
to use get_session_status with num_peers key.

Extra noise is from Flake8 changes
2014-01-17 12:21:08 +00:00
b0c3c3dddc Use non-deprecated libtorrent parameters and functions
Also added support for seed_mode
2014-01-17 10:48:42 +00:00
8eb2155eac Remove torrent_status translations from Daemon and move to UI clients 2014-01-16 23:31:04 +00:00
0a41b86e47 Reinserted call to translate_strings in common and renamed to translate_size_units. 2014-01-16 23:22:28 +00:00
7c808ab4b4 Added language option to Preferences
Changing translation tested and works on:

* Windows 7
* OSX 10.8
* Ubuntu 13.04

* Updated the OSX menubar to gtkbuilder
* Added language names to the Language dropdown in Preferences
2014-01-16 19:54:20 +00:00
d260f6506f Remove unneeded LoopingCall import 2013-12-23 16:22:16 +00:00
8ecc0e11a7 Fix for #1885 and add simple caching to the data funcs for the torrentview
* Fix for #1885 (Wrong tracker icon in torrent list)
* Moved the data functions from torrentview/listview into
  torrentview_data_funcs.py
* Added caching the current value of the cell renderer for the data functions
* Reordered if-tests in deluge.common.fsize
* Disable data funcs when column is hidden
2013-12-23 16:21:24 +00:00
feaeee0379 Removed LoopingCall from torrent.py
Having a LoopingCall for each torrent is expencive with a lot of torrents.
The LoopingCall in torrent.py has been moved to torrentmanager.py
which runs through all the torrents and calls cleanup_prev_status.
2013-11-21 10:48:55 +00:00
de3740fa70 Remove old code line 2013-11-20 23:26:29 +00:00
fe1f620731 Fix web ui showing total_size rather than total_wanted for Size column 2013-11-20 19:36:34 +00:00
63329e7199 Fix #265 : Add new Remaining column 2013-11-20 19:31:04 +00:00
e79cc6cd2d Fix #2381 : Allow silent uninstall for Windows package 2013-11-19 23:03:31 +00:00
6376c49441 Fix #2371 : Add StartupWMClass to desktop file 2013-11-19 23:03:31 +00:00
aafd31b552 Fix #2367 : Private Flag not showing as ticked/checked in DelugeStart theme 2013-11-19 23:03:31 +00:00
2520093b3e Fix #2335 : IPC lockfile issue preventing start of deluge-gtk 2013-11-19 23:03:31 +00:00
3d569b23d6 Merge branch 'master' into HEAD 2013-11-19 23:03:14 +00:00
4ab4998bf7 Fix #2355 previous fix was incorrect - thanks Thomas Hipp 2013-11-12 14:04:01 -08:00
60c53b0ec1 Fix broken last commit to make bbfreeze script work again 2013-09-08 04:13:36 -04:00
852f6049bd Fix twisted 13.1 compat -- the _parse() function was replaced by the _URI class 2013-08-06 18:51:33 -07:00
1daaad422b Improve the bbfreeze script a bit (and hopefully not break it) 2013-07-09 23:48:42 -04:00
f5d8cce4a2 Fix donot option check for windows/osx 2013-06-18 18:46:38 +01:00
9d48d04f0f Fix #2338 : Spelling mistake with occurred 2013-06-09 02:30:26 +01:00
d91a9504aa Fix bug introduced in 19234d 2013-05-27 23:39:43 +02:00
19234d6565 Added some tests for rpcserver 2013-05-26 23:09:02 +01:00
affe47a11c Cache items in get_filter_tree 2013-05-26 21:45:00 +01:00
899c575ae8 Speedup in tracker_error_filter 2013-05-26 21:44:04 +01:00
b76cdc2227 Fix 2247: AttributeError in deluge.error.DaemonRunningError
* Removed all the properties in error.py and added more tests
* Handle failure in client.py handling RPC_ERROR (From older daemons)
2013-05-26 15:25:39 +01:00
a27b479f06 Fix some typos in my previous commits 2013-05-26 14:55:36 +01:00
533228ff5e Fix overzealous legacy code removal from torrentmanager 2013-05-26 01:27:21 +01:00
7dd276631a Add flake8 to setup.cfg and add missed change to #2303 fix 2013-05-22 23:33:06 +01:00
e3f3b6d751 Cleanup torrentmanger code
* Remove legacy/old state file code
 * Passes flake8 cleanly
 * Most pylint messages dealt with
 * Code now uses >=Python 2.6 'with' and 'as' statements
2013-05-22 22:46:01 +01:00
77cb794e4d Fix #2303 : Torrent state not updated until after emitting TorrentFinishedEvent 2013-05-22 19:09:56 +01:00
45f898870f Fix mistake in torrentmanager 2013-05-22 03:01:25 +01:00
5ae74f4017 Fix typo in authmanager 2013-05-22 02:12:00 +01:00
2c4ef9dbb3 Fixup saving and loading state files
* All state files have a backup created before saving
 * The backup will now be used if saving or loading fails
 * GTKUI state files stored in new gtkui_state dir and common load/save functions created
 * Detects bad shutdown and archives timestamped state files in separate config directory.
2013-05-22 01:25:25 +01:00
2bbc1013be Removed call to save_config in path-chooser (obsolete) 2013-05-22 01:10:28 +01:00
4b49e456dd Handle plugin info not available 2013-05-22 01:10:28 +01:00
e2e09200c4 Fix gettext setup in test_common and log in test_transfer so tests run standalone
Add extra tests to test_config
Run the test files through flake8 to tidy up code
2013-05-22 01:06:32 +01:00
28d7c5d44a lower case 'l' for libtorrent in user_agent string 2013-05-21 18:16:06 +01:00
85f9247fd7 GTKUI: Fix Show Zero Hits to only apply to state, owner and tracker_host
There is an issue with the Label plugin where a new label would 'disappear'
and you could not change the options for the new label with zero hits hidden.
2013-05-20 15:41:20 +01:00
f8fbda97cd Fix daemon log being clobbered by running another instance with same config dir
Also includes small fixes and code cleanup
2013-05-20 01:28:31 +01:00
86ac98b9f9 GTKUI: Simplify the quit code for mainwindow 2013-05-19 01:51:55 +01:00
35c85c6d1d daemon code and comment cleanup, removed double call to _shutdown 2013-05-19 01:23:29 +01:00
02bc00bfa5 Small fixes to path chooser
* Handle completion when removing characteres while the popup is visible
* Set Apply button sensitive when changing move completed path in options tab
2013-05-18 22:11:29 +02:00
19184518e9 Fix torrentview exception for self.columns_to_update 2013-05-18 18:27:08 +01:00
85c5449ba8 GTKUI: Display only folder not full path on path chooser 2013-05-18 17:56:57 +01:00
957f04912f GTKUI: Fix layout issues with new path chooser in options tab 2013-05-18 17:56:57 +01:00
e5f7042d00 GTKUI: Asthetic updates to new path chooser options dialog 2013-05-18 17:56:39 +01:00
1596475db2 GTKUI: New path chooser to handle remote paths and store favorite paths 2013-05-18 17:55:25 +01:00
42f5cc382d GTKUI: Modify Show Zero Hits to apply to all filter categories 2013-05-18 02:16:16 +01:00
5479bdd85c GTKUI: More refactoring of filtertree translation text 2013-05-18 02:10:03 +01:00
b4f266457f GTKUI: Remove add_row and use add_rows instead 2013-05-17 17:01:48 +01:00
77bdcfa7a4 Fix seeing double torrents in classic mode
Need to ignore torrent added events from state as they are already
loaded by _on_session_state
2013-05-17 16:15:23 +01:00
235b7348ae Fix test_client test 2013-05-16 12:54:33 +01:00
cf669f3cfa Fix LP#1004793 : Console: Enable use of connect in non-interactive mode 2013-05-16 02:41:59 +01:00
e1b09f2694 Only add quit to deluge-console args if it isn't already present
This prevents an error from being raised due to trying to stop
a reactor which is no longer running
2013-05-16 02:39:55 +01:00
88dd64e795 Ensure console commands are executed in order 2013-05-16 02:39:55 +01:00
f077030dfc ConsoleUI: quit command now gracefully handles stopping a stopped reactor 2013-05-16 02:37:06 +01:00
836acbf02b ConsoleUI: Tidy up help output and limit command usage message to one line 2013-05-16 02:35:28 +01:00
3101104738 UI client.connect() with no credentials/username now attempts connect using localhost auth file details 2013-05-16 02:31:56 +01:00
391513d378 Remove old plugins 2013-05-15 16:56:31 +01:00
6bed403412 Move stray extractor plugin file to correct location 2013-05-15 16:46:37 +01:00
bc91804996 Remove unneeded dht saving state to separate file
The dht state is now saved by default in the session state by libtorrent
2013-05-15 16:27:58 +01:00
a754f1303f Gtkui: Add an alignment container to radio buttons in interface preferences 2013-05-15 15:18:03 +01:00
65f3c12d2d Move Interface page to top in preferences 2013-05-15 14:47:09 +01:00
879cf1b53c change 'classic mode' checkbox for standalone/thinclient radio buttons 2013-05-15 14:44:02 +01:00
105e4c0555 refactor owner code in torrentmanager add method 2013-05-14 01:59:51 +01:00
f7888757aa Refactor translation code in GTK torrent and filtertree views 2013-05-13 19:43:38 +01:00
1a0ca9edbe Alter return value to -1 for invalid freespace path
Updated GTK and Web UI to display error if value is -1
Added set_markup method to gtk statusbaritem class
2013-05-13 19:07:49 +01:00
a49d558aaf Add default localclient info to localhost items in gtk connection manager 2013-05-11 22:54:38 -04:00
502f135b15 Make sure auth file is closed during get_localhost_auth 2013-05-11 22:54:36 -04:00
e263db90ce Console UI: Fix problem displaying first-run message 2013-05-12 02:56:51 +01:00
7bd53903a4 Rearrange the Network tab in GTK and Web UIs
Also applied the suggestions in #2055 including removing 'Encrypt Entire Stream'
and default it (prefer_rc4) to True
2013-05-12 00:15:15 +01:00
8d63ce3ce5 GTKUI: Add a separator after Plugins in Preferences
To help distinguish where the plugin pages start a horizontal seperator
is now included after Plugins.
2013-05-12 00:10:32 +01:00
bf77f42674 Fix #2217 - handling exceptions with authentication 2013-05-10 16:30:35 +01:00
7424cf2834 Fix error in previous commit (b6a3161) and added test 2013-05-09 22:29:04 +01:00
b6a3161280 Add a get method to config so a default value can be returned 2013-05-09 19:13:20 +01:00
daba92b992 Fix #2324 : Encryption level set by deluge does not match libtorrent values
The clients are using range (0-2) whereas actual bit values are (1-3)
2013-05-09 19:12:38 +01:00
5503f90473 Fix #2285 : Speed optimizations for sessionproxy 2013-05-09 12:10:02 +01:00
d5a3851eef Remove develop_plugins, replace with --develop and --install-dir options for build_plugins 2013-05-06 22:14:52 +01:00
8c6d37d9bd Fix tracker_error_filter typo and tidyup commenting in filtermanager 2013-05-03 19:37:38 +01:00
e6498b6864 Fix #2277 : Plugins keys weren't fetched in filter_torrent_ids
Fixed bug introduced in 8c106ce8c4
where keys for plugins weren't fetched in filter_torrent_ids.
2013-05-03 18:00:37 +01:00
4b31061037 Reword gtk prefs tooltip 2013-05-03 14:01:16 +01:00
6e8e7a63cc #2218 #2254 : Re-enable utpex control and add lt_tex (tracker exchange) 2013-05-03 01:15:38 +01:00
53db149b12 Replace Markup with gtkbuilder atttributes for simpler translation labels 2013-05-02 21:28:47 +01:00
d455d03608 Create new generate_pot.py script for translations
* glade3 files require workaround with intltool-extract
 * webui javascript files are now included
 * fix multiline string for parse
2013-05-02 19:21:46 +01:00
3959b67cc0 move and update createicons & check_glade scripts 2013-05-02 19:01:06 +01:00
04bc23abe9 Change Web interface to fork by default
Implemented to match the daemon's default action and option to not fork/daemonize.
2013-05-02 00:56:35 +01:00
a60dc95fed Fixed tests: sessionproxy/torrent/tracker_icon
* Fixed sessionproxy tests
* Fixed test_torrent messing up component for other tests
* Updated tracker_icon test to use unresized google icon
2013-05-02 01:20:05 +02:00
607be461e0 Fix and update tests 2013-05-01 05:24:36 +01:00
4dd6308db9 Add get_version script to automate release versions (PEP386 naming) 2013-05-01 05:24:36 +01:00
289730a3e3 Make sure prioritize first/last doesn't enable pieces in
a file marked do not download. refs #2211
2013-04-29 18:07:04 -04:00
1d34d5f6a5 Fix #1840 : Refactor last_seen_complete code 2013-04-29 22:32:01 +01:00
64e1ab481b remove libtorrent build code 2013-04-06 12:51:20 +01:00
c92b3debb7 raise lt version 2013-03-29 23:52:26 +00:00
68c41e2915 Update DEPENDS 2013-03-29 23:15:32 +00:00
31929c7004 Change to using pop_alerts to get batches of alerts and save calls
Requires libtorrent >=0.16.7
2013-03-29 23:14:18 +00:00
937419bfcd Update Extractor plugin description, version and modify log levels 2013-03-26 19:45:29 +00:00
9b3ff8f1b8 Fix #2290 : Extractor: Dotted filenames being rejected 2013-03-26 19:18:07 +00:00
a44d86f285 Fix scalable icon install dir 2013-03-24 23:45:39 +00:00
400bd86749 Add pango env vars to osx package script 2013-03-17 19:26:33 +00:00
31ec8830f4 Update osx build and packaging scripts 2013-03-17 18:16:23 +00:00
2a3eb7b70c Fixes bug in core.get_torrents_status where diff was always False
Fixes bug introduced in 5cd86aa5bc where the diff
argument passed to torrentmanager.torrents_status_update is always False
instead of the value passed into get_torrents_status. This causes the sessionproxy
not to function properly which in turn increases CPU usage in the UIs.
2013-03-03 11:29:49 +01:00
e183e2ff04 Fix issue with Plugins that add Tab to torrentdetails 2013-02-27 17:46:46 +00:00
7598312969 Update .gitattributes, Changelog and man files 2013-02-25 23:00:13 +00:00
e62f79d9ae Extractor: Refactor and fix tar.* issue on windows 2013-02-23 02:07:53 +00:00
662849c0c2 Update Extractor with Win32 and extra archives support
Also disabled extracting on move_completed enabled torrents and fixed
some other small issues.
2013-02-23 02:06:32 +00:00
10251e460b Add a new DelugeStart theme to win32 gtk
This theme is based upon ANewStart theme and uses murrine theme engine.
2013-02-22 19:18:28 +00:00
6f9d69f9f3 Disable unused torrentview reordering property which fixes Win32 mouse scroll bug 2013-02-22 01:08:40 +00:00
091b42d317 GTKUI: Changes to autofill save path when creating torrent from remote path 2013-02-21 16:43:50 +00:00
463ac0c07e Optimized torrentview.cell_data_trackericon
cell_data_trackericon would load the tracker icon with
gtk.gdk.pixbuf_new_from_file_at_size each time it's requested.
These regular requests acumulating to thousands calls to
pixbuf_new_from_file_at_size with a big torrent list.

Now, read the tracker icon from disk once, and cache it.
2013-02-17 18:41:35 +00:00
836178a0da Replace Exception with GError in filtertreeview 2013-02-17 18:40:51 +00:00
1d9b550e35 Replace decode with decode_string 2013-02-17 16:19:13 +00:00
93d4e345b8 Update Changelog 2013-02-17 16:06:49 +00:00
a7cda7011b Build webui js and gettext 2013-02-17 16:06:37 +00:00
763af17e71 Add tracker host details to debug logging 2013-02-17 16:04:22 +00:00
83df1159c0 Fix glade issues in previous commit 2013-02-15 18:04:32 +00:00
a7c5b9f568 Add OSX packaging and GTK support 2013-02-14 00:36:46 +00:00
0da88fc74b GTK: Fix showing exception error to user with no libtorrent installed 2013-02-13 01:33:24 +00:00
b82b313e32 Fix GTK ConnMgr update after stopping daemon and reduce wait time 2013-02-13 01:33:06 +00:00
36d8c5517f Fix renaming folders on libtorrent 0.16 compiled with unicode support (Windows) 2013-02-11 21:26:16 -05:00
b08573831e Merge remote-tracking branch 'bro/master-torrent-encoding-cleanup' 2013-02-11 21:07:11 -05:00
41e3b01285 Removed redundant has_metadata function from torrent.py 2013-02-11 20:17:32 -05:00
cdfb337bae Added GtkAdjustment to the port spinbutton 2013-02-11 20:11:00 -05:00
31ecaacbc8 Replaced ti_-functions with lambdas 2013-02-12 01:21:32 +01:00
5bcb104a01 Cleaned up torrents.py and small change to decode_string
Replaced some try/except-decoding with decode_string.
Removed redundant methods ti_name and apply_options.
In decode_string - changed last encoding (with ignore) from
chardet-detected to the encoding specified in key-argument.
2013-02-12 01:14:57 +01:00
6c75201b2e Fix setting 1GB/s speeds in gtkui 2013-02-11 19:27:07 +00:00
54491a9eaf Add exception details to EventManager error log 2013-02-11 18:38:00 +00:00
c11262082e Fix an issue with daemon speedups with file priorities for magnets
Ensure prioritize_first_last gets set properly for magnets
2013-02-10 23:57:46 -05:00
8c106ce8c4 Merge remote-tracking branch 'bro/master-daemon-optimize-speed'
Conflicts:
	deluge/core/alertmanager.py
	deluge/core/torrentmanager.py
2013-02-10 17:30:25 -05:00
b4f5e78a77 Merge remote-tracking branch 'bro/master-torrentview-speedups' 2013-02-10 17:18:25 -05:00
8735fe14a8 Fix #2258 : Potential runtimeError when emiting event 2013-02-05 18:56:55 +00:00
01c501b172 Fix #2260 : Add dialog pulling main window to active workspace 2013-02-05 18:34:10 +00:00
1f12bab923 Fix #2242 : Notifications: Missing word in torrent finished message 2013-02-04 14:32:39 +00:00
810495264f WebUI: Add failed login log message with IP address for fail2ban 2013-02-04 14:32:32 +00:00
754035c722 Fix #2261 : WebUI: Proxy settings not being saved 2013-02-04 14:32:07 +00:00
fbdda1b3a5 Fixed bug in torrentmanager.separate_keys
If none of the torrent_id's were present in self.torrents,
None would be returned.
2013-01-25 20:13:54 +01:00
a992d8685f Fix issue with downloaded torrent temp files on windows which had illegal characters. 2013-01-20 19:53:26 -05:00
763f5de904 Replace hotspot with cProfile for daemon
Added a twisted signal handler to save profiler stats when
deluged is killed with SIGINT.
2013-01-19 02:23:01 +00:00
4b99a39779 Added decode_string on all calls to alert.message() 2013-01-19 01:41:14 +01:00
5e19fd0122 Fixed bug with handling adding/removing columns in GTKUI.
Also reinserted two lines that were lost when porting patch to master
2013-01-18 23:25:43 +01:00
823a1f0fc4 Make sure sessionproxy events are registered after stopping and starting a daemon from gtkui. 2013-01-17 22:21:03 -05:00
f3722ebc4f Don't deliver empty resume_data parameter to session.add_torrent
Fixes a libtorrent crash on python 2.7 on Windows
2013-01-17 22:19:38 -05:00
fbeea9159e Removed debug print 2013-01-16 00:08:00 +01:00
0f67dc168b Improvements and bug fixes 2013-01-15 23:40:53 +01:00
5cd86aa5bc Optimizations to daemon and rpc messages.
* Implemented torrent updates with libtorrent post_torrent_updates.
  This required some changes to how core/torrenthandler
  handles get_torrent_status
* Reworked how torrent.py handles torrent info
* Removed some unneeded RPC message requests from client.
* Added tests for some expensive log prints.
2013-01-14 03:14:28 +01:00
8cb55983bb Add move complete location to webui add torrent dialog. 2013-01-04 19:19:58 -05:00
ffcfc060e9 Fix mapped_files error in AddTorrentDialog 2013-01-03 17:33:15 +00:00
6313ff19b3 Improved the speed of set_prioritize_first_last in torrent.py
set_prioritize_first_last is rewritten for better performance, and is now only called when necessary. It should now properly set the priority for the beginning and end of each file in the torrent.
2013-01-02 20:20:25 -05:00
61bd8aa154 Fix Gtk addtorrentdialog parent None error for single file torrents 2013-01-02 22:40:37 +00:00
637578375c Fix #2240 : Win32 freespace issue with large capacity drives 2013-01-01 17:51:37 +00:00
18bcdd09d3 Fix error when loading torrent through IPC
Fix bug from commit 0045ec0cf1: missing args attribute error when
loading torrent through IPC on non-windows.
2013-01-01 17:40:29 +00:00
cc5ef89139 Fix #2241 : Can't add any torrent files with GUI running
This fixes a bug in commit 60f196ff93, adds a test and removes
unneeded ignore when encoding unicode to utf8.
2013-01-01 17:22:00 +00:00
1a9506f832 move misplaced test to correct dir 2013-01-01 17:11:39 +00:00
e7d06ee132 Make web build script sh compatible 2012-12-22 02:34:43 +00:00
7647f848e4 Update Changelog, webui gettext, gitignore & compress js 2012-12-22 02:31:43 +00:00
eec820774b Fix WebUI submenus closing upon mouse click 2012-12-22 01:39:50 +00:00
8cbdaffedb Update the python dependency to 2.6 2012-12-21 15:35:27 -08:00
e6267d9411 Fix issues with js eventmanager. refs #2046
Fix plugin methods not being available when enabled until refresh. refs #2125
2012-12-21 13:26:58 -05:00
8f34e2abdb Clean up some json api code. refs #2125 2012-12-21 13:19:14 -05:00
d3f0e00356 WebUI: Catch potential undefined error when attempting to disable a plugin 2012-12-18 21:53:08 +00:00
7c2725acdc Fix #1963 : Unhandled OSError if permission issue creating default config dir
The fix now logs the error and exits. To log the error also required moving
the logger setup code to before any default_config_dir call.
2012-12-18 01:57:12 +00:00
f47c9186bf Fix #1504 - Win32 run deluged as not logged in user via runas or service 2012-12-18 01:15:51 +00:00
c9b77cbe94 Fix #1946 : GtkUI: ReactorNotRestartable error when set as startup application 2012-12-17 19:58:29 +00:00
725230dc81 Fix #2175 : systemtray free variable self referenced before assignment
This is only the likely fix for the issue as I have been unable to reproduce it.
2012-12-15 21:27:50 +00:00
73102f1362 Merge branch 'master' into master-decode-string 2012-12-10 20:34:46 -05:00
ca1a5d33f4 Fix issue when saving resume data fails.
Clean up resume data deferred code a bit.
2012-12-10 20:11:11 -05:00
3bf023e4df fix error in #2085 commit 3ca886ac7a: value may be a tuple 2012-12-11 00:58:02 +00:00
c556613b9f Catch exception when enabling/disabling indicator in classic mode 2012-12-10 19:35:03 +00:00
6c07b7378c Fix #2085 : WebUI: Does not show torrents in sidebar for categories other than 'All'
unicode value in filter_dict would not be converted into a list
2012-12-10 15:55:58 +00:00
4520fdd58b Added priority colors to torrent detail view in console 2012-12-10 14:45:52 +01:00
1ac62fce01 Get cli arguments in unicode in deluge core as well.
Make a better guess at what arguments are encoded in on linux.
2012-12-10 00:19:42 -05:00
c2d301bf52 Make deluge-gtk get arguments as unicode.
Fix a few places that use those arguments.
Make sure gtkui loads strings as unicode from rencode.
2012-12-10 00:19:24 -05:00
8658be3b05 Fix #2227 : Torrent file contains sha1 and ed2k digest that needs encoding to hex 2012-12-09 23:24:01 +00:00
2a8b8e93da Use try-except instead of if statement to gain a little performance 2012-12-09 23:12:26 +00:00
ac6785eb1a Fix #2232 : WebUI: Flag Icon path in Peers Tab missing deluge.config.base 2012-12-09 19:09:57 +00:00
848b14605e Make sure pending gtk events are processed before quitting gtkui. 2012-12-08 17:57:12 -05:00
2a0048afbb Add unit test for new component dependency stopping code. 2012-12-08 16:26:32 -05:00
cc943cea4a Merge branch 'master' of deluge-torrent.org:deluge 2012-12-08 12:57:13 -08:00
2f3623d430 Fix component tests 2012-12-08 12:56:58 -08:00
fe44a5ba69 Fix #2231 : WebUI: Fix unneeded scrollbars in webui add dialog
Also fix spinner display issue
2012-12-08 19:18:51 +00:00
d3a0b9d877 Small tweak to make sure writing fastresume is not skipped when torrents are paused. 2012-12-08 00:39:02 -05:00
25efa5437b Update folder rename to use deferreds. 2012-12-07 22:50:53 -05:00
67b40a8442 Remove unneeded import from torrentmanager. 2012-12-07 22:29:56 -05:00
bcac44bcb4 Increase libtorrent alert queue size. refs #2204 2012-12-07 22:29:49 -05:00
58cb9e1c22 Make sure dependent components are stopped before their dependencies.
Make sure deferreds are not lost in new resume saving code.
2012-12-07 22:22:24 -05:00
ce99b5f688 Refactor resume data saving to not read and write fastresume unnecessarily.
Refactor saving resume data on shutdown to use deferreds.
Make bulk resume data saves write to disk only once.
2012-12-07 22:22:12 -05:00
ce76c278ed fix snafu in last commit 2012-12-05 19:11:06 +00:00
bb5dbecbf2 Fix #2130 : Same name can be given to different files in Add Torrent dialog 2012-12-05 18:28:17 +00:00
eed46994da Fix #2129 : Empty filename can be set in AddTorrent dialog 2012-12-05 18:28:04 +00:00
a5df53249a Fix #2228 : Apply-To-All in AddTorrent Dialog is copying file renames to other torrents 2012-12-05 14:07:06 +00:00
331cef16ef Fix #2220 : MacOSX homebrew build not finding boost libs 2012-12-05 13:50:12 +00:00
e79c695732 Remove some backwards compatibility code for libtorrent 0.14. 2012-12-03 01:18:25 -05:00
b4d7e42973 Update libtorrent minimum version checking. 2012-12-03 01:03:58 -05:00
71183f6c19 Add windows support to is_ip 2012-12-01 02:22:49 +00:00
0b5b585992 Replace subprocess.call with subprocess.Popen to start deluged from gtk client
The use of Popen was originally a fix for a Win32 issue on 1.3 but makes sense to
apply to all OSs and simplify code.
2012-11-30 16:04:15 +00:00
7492d48029 Added test if self.model_filter is None
self.model_filter will be None if no list was ever loaded in the
Client, so listview.create_column_state would fail.
2012-11-30 09:23:42 +01:00
b4903b763e Fix torrent names on libtorrent 0.16 on windows. 2012-11-29 23:26:37 -05:00
3d76ab1832 Update version for rencode module. 2012-11-29 23:11:16 -05:00
48cbf0d9b0 Update Changelog 2012-11-29 22:43:36 +00:00
6b9ae264ff Fix typo in json_api docstring 2012-11-28 23:36:23 +00:00
e90e608fdd Fix #1474 : on_show_prefs hook is not executed immediatly after enabling a plugin 2012-11-27 23:18:12 +00:00
6fe350fa52 Fix #2110 : Accept magnet uris with xt param anywhere within them 2012-11-27 23:18:12 +00:00
c426f998e2 Fix #2147 : Missing translations for plugin preferences page 2012-11-27 23:18:12 +00:00
2187cef14f Add decode_utf8 argument to rencode.loads, which decodes all strings from utf8.
Update rpc protocol to load all strings as unicode.
2012-11-26 23:19:13 -05:00
6b5cf3396d Rencode module now always loads strings as utf-8 encoded byte strings. 2012-11-26 23:19:13 -05:00
4f59a48f57 Fix #2146 : Missing translations in View|Tabs submenu
Also fixed small bug when hiding Status tab
2012-11-27 02:03:25 +00:00
d48d3c9c2f Make sure queue order is preserved when restarting daemon. 2012-11-26 17:19:09 -05:00
4579886bb5 Fix file renaming and moving with unicode characters on libtorrent 0.16
Fix torrent creation with unicode characters
2012-11-26 17:18:41 -05:00
bd979da949 Update Changelog, translation files and compress js 2012-11-26 17:43:41 +00:00
d5e340354e Avoid running chardet in decode_string if not needed 2012-11-26 15:54:01 +01:00
19bbf5ac8f Fix Windows tray submenu items requiring right-click instead of left-click 2012-11-26 13:42:40 +00:00
b8deea5c76 Fix #2208 : Win32 Open Folder not working with non-ascii paths 2012-11-26 13:42:32 +00:00
88223fc058 Fix #2086 : Enable submenus for appindicator 2012-11-26 02:19:33 +00:00
09e43f3e41 Fix use of translated text for widget name in build_menu_radio_list 2012-11-26 02:07:48 +00:00
751bc317ea Fix #2201 : auth fails if auth file has extra newlines 2012-11-26 02:07:43 +00:00
60f196ff93 Changed decode_string to always return unicode. 2012-11-25 20:33:00 +01:00
294fc48bd1 Fixed setting some of the torrent options via the manage command 2012-11-25 20:18:35 +01:00
d3d07f7f11 Fixed setting move on complete option in new console 2012-11-25 20:12:55 +01:00
ca272bb36a GTKUI Torrentview Speed optimizations 2012-11-25 00:40:14 +01:00
cd41089e49 Fix #2069 : WebUI: Login window layout problem when using larger than default font size 2012-11-24 18:19:37 +00:00
b1cf5b9c40 Fix #1890 : WebUI: Column in files and peers view could use some spacing
Also fixed the SpinnerGroup to no longer show horizontal scrollbar and added
vertical scrolling to detailstab.
2012-11-24 18:16:38 +00:00
c37cfdfa2f Fix config not defined in ipcinterface 2012-11-24 18:06:13 +00:00
84bc2e78bc Fix #2103 : WebUI: Sorting by name is case-sensitive 2012-11-24 18:05:04 +00:00
0676d7e2dc Fix #2120 : WebUI: Manually entered values not being saved in Spinners 2012-11-24 17:52:49 +00:00
dd8dac0574 Fix #2212 : WebUI: Unable to scroll in proxy preferences page 2012-11-24 17:49:32 +00:00
d6d1cc5f45 Updates to web gen_gettext script and add .build_data to gitignore 2012-11-24 17:44:49 +00:00
f016160c62 Removing unneeded webui files 2012-11-24 17:43:27 +00:00
7119e0d95f Fix #2100 : Add option not to bring main window to front when adding torrents through ipcinterface 2012-11-24 17:42:24 +00:00
ffb902ba06 updated gitattributes to ignore deluge-web debug files 2012-11-22 23:27:52 +00:00
dc14453f34 Update bbfreeze and nsis scripts for win32 packaging
bbfreeze script:
  * Creates a VERSION.tmp file for use by nsis script
  * Includes all theme, icon and locale files. Closes #2096 & #2145
  * Add email.mime.multipart and email.mime.text. Closes #2074
  * deluged.exe and deluge-web.exe will no longer show a cmd window and created
    deluged-debug.exe and deluge-web-debug.exe as replacements if still needed
  * Overridden bbfreeze gtk recipe thus no longer requiring file editing.
  * Remove unnecessary python module includes

nsis script:
  * Deluge version now based upon bbfreeze output
  * Installer will warn if deluge already running. Closes #1217
  * Removed deluged and deluge-web shortcuts from start menu
  * Increased compression level for lzma
2012-11-22 23:24:13 +00:00
f83e772030 Make sure 'quit and shutdown daemon' option is not visible when not connected to a daemon. 2012-11-16 00:46:00 -05:00
0c1dd44cd6 Simplify cross-platform clipboard code in gtk add torrent dialog. 2012-11-14 20:58:48 -05:00
5b2be2d190 Update to depend on libtorrent >= 0.16.1 2012-11-13 21:13:59 -05:00
9d28aa9521 Fix bug in prioritize_first_last, also fixes selective downloading. refs #2211 2012-11-13 01:36:04 -05:00
8298a93dcc Make path separators in Torrent.get_files consistent across platforms. 2012-11-12 21:27:08 -05:00
a78731c8cd Eliminate the need to manually call the on_toggle handler for move completed in add torrent dialog. 2012-11-12 21:24:12 -05:00
15492028fc Make sure sensitivity of move completed path is always set correctly in add torrent dialog. 2012-11-10 22:20:27 -05:00
db5a4f84f6 Fix daemon starting with config dir containing spaces on Windows. 2012-11-09 18:24:26 -05:00
4b75ec5b55 Add move completed option to add torrent dialog. 2012-11-07 22:35:41 -05:00
1daae0135d Implement pseudo stable sort in the gtk torrent view. 2012-11-07 19:41:04 -05:00
dd511df194 Replaced WMI process enumeration with the EnumProcesses API call. (Shorter, faster, does not depend on pythoncom.) 2012-11-06 22:31:08 +00:00
e43e4e2ee0 Fix 2107 : create_plugin.py call correct version of python 2012-11-06 22:24:40 +00:00
b67bae31ba Fix #2174 : Console: Unable to add torrent via URL 2012-11-06 21:27:02 +00:00
5cb85472c6 Fix #2185: register call should be deregister in deregister_event_handler 2012-10-14 00:31:45 +01:00
1c865ebeb9 Tweaks to console info code 2012-10-13 02:27:18 +01:00
a18bdcf7cd Fix #2169 : Add Torrent Dialog 'Download Location' not set correctly when folder typed into Other->Location field
Using get_current_folder() in the file chooser will use the default folder when a folder path has been typed into the Location field rather than selected with mouse. The solution is to replace it with get_filename().

Conflicts:

	deluge/ui/gtkui/addtorrentdialog.py
2012-10-06 23:00:30 +01:00
0a36baa7d7 Fix #2171 : Add Peer dialog stops responding if empty or invalid values entered 2012-09-30 18:29:22 +01:00
47958f708f Fix #2104 : Deluge has no indicator title 2012-09-30 18:29:09 +01:00
d030850638 Update Win32 Installer readme
Also remove unneeded StartX.exe

Conflicts:

	win32/Win32 README.txt
2012-09-29 17:22:27 +01:00
9360378ae9 Fix common.open_file for osx 2012-09-29 17:12:48 +01:00
a3268dd403 Console: Fix test for empty color string 2012-09-29 17:12:26 +01:00
b34e38df57 Fix #2112 : World readable tmp directory in json_api 2012-09-29 17:02:52 +01:00
5188750332 Fix 2163 : Cannot add torrent file with empty (0:) encoding tag 2012-09-29 15:03:13 +01:00
7275cdd3d9 Fix exception handling in rencode 2012-09-29 15:03:05 +01:00
f6c201f02f Fix 2160 : Disable use of python bindings for libtorrent extensions and replace with session flag
The fixes a GIL issue causing libtorrent segfault. https://code.google.com/p/libtorrent/issues/detail?id=369

Note: The ut_pex plugin (Peer Exchange) will now always be enabled.
2012-09-29 15:02:55 +01:00
1ec51cec18 Fix copy pasta fail :( 2012-09-19 22:24:10 +10:00
2531271fe2 Merge branch 'master' of deluge-torrent.org:deluge 2012-09-18 18:00:13 -07:00
9055019cc2 Fix previous commit 2012-09-18 17:59:01 -07:00
9829bec390 Fix execute plugin not working with unicode torrent names 2012-09-16 18:41:40 +10:00
183c47f810 Fix deluge-gtk not working with twisted 12 (fixes #2148) 2012-09-16 18:41:35 +10:00
129c09c5a7 Don't use deprecated twisted imports (fixes #2164)
Aliases have been removed in twisted 12.2.0.
2012-09-16 17:19:46 +10:00
c8384bf304 Update google.ico so tracker_icons tests pass again 2012-09-16 17:14:47 +10:00
5e1caf3746 Add compile arg needed by libtorrent 0.16.x 2012-09-16 15:31:36 +10:00
532b409a54 Only convert the move path to unicode if on windows 2012-09-14 15:55:28 -07:00
7dd4645a7b Quick and hacky fix for console event view crashing on long torrent names 2012-08-26 20:02:59 +02:00
0bf1379cc5 Added active time and seeding time columns to console 2012-08-26 15:00:39 +02:00
6f98e1fddb Don't clobber filename when adding torrents with mapped_files 2012-08-21 18:30:53 -07:00
d3f6616d5d Made status bars update correctly in Legacy 2012-08-20 16:27:15 +02:00
8cdf914f5d Fix to the last fix ^^ 2012-08-09 14:56:23 +02:00
6c6292135f Fixed some problems with help popups 2012-08-09 14:56:23 +02:00
75c4135d6e Made delete key open up the delete torrent dialog in view torrent detail mode 2012-08-09 14:56:23 +02:00
5927f2fa30 Made 'Esc' exit AddTorrents and allowed scrolling with j/k 2012-08-09 14:56:23 +02:00
bd13457f33 Fixed AddTorrents crashing on folders containing unicode characters 2012-08-09 14:56:22 +02:00
8de9843e7e Replaced a dictionary comprehension with dict(list comprehension) to keep 2.6 compatibility 2012-08-09 14:56:22 +02:00
a73fb338f1 Fix console not working with an empty session 2012-08-09 14:56:22 +02:00
ae8751461a Replaced 'inf' with '-' for ratio column in AllTorrents mode 2012-08-09 14:56:22 +02:00
9c0c7b060c Added progress to list of required columns 2012-08-09 14:56:21 +02:00
da5140e615 Fixed (this time properly) crapping out when waiting for torrent data after enabling a column 2012-08-09 14:56:21 +02:00
fa32d4e3f4 Fixed lack of formatting in some of the event messages 2012-08-09 14:56:21 +02:00
52541df3f9 Added another check to prevent event spam when adding a new torrent 2012-08-09 14:56:21 +02:00
39d75ee7d5 Display a 'Please Wait' string instead of crapping out when waiting for column data to be fetched 2012-08-09 14:56:20 +02:00
246a8409bf Fixed a crash when trying to change sort order from an invisible column 2012-08-09 14:56:20 +02:00
c554bf9edd Made scrolling not reset the breadcrumbs in AddTorrents as it's meaningless 2012-08-09 14:56:20 +02:00
ef522ba292 Added scrolling with PgUp/PgDown and Home/End to SelectablePopup 2012-08-09 14:56:20 +02:00
3602fb76c5 Fixed a little problem with multiselection in AddTorrents 2012-08-09 14:56:19 +02:00
8dfc405c3e Added error handling for inaccessible directories 2012-08-09 14:56:19 +02:00
567f4e5c3d Removed debug code, made AddTorrents save path and sorting column/order 2012-08-09 14:56:19 +02:00
57b1820fd7 Got rid of old add torrents dialog and replaced it with a new one that either opens file browser or an add from URL/magnet dialog 2012-08-09 14:56:19 +02:00
6a54c71c94 Wrote a help string for AddTorrents 2012-08-09 14:56:18 +02:00
2b244f0628 Changed format of add torrent reports a bit 2012-08-09 14:56:18 +02:00
be23d00042 Extended torrent add screen with a proper file browser and multiselection. Experimental 2012-08-09 14:56:18 +02:00
d9a2597617 Made wrap_string carry format strings over to the next line 2012-08-09 14:56:17 +02:00
33e5cad75a Made Popup accept a width_req argument 2012-08-09 14:56:17 +02:00
8c9a89bcd2 Added missing coding declaration to manage.py 2012-08-09 14:56:17 +02:00
0c93d20980 Treat empty rename field as canceling the rename 2012-08-09 14:56:17 +02:00
93a0040b68 Added renaming files and folders in a torrent. Note: For the sake of your sanity, if you ever wish to modify this code, better rewrite it from scratch instead. 2012-08-09 14:56:16 +02:00
e4a4f0eb4a Fixed a problem with message popup 2012-08-09 14:56:16 +02:00
78137540f2 First change outside of deluge/ui/console - fixed a problem when removing torrents 2012-08-09 14:56:16 +02:00
76babd951d Fixed a bug that caused torrent options popup to not display in some circumstances 2012-08-09 14:56:16 +02:00
a66bd5e847 Fix crash when entering unicode characters from keyboard into an input popup 2012-08-09 14:56:15 +02:00
dcd3bc10e1 Chaned DL/UL colors on status bar to magenta/green (from green/red) 2012-08-09 14:56:15 +02:00
08f5841522 Performance improvements - console should now be much faster with many torrents and slightly faster to somewhat slower with few 2012-08-09 14:56:15 +02:00
7a55a2e6ce Set default priority for file priority dialog to 'Normal', added colors 2012-08-09 14:56:14 +02:00
ac79938c20 Fixed a minor problem with events on torrent addition 2012-08-09 14:56:14 +02:00
1da24fbeaa Updated some event handlers 2012-08-09 14:56:14 +02:00
a20b39325e Made detail and event views scrollable with j/k keys as well 2012-08-09 14:56:14 +02:00
f7a4951e0d Fixed sorting by ETA 2012-08-09 14:56:13 +02:00
9abfc5b250 Added a first run popup(actually just ordinary help with changed title) 2012-08-09 14:56:13 +02:00
a41c950b11 Made popup windows request height of 65, updated help 2012-08-09 14:56:13 +02:00
718bf57b5d Allowed float sizes of Popups between 0.0 and 1.0 which make them take specified amount of available screen space, made help popups larger 2012-08-09 14:56:13 +02:00
11e3a66484 An _UGLY_ but working fix for an alt+backspace problem in Legacy 2012-08-09 14:56:12 +02:00
9a322ed67f More Unicode handling fixes for Legacy 2012-08-09 14:56:12 +02:00
4e1573cb39 Fixed 'Queue' option not being display in all torrents view 2012-08-09 14:56:12 +02:00
28e36c7edc Fixed offset issues in torrent detail view 2012-08-09 14:56:12 +02:00
bbdf710b52 Another search behaviour change: Enter now opens torrent menu and '/' closes search(as it cannot occur in torrent name anyway) 2012-08-09 14:56:12 +02:00
3634f457b4 Fixed an additional character being deleted when pressing alt+backspace in legacy mode 2012-08-09 14:56:11 +02:00
a956f0a5d7 Add / to list of word-separating characters 2012-08-09 14:56:11 +02:00
265f9f295e Made connection manager handle resizing 2012-08-09 14:56:11 +02:00
6888c6ef60 Made history saving/loading respect the 'do not save duplicate lines' setting 2012-08-09 14:56:10 +02:00
50b84c3e91 Allow exiting preferences with escape if category zone is active 2012-08-09 14:56:10 +02:00
9152d322ac Fixed resize bugs in event view, torrent detail and preferences(also made it actually handle resizing) 2012-08-09 14:56:10 +02:00
18091c5ad6 Fixed an error that arised when no torrents matched current filter 2012-08-09 14:56:09 +02:00
4a58e339cb Split console options into two panes - interface and columns 2012-08-09 14:56:09 +02:00
31dd1be090 Fixed command line history saving problems 2012-08-09 14:56:09 +02:00
3cc97accfc Added saving and loading legacy history. Optional, enabled by default 2012-08-09 14:56:08 +02:00
555717b9a0 Modified torrent detail view. Needs more work 2012-08-09 14:56:08 +02:00
cf58aa780a Added an audible bell on torrent completion (optional, off by default) 2012-08-09 14:56:07 +02:00
935777fb49 Fixed resize causing crashes and/or improper resize of AllTorrents view 2012-08-09 14:56:07 +02:00
0dbea0ed01 Made torrent info popup request larger size 2012-08-09 14:56:07 +02:00
84425d7786 Fix inability to open torrent options with 'o' key 2012-08-09 14:56:06 +02:00
3920a93cba Replaced infinity symbol with 'inf' 2012-08-09 14:56:06 +02:00
4735a6c49a Add a visible columns dialog in all torrents view under 'v' key 2012-08-09 14:56:06 +02:00
a8549ef882 Another popup system upgrade: Preserve requested height on resize, do not fail if it's too much, add infinite and default options, add align option, slightly change SelectablePopup. Update rest of the code 2012-08-09 14:56:05 +02:00
0df1255ae5 Replace the popup scroll bar with a red '#' for visibility 2012-08-09 14:56:05 +02:00
f6d87c7a7e Highlight prompt in yellow in line history 2012-08-09 14:56:05 +02:00
1f59b4d2ba Add reload and install plugin functionality to the 'plugin' command 2012-08-09 14:56:04 +02:00
1df173d684 Added tab_complete_path method to LegacyUI and ConsoleUI, made add command use it for completion 2012-08-09 14:56:04 +02:00
b2f78786a5 Don't append a space after directory completion 2012-08-09 14:56:04 +02:00
314b6138d7 Add preliminary(Torrent ID/name only) autcompletion to manage command 2012-08-09 14:56:04 +02:00
1bc3c293fa Added another fix for flicker bug. Looks like it's not possible to completely get rid of it, but it should be around 10000 times less common now 2012-08-09 14:56:03 +02:00
bbf0666539 Fixed '<command> -h', added syntax highlighting to command help 2012-08-09 14:56:03 +02:00
2ed60de628 Allow 'help' command to print help for multiple commands at once 2012-08-09 14:56:02 +02:00
76546ec176 Fixed double space being appended after commands 2012-08-09 14:56:02 +02:00
0a9a1db942 Fixed another splitting bug 2012-08-09 14:56:02 +02:00
d589823f4a Fixed accidential highlight on time zone name 2012-08-09 14:56:02 +02:00
33decd1780 Finally and definitely fixed all flickering bugs 2012-08-09 14:56:01 +02:00
6269076c7e Added scrolling to event view, fixed all crashes 2012-08-09 14:56:01 +02:00
506a98aee2 Implemented the .clear() -> .erase() change which supposedly fixes a lot of flicker issues 2012-08-09 14:56:01 +02:00
8d1e4297ec Append space after completed line. With enhanced tab completion it poses no problem 2012-08-09 14:56:01 +02:00
8678121210 Made it possible to open torrent options with 'o' in detail view 2012-08-09 14:56:00 +02:00
24d801d18a Fixed a parameter splitting bug that prevented help command from working and could have lead to rm disaster 2012-08-09 14:56:00 +02:00
2e647c6b41 Fixed help string in torrent detail and event views 2012-08-09 14:55:59 +02:00
a47b2bc715 Show torrent options entry in torrent menu (both alltorrents and torrentdetail views) 2012-08-09 14:55:59 +02:00
e1a3a9e077 Fixed a harmless mistake that I made 80 commits earlier 2012-08-09 14:55:59 +02:00
3488a761b8 Changed default column settings to be friendlier to small terminals 2012-08-09 14:55:59 +02:00
822ddc2182 Place completed torrents after the rest regardless of sort keys(optional, on by default) 2012-08-09 14:55:58 +02:00
f5f1f11f61 Fixed sorting by some of the keys, reversed sorting order where appropriate 2012-08-09 14:55:58 +02:00
864785752f Change primary sort field with '<' and '>' keys 2012-08-09 14:55:58 +02:00
60e534f59b Removed trailing whitespace 2012-08-09 14:55:57 +02:00
c0f76bef1b Highlight current primary sort column 2012-08-09 14:55:57 +02:00
920e765790 Changed behaviour of search heavily - you can no longer move cursor around the input field, instead right arrow opens torrent detail view and left cancels searching. You can also go to first/last result with PGUP/PGDOWN 2012-08-09 14:55:57 +02:00
cc99279ad1 Improved logging - added dates, time, changed formatting and made it always log both to console and event log 2012-08-09 14:55:57 +02:00
48dd049cbd Log events to legacy mode even when in AllTorrents view 2012-08-09 14:55:57 +02:00
09c830c6ae Yet another search scrolling bug 2012-08-09 14:55:56 +02:00
39a896e59e Add proper sorting by primary/secondary fields. No preferences yet, defaults are queue/name 2012-08-09 14:55:56 +02:00
ca6c647bd2 Color-coded the statusbars 2012-08-09 14:55:56 +02:00
d2dc62f0b3 Remove option to hide name column as something to identify the torrent is needed anyway 2012-08-09 14:55:56 +02:00
4983110d50 Highlight matches when searching (only for >=2 chars entered) 2012-08-09 14:55:55 +02:00
00bf1d31a2 Fixed a severe torrent matching bug caused by spaces not being unescaped when parsing 2012-08-09 14:55:55 +02:00
2092a0d090 Fixed halt command. I totally have no idea why it worked before and why it stopped working now.... 2012-08-09 14:55:55 +02:00
d3e70b7f7f Don't reset cursor position when going back from torrent detail view 2012-08-09 14:55:55 +02:00
d86168cb41 When no filename is supplied in torrent add dialog, treat is as cancel and don't display an error message 2012-08-09 14:55:54 +02:00
5a096768e0 Fixed another search scrolling bug. New search is now only not performed if the same part of torrent name matches after entering a new character 2012-08-09 14:55:54 +02:00
c2f97356c6 Fixed minor searching problems 2012-08-09 14:55:54 +02:00
b5cfbbcdec Made popup windows scrollable with page up/down and home/end 2012-08-09 14:55:54 +02:00
6326902287 Do not empty search_string so user can continue to cycle through results with 'n' key 2012-08-09 14:55:53 +02:00
a9af9cabb4 Remove '(end/start reached)' message after changing search string 2012-08-09 14:55:53 +02:00
546aa58482 Fixed scrolling bug when searching backwards 2012-08-09 14:55:53 +02:00
be79c586da Made search case insensitive 2012-08-09 14:55:53 +02:00
819377b0bb Searching in main view now searches immediately and you can cycle through results with up/down keys. Failure/success/end/start reached are now color-coded 2012-08-09 14:55:53 +02:00
b37965de3d Add deleting words with alt+backspace and a minor change that could have potentially caused some misc bug 2012-08-09 14:55:52 +02:00
d7391611dd Do not use shlex for splitting as it breaks on torrents containing quotes 2012-08-09 14:55:52 +02:00
fa1a1eb939 Add permission checking to add command(fixing few crashes), sort files by date, place folders before files and ignore files other than .torrent files 2012-08-09 14:55:52 +02:00
5a33e66c2c Fix add command reporting success for some failures 2012-08-09 14:55:51 +02:00
3bc25d44ee Fixed a crash bug introduced with inexact case matching 2012-08-09 14:55:50 +02:00
ba7e36c719 Sort files by date when using 'add' command autocompletion, listing newest on top 2012-08-09 14:55:50 +02:00
e6e0eefaa4 Added (quite elaborate) inexact-case torrent name completion 2012-08-09 14:55:50 +02:00
a750999e0e Do not append space after the math. It ruins file path autocompletion 2012-08-09 14:55:50 +02:00
40a6b11a1b Re-fixed shortening which I broke during the last rebase 2012-08-09 14:55:49 +02:00
471757d6c6 Fix problems with moving selection caused by deluge-console emptying selection when only one element is selected 2012-08-09 14:55:49 +02:00
2373eda462 Add config option to change amount of torrents to list per tab press 2012-08-09 14:55:49 +02:00
a0a18e1036 Make 3rd+ tab list more/all of the remaining torrents and a preference to toggle these behaviors 2012-08-09 14:55:49 +02:00
04ed96d121 Made additional formatting for input controls optional and on by default for popups so it doesn't show up in preferences but still works when setting torrent options 2012-08-09 14:55:48 +02:00
05758245a1 Added functions for adding spin inputs to popup. Added support for default non-number values to them(they return None in that case). Added proper scrolling to InputPopup. Tweaked visual style 2012-08-09 14:55:48 +02:00
a28e40ea35 Add option(on by default) to move selection when moving torrents up/down the queue. Known bug: Incorrect behavior when trying to move bottommost torrents to the bottom, has no impact besides being unexpected. 2012-08-09 14:55:48 +02:00
14bfa24195 Add smarter selection selection for torrent detail view - highlight directories with selected files inside as partially or fully selected, select not only directories but also files inside. 2012-08-09 14:55:47 +02:00
8a261b26e8 Revamped info command detailed file view so it now shows a pretty tree look and made it ensure at least 8 characters of torrent ID get printed before deciding not to wrap to next line in the default, compact view 2012-08-09 14:55:47 +02:00
a2c347a79c Add proper support for double width characters to legacy mode and few related formatting functions 2012-08-09 14:55:47 +02:00
415bc22dd9 Completely remove placement of three dots symbol between columns, including option concerning it. 2012-08-09 14:55:47 +02:00
6edd159626 Add scrolling using Page Up/Down and Home/End in torrent detail view 2012-08-09 14:55:46 +02:00
1a1518ac1d Fixed autocompletion bug, removed some useless comments 2012-08-09 14:55:46 +02:00
508dec4858 Modified autocompletion to only list a limited amount of matches(use info for full list), color coded it, modified to show both torrent names and ID as well as highlight matching part, show green 'Autocompletion matches' text for more than 4 matches so it's more readable. Depends on previous commit 2012-08-09 14:55:46 +02:00
80b88bf047 Modified the info command to be more compact and concise by default, old behavior(with tracker and save location info added) moved to -v switch, old verbose mode(files and peers) moved to -d switch 2012-08-09 14:55:46 +02:00
249e331ae9 Add option to not store duplicate input in command history for legacy mode. 2012-08-09 14:55:45 +02:00
47ba11be1b Pass console config to torrentdetail and format_utils, add an option to disable three dots when trimming columns(they piss me off) 2012-08-09 14:55:45 +02:00
163870afd9 Rename torrent_options to manage. 2012-08-09 14:55:45 +02:00
117d29ae72 Author: eirikba
Found this in the trac
http://dev.deluge-torrent.org/ticket/1858
description:
This patch adds a command to deluge-console to show and set per-torrent options. I have called the command "torrent_option" and mostly modeled it on the "config" command. A better name for the command would be nice, but I have no better suggestion at this time.
2012-08-09 14:55:45 +02:00
8dc5b07818 Map delete key to remove torrent(s) dialog 2012-08-09 14:55:44 +02:00
acb77213e1 Make torrent_actions_popup capable of directly displaying/executing one of the torrent actions without displaying choice dialog 2012-08-09 14:55:44 +02:00
e68358661a Revamped torrent removing dialog so it's harder to accidentally remove data. Also, it lists torrents being removed now 2012-08-09 14:55:44 +02:00
d9789504ff Replace empty lines in InputPopup with generic text(lines are of course still there) 2012-08-09 14:55:44 +02:00
98101ea411 Implement a call to os.sep in regards to auto completion
Added small amount of code which calls os.sep so we know if we should append "/" or "\\" to the end of a dir.
2012-08-09 14:55:43 +02:00
f33a6a68e4 Inform the user how to navigate connection manager
Added a quick line to let the user know to user the up & down arrows when adding a host[it isn't as intuitive as you might think]

Using tab to switch input fields when adding a host is something that *should* be added in the future… [more intuitive]
2012-08-09 14:55:43 +02:00
03fefc279b Change .clear() -> erase()
Change .clear() to -> .erase() should eliminate flicker issues.
I'm unsure whether I should've  changed line 105 of popup.py.. we can revert if there is any issues.

Note: we only want to erase() during refreshes, if we are changing modes we do want to clear() the screen(at least I think we do… it might make sense to just use erase() everywhere for consistency… I/we should look into this)
2012-08-09 14:55:43 +02:00
e85be7cccb Update help for 'info'
This commit updates help information when you run `help info`. We inform user of Tab Completion, and of `info *`.
There is also some removal of duplicate information(no need for line about `info -s <state>` since we tell the user that when they read the option about '-s')
2012-08-09 14:55:43 +02:00
b8f2a1da1a Removed trailing whitespace 2012-08-09 14:55:42 +02:00
b1ce567819 Add config option to change amount of torrents to list per tab press 2012-08-09 14:55:42 +02:00
68db1d4c13 Restored underline for currently selected option in SelectInput that I accidentally did in few commits ago 2012-08-09 14:55:42 +02:00
5796e025e6 Make 3rd+ tab list more/all of the remaining torrents and a preference to toggle these behaviors 2012-08-09 14:55:42 +02:00
8819ec0575 Escape spaces in paths in legacy mode 'add' command. This also makes backslashes unsupported(but you're a bad person for having them in paths anyway) 2012-08-09 14:55:41 +02:00
a24c679510 Made additional formatting for input controls optional and on by default for popups so it doesn't show up in preferences but still works when setting torrent options 2012-08-09 14:55:41 +02:00
c2b4ccdc77 Fixed info sometimes shortening the ID even when there's enough space. 2012-08-09 14:55:41 +02:00
8d07a697d3 Made moving selection along with queue delayed, just like queue operations themselves 2012-08-09 14:55:41 +02:00
459c4aebb9 Updated "move selection with queue" feature to reflect changes in behavior 2012-08-09 14:55:40 +02:00
010fd165c6 Fixed bugs concerning negative numbers in spin inputs and sometimes returning wrong values. 2012-08-09 14:55:40 +02:00
27f0e86afd Add setting sequential_download option, set options that core.set_torrent_options doesn't support directly, remove setting 'private' torrent option as it's read-only anyway 2012-08-09 14:55:40 +02:00
a436eb8aa6 Fixed spin inputs not updating their values until deselected 2012-08-09 14:55:40 +02:00
3f5099bd05 Added setting per-torrent options to console mode. Mapped to 'o' key, supports setting options for multiple torrents at once(when values differ, leave the default value alone to not touch that option) 2012-08-09 14:55:40 +02:00
2625bbc7fd Added functions for adding spin inputs to popup. Added support for default non-number values to them(they return None in that case). Added proper scrolling to InputPopup. Tweaked visual style 2012-08-09 14:55:39 +02:00
0f18463df0 Fixed bug that would cause info command to sometimes 'shorten' torrent ID in a way that in the end makes it longer(some of characters repeat) 2012-08-09 14:55:39 +02:00
6b8428e262 Fix behavior of __get_contained_files_count when passed file id parameter and thus fix bug causing discrepancy in behavior when (un)selecting partially selected folders(will now unselect them all the time) 2012-08-09 14:55:39 +02:00
a8a24bf0d9 Removed trailing whitespace 2012-08-09 14:55:39 +02:00
c30a86e52a Add option(on by default) to move selection when moving torrents up/down the queue. Known bug: Incorrect behavior when trying to move bottommost torrents to the bottom, has no impact besides being unexpected. 2012-08-09 14:55:38 +02:00
591f9a19e5 Add smarter selection selection for torrent detail view - highlight directories with selected files inside as partially or fully selected, select not only directories but also files inside. 2012-08-09 14:55:38 +02:00
c62547d401 Revamped info command detailed file view so it now shows a pretty tree look and made it ensure at least 8 characters of torrent ID get printed before deciding not to wrap to next line in the default, compact view 2012-08-09 14:55:38 +02:00
16f62bbcfe Add proper support for double width characters to legacy mode and few related formatting functions 2012-08-09 14:55:38 +02:00
412d0e7be9 Completely remove placement of three dots symbol between columns, including option concerning it. 2012-08-09 14:55:38 +02:00
98c9aaf600 Remove trailing backslashes to avoid breaking shlex that is used to split parameters passed to commands 2012-08-09 14:55:37 +02:00
f5c8968aa6 A quick and ugly fix(try-except) for crashes involving multiselection 2012-08-09 14:55:37 +02:00
149cbae4dc Add scrolling using Page Up/Down and Home/End in torrent detail view 2012-08-09 14:55:37 +02:00
b689fe1d98 Fixed autocompletion bug, removed some useless comments 2012-08-09 14:55:37 +02:00
a6c1bc1d4a Modified autocompletion to only list a limited amount of matches(use info for full list), color coded it, modified to show both torrent names and ID as well as highlight matching part, show green 'Autocompletion matches' text for more than 4 matches so it's more readable. Depends on previous commit 2012-08-09 14:55:36 +02:00
ab6dc2d11f Added a function for stripping formatting to be used in other places. 2012-08-09 14:55:36 +02:00
ced1475233 Modified the info command to be more compact and concise by default, old behavior(with tracker and save location info added) moved to -v switch, old verbose mode(files and peers) moved to -d switch 2012-08-09 14:55:36 +02:00
1391f20658 Add option to not store duplicate input in command history for legacy mode. 2012-08-09 14:55:35 +02:00
b1439274c6 Pass console config to torrentdetail and format_utils, add an option to disable three dots when trimming columns(they piss me off) 2012-08-09 14:55:35 +02:00
6422f11971 Fix autoconnecting to the default host 2012-07-17 17:23:39 -07:00
8e7432e71c Added a protocol for the network traffic between client and daemon.
Implemented a protocol layer above twisted.internet.protocol.Protocol
which guarantees correct transfer of RPC messages. The network messages
are transfered with a header containing the length of the message.
2012-07-02 02:09:14 +02:00
5dc6dbf216 Fix #1943 - invalid session id when calling a rpc exported function from a plugin when no client is connected 2012-06-10 16:59:49 -07:00
6cb1fd76cc Fix #2062 : Console discards text before first colour string 2012-04-20 12:35:21 +01:00
934a0f6495 fix mistake in last commit 2012-04-19 18:09:31 +01:00
266127bb69 Fix #2065 : Console crash with missing closing quote 2012-04-19 16:02:09 +01:00
acecd6d522 Catch & log KeyError when removing a torrent from the queued torrents set
This seems to happen due to libtorrent firing the torrent finished event
twice.
2012-04-18 13:29:13 +01:00
2cdcae8d31 win32 build scripts updated from 1.3-stable 2012-04-18 13:27:24 +01:00
cb2212d2f3 Update Changelog 2012-04-18 13:27:00 +01:00
9fd527f465 WebUI: Increase focus delay for password field cursor 2012-04-18 13:00:14 +01:00
828b3204b8 Fix #2071 : KeyError in gtkui when file priority set to value '3'
Bug results from setting file priority value in core which does not
exist in the FILE_PRIORITY dict used by UIs.
2012-04-18 12:58:09 +01:00
8fdfdc2b25 Gtkui: move height request to child widget in create dialog 2012-04-18 12:57:53 +01:00
bfae766f8a Fix missing semi-colon in deluge.desktop 2012-04-18 12:55:52 +01:00
569dd0c585 Console: Fix prefixed space for tab completing commands 2012-03-26 19:27:58 +01:00
211c27aaae Console: Fix missing trailing space for command options with tab complete 2012-03-26 19:27:01 +01:00
e2608a0ac9 Remove unnecessary translation from connection manager 2012-03-26 19:17:56 +01:00
7625812c8c Use (documented) formatdate over format_date_time 2012-03-23 19:28:29 +11:00
beb35c5c35 Grey out file priorities for 'is_seed:True' seeding torrents 2012-03-22 01:34:49 +00:00
14eb3e51b0 Bring MainWindow to front when opening another instance of gtkui 2012-03-22 01:15:45 +00:00
d62da02bae Improve Magnet and Url support for add command in console 2012-03-21 22:35:14 +00:00
61dbd349ab Hide unused Infohash button in WebUI 2012-03-14 00:26:08 +00:00
f102e988c9 Preserve order when moving multiple torrents in the queue 2012-03-12 23:51:47 +11:00
78df634fed Add get_queue_position & use it for sorting ids 2012-03-12 23:51:45 +11:00
e6e677e7d0 Fix not properly detecting when torrent is at end of queue 2012-03-12 23:51:21 +11:00
edca36fa73 Update Changelog 2012-03-11 20:22:47 +00:00
758f4ef920 Label Plugin: Mark 'Label Options' for translation 2012-03-11 20:19:07 +00:00
30ee7fb170 Label Plugin: Disable menu items for 'All' in sidebar 2012-03-11 20:19:00 +00:00
8010f2fcc1 Label Plugin: Defer translate No Label text in submenu 2012-03-11 20:17:11 +00:00
d98eb06f69 Fix Label Plugin text 'All' for translation in sidebar 2012-03-11 20:16:13 +00:00
7f88f59272 Mark torrent menu Pause text for translation 2012-03-11 20:09:42 +00:00
f6127e1747 Fix #2052 : Progress bar state text marked for deferred translation 2012-03-11 20:07:40 +00:00
9ecc9ab7ad Modified fix for #1957 non-acsii columns 2012-03-11 01:05:12 +00:00
17d12fbaf2 Fix for Up Speed column not sorting in Webui 2012-03-10 13:21:09 +00:00
068ba7bc6f Allow a minimum of 0.1 for "Stop Seed at Ratio" regarding label options. 2012-03-08 18:53:09 +00:00
713f7eff7a Fix collapsed treeview in Create Torrent dialog 2012-03-04 19:34:27 +00:00
74181469bc Fix compatibility for Python2.5 and Debian Lenny
Recent commit to handle warnings were >=Py2.6 and glib binding is
unavailable on Debian Lenny.
2012-03-04 19:28:51 +00:00
b396b11611 Set process name to match application using setproctitle
Using the setproctitle module the process name displayed in top
and other places will correctly reflect the binary name. This is an
optional dependency
2012-03-04 19:13:33 +00:00
8503687136 Fix adding magnet error in webui when started from classic mode 2012-03-03 23:43:34 +00:00
f0051ee81f Add a define to fix build error with libtorrent trunk 2012-03-03 11:52:44 -08:00
31222a5ab6 Add gtkui template to feeder plugin 2012-03-03 02:09:23 +00:00
752e5a7a8f Fix #2045 : UnicodeDecodeError when using non-ascii chars in info
Input arg string needed decoding otherwise comparing with unicode
torrent name fails.
2012-03-02 15:44:08 +00:00
2ecb54c4f7 Ensure is_finished value is correct after state changed alert
Set torrent.is_finished to false when torrent is in a Checking or Downloading state
2012-03-02 14:23:25 +00:00
7ae912114b Fix #2021 : Share ratio limit not obeyed for torrents downloaded outside deluge
Share ratio limit is based upon torrent.is_finished and a seeded torrent added
to the session was not set after checking.
2012-03-02 14:21:16 +00:00
e33d834cc9 Update Changelog 2012-03-02 14:00:58 +00:00
9c0a450a47 Blocklist: remove default url as it is outdated 2012-03-02 13:59:59 +00:00
debae00246 Fix preferences dialog not opening with main window on Windows 2012-03-02 13:55:52 +00:00
a1949bc020 Fix #1976 : Text entry with trailing newline characters causes issues for Move Storage
Changed most GtkEntry truncate-mutliline properties to True for all single line
entries to prevent similar issues.
2012-03-02 13:54:08 +00:00
968abf9d54 Add optparse custom version to prevent unnecessary loading of libtorrent 2012-03-02 13:31:38 +00:00
9053280e14 Alternative fix for re-enabling plugin issue 2012-03-02 13:19:23 +00:00
6d2e88eeee Update Changelog 2012-03-02 13:16:13 +00:00
f1ddd236ce Fix #2038 : Chrome 17 disconnecting from webui 2012-03-02 13:10:35 +00:00
be5a0b3dc5 Catch glade object issue when re-enabling Autoadd
Found an additional glade object from the previous instance of Autoadd
calling cb_get_config resulting in an exceptions.AttributeError.
This workaround simply checks that get_widget is not None.
2012-03-02 13:09:44 +00:00
614b002d8b Fix plugins not showing enabled in webui 2012-03-02 13:07:29 +00:00
a494471ed4 Fix potential keyerror for on_torrent_removed in sessionproxy 2012-03-02 13:02:11 +00:00
31ff64b537 Execute: log stdout/stderr when command fails 2012-03-02 13:34:56 +11:00
ba75ae4ccc Execute: make running commands asynchronous
This prevents deluge from hanging while it waits
for a command to finish.
This also prevents a deadlock from occuring
(c.f. warning at
 http://docs.python.org/library/subprocess.html#subprocess.Popen.wait)
2012-03-02 13:34:49 +11:00
fd28bf8619 Properly wait for the component.shutdown deferred on shutdown. This should prevent the daemon from exiting before all the state has been saved. 2012-03-01 13:11:11 -08:00
ae6af18f0d Remove setting torrent.is_finished in the resume alert 2012-02-29 15:23:17 -08:00
b47dc73d30 Disable check for user and group options on Windows 2012-02-24 15:29:58 +00:00
1696fd1103 Updated Changelog and compressed js 2012-02-23 00:49:55 +00:00
b5c63c4d58 More fixes for labels plugin webui
Disabled options and remove for filters No Label and All
Removed All from torrent menu
Fixed No Label not working in torrent menu
Bumped version to 0.2
2012-02-23 00:49:55 +00:00
330019bb3d Fix #2036: new labels are not sorted on torrent right click 2012-02-23 00:49:55 +00:00
4bbf9e2ea6 tabs to spaces label.js 2012-02-23 00:49:55 +00:00
6e6f6313a8 Fix missing desktop file preventing install 2012-02-23 00:49:55 +00:00
af19e3bc62 Fix setting daemon listen interface from command line 2012-02-23 00:49:55 +00:00
40e4fb9b8e Catch and log ReactorNotRunning when stopping reactor in gtk 2012-02-23 00:49:55 +00:00
62c7209558 Add Webui keymaps for torrents - Ctrl-A (select all) and Delete 2012-02-23 00:49:55 +00:00
f897f03227 Add magnet uri support to Add Url in Webui 2012-02-23 00:49:55 +00:00
38210ae11e Fix #2037: webui 'Add Torrents' dialog torrents list not scrolling 2012-02-23 00:49:55 +00:00
0ccf0730ea Fix progress bar display
When first loading webui is browser this.style is undefined and p.style
contains the width of the progress column however after this point
p.style contains the width of the previous column so need to use
this.style which now represents the progress column width.
2012-02-23 00:49:54 +00:00
abc82c1439 Update extensions to Ext JS 3.4.0 2012-02-23 00:49:54 +00:00
e9239be691 Ignore unmaximise event when window isn't visible
This fixes the bug where a maximised main window
will become unmaximised (on restart) after
quitting deluge from the system tray.
2012-02-23 00:49:54 +00:00
8452b63d19 Multiple Magnet links support in autoadd plugin 2012-02-23 00:49:54 +00:00
6f77703e29 Magnet link support in autoadd plugin
Check the watch folders for .magnet files which contain valid magnet links
and add them.
2012-02-23 00:49:54 +00:00
2b01ba43cb Fix #2035: If auto_add_trackers is empty, it is an array 2012-02-23 00:49:54 +00:00
eceaa0ae4f catch and log 'glib.GError: Unrecognized image file format' error 2012-02-23 00:49:54 +00:00
ae9eb15d5c Update Changelog 2012-02-23 00:49:54 +00:00
2793e1ec53 Add missing columns to WebUI
Added Download,Uploaded,Down Limit, Up Limit & Seeder/Peeds. Also selected
columns start out hidden to match gtkui and the name column has a minimum
width of 150.
2012-02-23 00:49:54 +00:00
ec27028f1b Webui applies changes when OK clicked in Preferences 2012-02-23 00:49:54 +00:00
ba60ae09d5 Fix #1954 : 'invalid literal for float' console error when setting listen interface 2012-02-23 00:49:54 +00:00
aa0f41ac17 Cleaner log entry if deluged missing 2012-02-23 00:49:54 +00:00
4a7876f203 Add scheduler plugin page to webui 2012-02-23 00:49:53 +00:00
101ad99c14 web: update to extjs 3.4.0
There are numerous fixes to the framework between 3.1.1 and 3.4.0 and
since there are no obvious bugs introduced it's only sensible to pull
the update in to the stable branch
2012-02-23 00:49:53 +00:00
0d3ba7541e Remove unnecessary migration function as this default value should be picked up from the DEFAULT_PREFS dictionary 2012-02-19 17:57:44 -08:00
c8718ad643 Implemented #1382:
* Implemented whitelist support to both core and GTK UI.
* Implemented ip filter cleaning before each update. Restarting the deluge
  daemon is no longer needed.
* If "check_after_days" is 0(zero), the timer is not started anymore. It would
  keep updating one call after the other. If the value changed, the timer is
  now stopped and restarted using the new value.
2012-02-15 14:21:02 +00:00
da868347cf ui: fix setting capital log level
Whilst providing the log level as a lowercase string has worked
for a long time trying to use DEBUG doesn't work, so lowercase
the string first.
2012-01-19 01:42:17 +00:00
f4fab86767 Fix stored file priorities settings
File priorities stored in torrent options were based upon the supplied
funtion values rather than the current values stored in libtorrent. So
if the priorities failed to be set by libtorrent the settings would be
out of sync.
2012-01-19 01:33:16 +00:00
517addb9f9 Update Changelog 2012-01-10 02:10:20 +00:00
8c1ef7d6af update changelog 2012-01-10 02:10:13 +00:00
c87245320d fix #1481 file uploads from behind a reverse proxy 2012-01-10 01:26:05 +00:00
983c9dad99 apply patch from #1548 2012-01-10 01:19:24 +00:00
f299be0eb9 Fix #1929 : Update setup.py to clean deluge*.egg_info dir from root dir 2012-01-09 23:20:48 +00:00
a01f45cc7a Fix #1936 : Referenced before assignment error in json_api 2012-01-09 23:20:48 +00:00
3b1ac4e81f Fix #1895 : Files Tab showing wrong files due to torrent_info race condition 2012-01-09 23:20:48 +00:00
bebdec9ebb Update AUTHORS 2012-01-09 23:20:48 +00:00
3a91f87679 Remove unneeded license from blocklist 2012-01-09 23:20:48 +00:00
be49fd6a40 Fix #2010 : Move speed text in titlebar to the beginning 2012-01-09 23:20:48 +00:00
c88ba97531 Strip trailing space and tabs in aboutdialog 2012-01-09 23:20:47 +00:00
aa726f723b web: fix gen_gettext script
The script for generating the gettext.js file was outdated and needed
a fix to work with the newer layout of the javascript source code, it
was still looking for Deluge.Something files which no longer exist.
2012-01-09 21:58:48 +00:00
f8651b63c8 Webui: Smaller minSize for Sidebar and remove 1px border from mainpanel 2012-01-07 21:16:13 +00:00
c020d71327 Remove dotted line on buttons in Firefox 2012-01-07 21:12:29 +00:00
527d5541d7 Add Deluge and icon to start of toolbar in webui 2012-01-07 21:12:07 +00:00
57df1bb7c4 Fix clipped Browse button in WebUI 2012-01-07 21:09:32 +00:00
5ad9ff7333 Fix plugin uploads from behind a reverse proxy 2012-01-07 21:06:54 +00:00
7d7e3fad1e Fix password box focus issue in Firefox 9 for WebUI 2012-01-07 21:05:29 +00:00
e8eb7a33f0 Fix #1915 : Unable to stop the status bar from autohiding 2012-01-07 21:02:47 +00:00
8da618a4f2 Remove uneeded Title to save space in WebUI 2012-01-07 20:58:59 +00:00
1c3d8c214c Hide unused Create button in WebUI 2012-01-07 20:57:33 +00:00
bbde86cfb8 web: fix font in loaded html
When dynamically loading the content panels in the details panel they
would sometimes look quite bad since the only font they have been
told to use is verdana. Fix this why using the same as extjs.
2012-01-07 20:55:27 +00:00
5e36722047 Update Changelog 2012-01-07 20:55:15 +00:00
ee35fe1cad Fix #1961 : Missing 'All' filter option for Label plugin 2012-01-07 19:54:00 +00:00
a83fd1d597 Update About dialog for translation 2012-01-07 19:50:14 +00:00
4dbbb4d676 Add clean desktop file to setup.py 2012-01-07 19:47:16 +00:00
6c8e2b48e3 Fix issue in saving libtorrent session state 2012-01-07 19:46:38 +00:00
55892061f5 Update AUTHORS with new paths to plugin and data locations 2012-01-07 19:37:15 +00:00
ae8ea820ef Update Win32 README 2012-01-07 19:33:17 +00:00
d06a0e4f40 Update README file 2012-01-07 19:31:10 +00:00
9bfb565354 New AUTHORS file 2012-01-07 19:26:11 +00:00
132a8f9f0c Add unneeded files for release to export-ignore 2012-01-07 19:25:36 +00:00
75b9fd5cb4 Build deluge-all.js 2011-12-07 01:03:00 +00:00
774e614f7b Update webui build file to run on Ubuntu 2011-12-07 00:52:10 +00:00
9e43956e1b Fix spelling mistake 2011-12-06 23:51:00 +00:00
9d16b50075 Fix #1917 : UnicodeDecodeError with long torrent names 2011-12-04 13:01:50 +00:00
04b8949178 Fix #1988 : Problem retrieving colormap for piecesbar 2011-12-04 00:03:39 +00:00
b69163b57d Fix #1828 : Auth issue with args passed to console 2011-12-03 23:04:47 +00:00
006624f568 Fix missing comma in notifications plugin 2011-12-03 17:09:55 +00:00
4acf548436 Revert "Fix #1338 Seeds and Peers totals not updating"
Did not fix the issue.
This reverts commit 1a9ae62669.
2011-11-29 19:17:30 +00:00
d9193fcc4f Update to the DnD windows fix
Found that the original fix worked fine with GTK v2.24 but with v2.16 on Windows get_uris is empty
2011-11-29 19:17:20 +00:00
a779a4a7ea Fix #1905 : No email sent to second email address in Notifications plugin 2011-11-29 19:14:42 +00:00
2a3d8ae156 Fix #1945 : Mutable default arguments in deluge.ui.client 2011-11-29 19:10:53 +00:00
07d4aff13b Change Windows default download path from '~' to '~\Downloads' 2011-11-29 19:08:41 +00:00
838f9331be AddTorrent file dialog now can browse network shares 2011-11-29 19:08:34 +00:00
3c3f93db3e Fix #1918 : Drag'n'Drop not working in Windows 2011-11-29 19:06:56 +00:00
d98231a713 Remove code duplication in queuedtorrents.py, use ipcinterface process_args() instead 2011-11-29 19:03:59 +00:00
a50c83c284 Modify log message from Error to Warning level 2011-11-29 19:02:20 +00:00
05f30b58c1 Fix Webui files-tab menu setting wrong priority 2011-11-29 19:01:20 +00:00
a932767545 Fix #1921 : GTKUI reports free disk space incorrectly 2011-11-29 18:59:13 +00:00
c29d3bb930 Fix #1967 : IndexError when trying to open a non-json conf file 2011-11-29 18:55:30 +00:00
b4a73cabf3 Fix LP#821577 : UnpicklingError when external selection dragged onto Files Tab 2011-11-29 18:55:22 +00:00
16bbedaf2b Fix #1964 : Unhandled UnpicklingError with corrupt state file 2011-11-29 18:55:14 +00:00
b2eb5aeb8c Fix #1944 : Use errno constants for portability 2011-11-29 18:54:06 +00:00
3dcfa5cfd8 Fix #1912 : Exit nicely from get_libtorrent.sh if svn not installed 2011-11-29 18:47:05 +00:00
307ffe734a Fix #1941 : Increase UIs max cache value to 999999 (15GiB) 2011-11-29 18:46:26 +00:00
ead734cbf0 Fix #1960 : Web UI statusbar shows total_payload_download for upload 2011-11-29 18:42:28 +00:00
46ab11961e Fix #1928 : Crash when dragging column header
The fix specifically applied to on_alert_save_resume_data by moving function call str(alert.handle.info_hash()) into the try statement. For completeness any calls to str(alert.handle.info_hash()) also moved into try statements.
2011-11-29 18:32:06 +00:00
58adbe94b9 Fix #1940 : File & folder renaming issue when using Add Torrent dialog in Windows
The file rename in torrentmanager was calling lt.rename_file directly
so skipping the sanitize function normally applied when renaming.
2011-11-29 18:27:44 +00:00
7227c97cac Fix typo in Windows shutdown handler 2011-08-08 10:42:29 -07:00
4fcfb677a4 Allow changing ownership even though the owner column is not visible. 2011-08-03 11:59:42 +01:00
808ff02130 Fix path for desktop file 2011-07-29 20:56:48 -07:00
08a0a2de99 Fix i18n sub-dir issue in gitignore 2011-07-28 22:56:22 +01:00
fd56ccaabf Fix .desktop file creation on Windows by just ignoring it 2011-07-28 22:53:40 +01:00
cebddf9c79 Add my name to author list 2011-07-22 19:29:32 +01:00
e9b602d85f Update windows setting 2011-07-19 16:50:56 -07:00
5b2d37954c Add intltool to dependencies 2011-07-13 23:27:00 +01:00
fcc13f454b Fix torrent file and folder renaming issues
Adds `sanitize_filepath` for use before passing to libtorrent rename_file
2011-07-13 22:44:13 +01:00
15ef668fef Localize the Desktop file
Conflicts:

	setup.py
2011-07-13 21:49:25 +01:00
bf145c0715 Option tab spin buttons connected to key press events 2011-07-11 17:23:42 +01:00
192f3d88e5 set spinbuttons numeric only 2011-07-11 16:27:48 +01:00
d9cf3a8c08 Remove un-needed signal handlers. 2011-07-11 15:15:45 +01:00
a41b1357b5 Update translations files 2011-07-11 14:27:08 +01:00
c3c21dae72 More missing(?) signal handlers. Refs #1891. 2011-07-10 23:24:10 +01:00
4daa7e2470 Fix the options tab. Refs #1891 2011-07-10 22:51:10 +01:00
b301051cdd Fix #1637: UnicodeDecodeError from 'deluge-console --help' with other languages 2011-07-10 16:45:02 +01:00
456f660878 Add some more lost signal on the Glade to GtkBuild migration. 2011-07-10 02:58:46 +01:00
f7ce07c68f Tidy up location of gettext setup_translations 2011-07-10 02:10:14 +01:00
9eb85cb6eb Fix lost signals for peers tab menu, files tab menu and options tab. 2011-07-10 02:05:20 +01:00
40fd945f70 Fix translation string in Freespace plugin 2011-07-10 01:58:08 +01:00
78944f47f3 Allow compiling translations in develop mode.
Translations will compiled into `deluge/i18n` instead of the build lib so that they can be used in a deluge develop mode install.
2011-07-10 01:20:13 +01:00
acb747bfd5 Log from where translations are being loaded. 2011-07-10 00:43:56 +01:00
0c1055511d Raw attempt of fixing the GtkBuilder introduced bugs. 2011-07-10 00:43:01 +01:00
f0c327a024 Fix #1505: Add libtorrent info to --version output 2011-07-09 23:19:57 +01:00
b81159f295 Fix #1801: ConsoleUI failed connect missing error message 2011-07-09 22:11:13 +01:00
ca86aa5714 Fixes keyerror with existing file priorities set to High 2011-07-08 23:34:02 +01:00
fc7fa94319 Add handler for drag_data_received to supress warning 2011-07-08 23:23:03 +01:00
c6ee8cf39d Do not use Ellipsis. 2011-07-08 10:03:04 +01:00
bd7bbc4e33 Add some "now needed" missing imports. 2011-07-08 04:07:04 +01:00
312a57aa50 Remove some left overs. 2011-07-08 00:39:48 +01:00
f87ed6d5a6 Moved the MainWindow to GtkBuilder.
This probably broke some behaviour because converting and splitting from libglade to GtkBuilder is not as perfect as it should be. What I noticed was fixed.
Also, GtkBuilder only allow calling `connect_signals()` once. Some code had to change to handle this and a "handlers proxy class" was created to keep the behaviour we had, ie, connect signals from where it was needed. Then I monkey patch the main windows GtkBuilder to not allow anyone to connect signals through it since it would break behaviour. Connecting signals to the main window builder instance is now done like `component.get("MainWindow").connect_signals()`. The best solution will probably break the main window ui into the needed parts in order to not have to monkey patch main windows builder.
Plugin's trying to get the main windows `main_glade` are now broken, on purpose, ie, the code they have needs to change since the calls to the builder are not the same as the calls to libglade. The plugins we ship with deluge will be fix as soon as possible.
2011-07-07 20:48:02 +01:00
4234311050 Start with a bigger width. 2011-07-07 20:48:02 +01:00
a47da57c0d Make sure the tracker url is of type string and not unicode. Never had this issue previously though. 2011-07-07 20:48:02 +01:00
13528fe7f8 Fix httpdownloader Tests 2011-07-07 01:22:51 +01:00
99358dcbb0 Fix httpdownloader error with existing filename 2011-07-07 00:11:00 +01:00
16cc8f6eea LP Bug #496265: Peers in PeersTab show non-zero download rate when seeding 2011-07-07 00:11:00 +01:00
a384cd70b3 Moved system tray to GtkBuilder. 2011-07-06 22:20:15 +01:00
0e00aa479b Moved queued torrents dialog to GtkBuilder. 2011-07-06 22:14:20 +01:00
807bc095b4 Moved remove torrent dialog to GtkBuilder. 2011-07-06 21:10:24 +01:00
5a81ab3c35 Moved the preferences dialog to GtkBuilder. 2011-07-06 20:56:58 +01:00
bad228645c The Stats plugin should not be using the old logging system. 2011-07-06 20:56:08 +01:00
e016b2106f Fix some broken GtkBuilder files. 2011-07-06 20:03:32 +01:00
f63f247ac5 Forgot to rename a glade from when migrating it to GtkBuilder. 2011-07-06 19:31:47 +01:00
0228af6b50 Add some missing .ui files. 2011-07-06 19:30:01 +01:00
90fb40b741 Moved the menubar to GtkBuilder. 2011-07-06 19:29:27 +01:00
367631c9aa Migrated filtertree_menu.glade to GtkBuilder. 2011-07-06 19:17:44 +01:00
b36d62be9b Fix #1263: GTK UI not remembering column width
Removing a column from the treeview on shutdown causes all the
column widths to be zero which are saved to the state file.

The workaround is to not save the state file if all columns are zero.
2011-07-06 19:16:31 +01:00
b4cc1d4358 Splited dgtkpopups.glade into other_dialog.ui and connect_peer_dialog.ui which are now using GtkBuilder. 2011-07-06 19:09:25 +01:00
39ad5a3596 Moved edit trackers dialog to GtkBuilder. Min PyGTK version is now 2.16. 2011-07-06 18:54:40 +01:00
dbad4684db Create torrent remotely progress information.
Support progress information when creating torrents remotely. For this to be possible, a method was added to the `RPCServer`, `emit_event_for_session_id()`, which does exactly what is says. This is needed because the event created, `CreateTorrentProgressEvent` needs to be addressed to a single session id, not all session ids interested in that event.
Fixed a bug that apparently was not found yet. When creating torrents locally, we defer that task to a thread. Since this thread updates UI widgets, namely the progress bar info and since we can't guarantee that it's the main thread, updating the widgets must be done by calling `gobject.iddle_add()`.
2011-07-06 16:45:02 +01:00
12d0e9574b Migrated create torrent dialog to GtkBuilder.
Additionally creating a torrent and saving it on a remote path now mimics the behaviour on doing it locally. Need to evaluate to see if it's possible to also show a progress when doing this remotely as now, the progress is only seen when doing it locally.
2011-07-06 12:45:50 +01:00
dd50b7bea1 Include deluge/ui/gtkui/glade/*.ui data files in setup.py. 2011-07-06 12:33:44 +01:00
4dc4049851 Migrated the connection manager to GtkBuilder. 2011-07-06 11:33:31 +01:00
27a6e398ee Migrated the "add torrent dialog" to gtkbuilder. 2011-07-06 11:17:13 +01:00
7035b1f166 Specify the plugin's name on logging calls. 2011-07-06 11:10:46 +01:00
a701fddbe8 Fix #948: New Release Dialog does not show server version 2011-07-05 19:49:53 +01:00
b512a664c6 Properly set/restore visibility when torrent is/is not "compact". 2011-07-05 15:46:36 +01:00
5bffa3757d Don't default to "localclient" as owner unconditionally.
Only set "localclient" as a last resort, first try to find out who is logged in.
2011-07-05 15:29:51 +01:00
8b6d6e3836 Fix broken SessionProxy tests. 2011-07-05 09:29:12 +01:00
37b9277c0e Update ubuntu tracker icon test 2011-07-05 18:00:06 +10:00
cf891125e6 Only deregister component if registry still exists 2011-07-05 17:58:18 +10:00
f75ec9d484 Fix translation of KiB/s 2011-07-04 21:39:08 +01:00
9a1ae06033 Fix #1239: Translated Tracker Error text not counted in sidebar Error status 2011-07-04 21:29:58 +01:00
55f456d851 Fix up/down speed labels in status tab 2011-07-02 19:14:26 +01:00
c346687510 Fix #1715: AddTorrentsDialog does not display filename changes when switching between torrents 2011-07-02 19:14:26 +01:00
08ee3d8f69 Fix #1582: Wrong path separator returned when moving storage in Windows 2011-07-02 19:14:18 +01:00
795f633bc4 Fix #491: Add auto_manage_prefer_seeds to prefs manager and UIs 2011-07-02 18:44:26 +01:00
b6596a27bc Add 'Last Seen Complete' to GTK and WebUI Status Tabs 2011-07-02 15:50:04 +01:00
b7fd2d1bf1 Fix #1338 Seeds and Peers totals not updating 2011-07-01 02:40:40 +01:00
0f625943c0 Fix #1477: Execute Plugin should ignore Added events from state file on startup 2011-06-30 19:24:38 +01:00
420447e386 Fix #1232: Improve display of Peers Tab IPv6 addresses 2011-06-30 18:02:06 +01:00
a79520e3ee Fix append trackers error occuring with magnet uris 2011-06-30 17:30:46 +01:00
8ae26c368e Add #890: If added torrent already exists, append extra trackers to it 2011-06-28 01:34:58 +01:00
981ad6d7d2 Fix #1246: Losing Labels upon restart 2011-06-27 22:53:47 +01:00
3b5e70580e Fix from_state in TorrentAddedEvent 2011-06-27 22:50:47 +01:00
71f9ef6499 Adjust file priorities to make Highest actually the highest allowed by libtorrent and High has been changed to what Highest was 2011-06-21 10:50:57 -07:00
7dd54b4b34 Save and restore Preferences dialog size from config 2011-06-19 23:29:54 +01:00
c64ed6adc5 Fix preferencesmanager from failing to stop when trying to stop
loopingcall that wasn't started
2011-06-18 20:13:58 -07:00
a82c753ac0 Fix uri handling when dragged to gtk window 2011-06-18 12:45:21 +01:00
96b5f617f2 Change log level of connect failed to INFO 2011-06-17 18:07:34 +01:00
842734c4e4 Add a file exists check to torrents passed as arg 2011-06-16 21:18:10 +01:00
095f4ff20a Fix path error with torrent files prefixed with 'file://' from Firefox 2011-06-16 21:18:09 +01:00
ed0b017fe1 Increase max piece size to 16 MiB in create torrent dialog
Increasing it beyond this will require changes to
createtorrentdialog.py
2011-06-10 13:24:36 +10:00
ce9b540b97 Initial GTK UI Speedups.
The speedups work is being separated into 2 different phases and possibly branches. The idea is to have this minimal speedup merged into master as soon as possible since it's pretty simple. Reduces initial data transfer to about 10% of what was previously being transfered when client connected.
The second phase is regarding row updates, ie, reduce them to what's actually being seen. This part is way more tricky.
2011-06-09 13:49:07 +01:00
5112ed48d1 Fix starting deluge-web when using osx/windows since the options are presented, the later conditionals fail since the options object does not have those attributes 2011-06-06 14:57:50 -07:00
dfa8834db8 Fix starting deluge-web 2011-06-06 14:57:38 -07:00
5bc63fa910 Change component.deregister to take the object as the parameter, not the name 2011-06-06 14:19:51 -07:00
24c945f139 Add a RPCServer.deregister method
Deregister RPC exports when disabling a Core plugin
2011-06-06 13:55:51 -07:00
2542ad9234 Let the Core fire the PluginDisabled event instead of disabling the plugin right away 2011-06-06 13:55:17 -07:00
acb4ab44d2 Merge branch 'stats_plugin_master' 2011-06-06 21:37:08 +01:00
16fbf27b90 Stats plugin update 2011-06-06 21:36:37 +01:00
3397c2487b Fix bug introduced on previous commit. We need to get a selection first! 2011-06-06 19:46:02 +01:00
66e8b34a54 GTK UI un-select row on torrentview shutdown and filter change.
This is specially useful when multiple torrents are selected. This way, the "changed" signal won't be triggered for every row.
2011-06-06 19:40:14 +01:00
59f9d4e5cc Revert "Work around plugins being garbage collected once enabled twice."
This reverts commit 2f71ef4264.
2011-06-06 18:16:05 +01:00
221dea1f1a GTK UI. Center the custom speed dialog on parent(statusbar). 2011-06-06 17:45:51 +01:00
4420aae092 Late import GTK UI's ConnectionManager so that the translations code can be properly setup. 2011-06-05 22:48:17 +01:00
ddc0957e3e Wrap non deluge exceptions so that they can also be sent to the client. 2011-06-05 22:44:01 +01:00
2f71ef4264 Work around plugins being garbage collected once enabled twice.
When a plugin is enabled, disabled and then enabled again, on that second enable, that instance is being garbage collected causing the loading of the plugin to fail. Work around that until we can narrow down why is this is happening on the second enable.
2011-06-05 22:28:37 +01:00
bc56b749ee Merge branch 'translate_updates' 2011-06-05 17:03:21 +01:00
34c95a08a3 Fix translations texts in glade and python files 2011-06-05 17:02:33 +01:00
9ae19e173f Remove page x from translatable in pref_diaog glade 2011-06-05 17:02:33 +01:00
6672aaba1b Change translatable to No for gtk stock labels 2011-06-05 17:02:33 +01:00
0712fc9dee Add gtk-* items to gettextize 2011-06-05 17:02:33 +01:00
07dc9005f3 Update gettextize to ignore .git folder 2011-06-05 17:02:33 +01:00
274a76ab3b Fix translate string in notifications plugin 2011-06-05 17:02:33 +01:00
777993f74a Fix translated string in addtorrentdialog 2011-06-05 17:02:33 +01:00
d1037ae213 update create_potfiles_in to ignore plugins build dir 2011-06-05 17:02:33 +01:00
15e9f5f218 Add 2 more commands to setup.py
Two more commands were added to setup.py:
 * develop_plugins - Installs each of the plugins in development mode
 * egg_info_plugins - Create the '.egg-info' distribution directories for each plugin. This will make the plugin discoverable by deluge

Both these commands are intended to be used while developing deluge.
2011-06-05 16:58:27 +01:00
4aab110aaf Remove duplicate code. 2011-06-05 16:23:09 +01:00
8933ac3123 Fix #1560 - FilesTab Progress value sorting by int instead of float 2011-06-05 13:23:23 +01:00
2e896b520e Fix #1456 - No ETA showing with multiple files 2011-06-05 13:23:16 +01:00
16d27b9657 Catch snd_path is None error in Notification Plugin 2011-06-04 23:24:39 +01:00
d3e8afdda1 Fix Extractor and Example plugin not starting 2011-06-04 22:56:36 +01:00
b86ba13376 Fix Feeder plugin name 2011-06-04 22:51:41 +01:00
f736576436 Fix Execute plugin not starting 2011-06-04 22:51:15 +01:00
9d1715405f Try to get some more debug info for plugins which are failing to load. 2011-06-04 19:25:53 +01:00
ee0d757b0e Some more fixes for plugins not fetching data from the correct namespace. 2011-06-04 19:23:03 +01:00
32c95fac1e Fix the Label plugin to get resources from the namespace. 2011-06-04 19:19:01 +01:00
df3214168c Cleaner fix for #1874, code clean up and reusability.
Translations are now setup on `deluge.common`. Where they used to be setup, a call to `setup_translations(setup_pygtk=False)` is now made.
Every call to `pkg_resources.resource_filename()` is now made through `deluge.common.resource_filename` to make sure that we're loading data from the right deluge install.
2011-06-04 18:06:45 +01:00
9e9261e6f8 Fix #1874.
While developing, if there's a second deluge package, installed globally and another in develop mode somewhere else, while pkg_resources.require("Deluge") returns the proper deluge instance, pkg_resources.resource_filename does not, it returns the first found on the python path, which is not good enough. Work around this issue.
2011-06-04 15:56:14 +01:00
087e94f6a1 Update all columns which use the "state" status field on the GTK UI TorrentView and not just the Progress column. 2011-06-04 10:43:24 +01:00
abe0031c2b Trigger a deprecation warning for code calling "getPluginLogger".
Since the plugins namespace was merged into master, calling "logging.getLogger(__name__)" will result in a properly named logger for plugins which will allow logging filtering.
The previous workaround "getPluginLogger()", is now deprecated.
2011-06-04 09:02:53 +01:00
13db148a11 Now that the plugin's namespace is in use, make the plugins get their own logger instead of using getPluginLogger() 2011-06-03 23:10:43 +01:00
84c5078667 Merge branch 'master' of deluge-torrent.org:deluge 2011-06-03 14:55:34 -07:00
cebdc89b18 Fix systemtray from stopping properly when appindicator is enabled 2011-06-03 14:53:41 -07:00
87e767d4c1 Merge branch 'master' into plugins-namespace 2011-06-03 17:48:22 +01:00
ce406674ec Update setuptools version in ez_setup 2011-06-02 21:50:38 +01:00
ac5f9a2828 Fix up stopping classic mode 2011-06-02 11:55:26 -07:00
6d55c44983 Fix menubar component stopping properly 2011-06-02 11:54:53 -07:00
1557d0da1f Move the log level to the left of the module because this field is a fixed width and its easier to read this way 2011-06-02 11:53:54 -07:00
2f785216f6 Show errors when trying failing to properly stop a component 2011-06-02 11:53:34 -07:00
8f1730591b While clearing the search filter, restore from pre-filter if available. 2011-06-02 11:16:11 +01:00
9ec44894d4 Fix #1873. Re-add the files and peers tab menus. 2011-06-02 10:58:45 +01:00
bb981127db spaces FTW 2011-06-01 20:29:38 +01:00
a96aeed706 Fix #1869: Set the disk io read/write to bypass OS cache in Windows as suggested in http://code.google.com/p/libtorrent/issues/detail?id=166 2011-05-31 09:56:23 -07:00
f14de6553a GTK UI search box grab_focus() on show. 2011-05-31 15:20:15 +01:00
b521b3065b GTK UI search box pre-filter implementation.
Implement a pre-filter for the search-box which will filter the currently visible torrents while waiting for the filter request to sent to the demon. This will make the searches seem way faster :)
2011-05-31 14:36:05 +01:00
ea438609bf GTK UI search by torrent name filter as a "toolbar".
Now, instead of permanently having a search box to filter the visible torrents by name, we now, mimic a toolbar just for that, mapped to CTRL-F. There's also a menu item in the "View" menu and a toolbar icon to toggle it. Implemented "Match Case" for the search.
2011-05-31 13:38:48 +01:00
0ba51d0e51 Fix peers tab flagsos.path.join 2011-05-30 22:14:36 +01:00
53370e4639 Fix peers tab flags missing 2011-05-30 21:33:17 +01:00
c70c8ea45d Add check to key_press_event for keyname returning None 2011-05-30 18:18:27 +01:00
937b53b355 pixmaps and icons moved to ui/data, all necessary references changed. 2011-05-30 17:57:39 +01:00
27cd89c4ad Remove setting the resume_data key to '' in the add_torrent_params as this causes libtorrent 0.16 to crash 2011-05-29 18:09:04 -07:00
c4dbf017a5 Merge branch 'master' into pieces-progress-bar
Conflicts:
	deluge/ui/gtkui/glade/main_window.glade
2011-05-29 20:00:25 +01:00
ec74f9aae3 Merge branch 'gtkui-search-by-name' 2011-05-29 19:21:12 +01:00
cfd955a605 AutoAdd plugin: Don't try to remove the same path twice! 2011-05-29 19:06:54 +01:00
feed806983 Wait at least 0.7 secs before triggering an update because of the search box, ie, allows typing the full search string before making the request. 2011-05-29 19:02:33 +01:00
c66637116b Allow searching torrents by name on the GTK UI. 2011-05-29 17:10:57 +01:00
4d4c6404b1 Log exception occurring while sending RPC errors to clients. 2011-05-29 16:39:00 +01:00
042ddd2891 Checkbox had no signal. 2011-05-29 14:36:26 +01:00
af24542856 AutoAdd plugin fix for #1863
In some cases, using `os.rename` between different mount points can trigger an `OSError`. Try to address these issues properly.
2011-05-29 11:37:31 +01:00
6dc393ed23 Allow a smtp port higher than 100
Add a shadow to scrolled window
2011-05-28 18:26:53 -07:00
c13eade81c Merge branch 'master' into pieces-progress-bar 2011-05-28 21:59:20 +01:00
eb639c3722 AutoAdd plugin auto fill.
When adding new entries, the dialog is auto-filled with what's defined for the Downloads entry in the preferences.
When showing errors, use the dialogs module.
Added some tooltips to the dialog.
2011-05-28 19:43:25 +01:00
dc514d308c GTK ui dialogs now have deluge's icon set. 2011-05-28 18:59:04 +01:00
67b5cde128 Fix #1867.
Now, if any option is changed on a torrent's options tab on the GTK UI, the apply button is set to sensitive.
2011-05-28 11:42:09 +01:00
ef98d19ed4 Merge branch 'master' into pieces-progress-bar 2011-05-28 10:54:03 +01:00
94a7b2ebf1 Fix #1861 - AutoAdd Warning (column number is a boolean) 2011-05-28 00:14:01 +01:00
e0443943b5 Catch an IndexError occurring in Files Tab when scrolling through long list of torrents 2011-05-28 00:05:18 +01:00
dd78a75ca8 Fix #1860 - Files Tab TypeError (could not parse subscript as a tree path) 2011-05-28 00:05:12 +01:00
82712c80e1 Fix #1195 - Right-click selecting issue when switching between files and folders 2011-05-28 00:05:00 +01:00
a710bcaed4 Add F2 key shortcut to rename files in Files Tab 2011-05-28 00:04:55 +01:00
3a7c182f83 Add XDG_DOWNLOAD_DIR for default download folder #1788 2011-05-28 00:01:58 +01:00
d42778afa3 Show the checking icon for the Checking Resume Data state 2011-05-25 13:21:16 -07:00
724025092a Set the WM_CLASS name to Deluge 2011-05-25 13:18:12 -07:00
bd43f3c464 Small text updates 2011-05-24 02:00:05 +01:00
8464a938b2 Fix up displaying versions in the about dialog 2011-05-23 17:09:16 -07:00
b8fad45eaa Change Connection Manager Key Shortcut to Ctrl-M 2011-05-23 22:23:35 +01:00
b08e90ac2a GTK UI edit trackers dialog. Remove un-used attribute. 2011-05-23 09:37:02 +01:00
13a379ef6c Update certain torrentview columns to default to not visible 2011-05-23 01:06:37 +01:00
09e24df4bb Merge branch 'masterchanges' 2011-05-22 23:36:49 +01:00
019f2a0619 Fix Up/Down buttons in Edit Trackers Dialog 2011-05-22 23:22:37 +01:00
2fb874d486 Add ability to set columns as not visible by default by setting the kwarg default to False when adding the column 2011-05-22 15:12:11 -07:00
85b4ceec30 Feature #1308: Add Seeds/Peers ratio to torrent list view 2011-05-22 22:48:03 +01:00
b0599313bc Feature #1646: Add columns for per torrent upload and download speed limits 2011-05-22 22:35:20 +01:00
974f48380f Change default value of close_to_tray to False
Prevents default install of Deluge disappearing if tray icon is missing.
2011-05-22 22:19:36 +01:00
b3865d0a7f Fix GTK UI edit trackers dialog.
Fix an issue with the edit trackers dialog where editing, adding or removing trackers was not "saved" in client/daemon mode.
2011-05-22 21:56:16 +01:00
79c9dd3076 Add libtorrent version to user_agent string
Example: Deluge/1.3.900-dev Libtorrent/0.15.5
2011-05-22 19:20:40 +01:00
edb0c2e71d Modify setup scripts to be executable 2011-05-21 18:54:15 +01:00
1c58dce3c1 Supress gobject warning in filtertreeview and torrentview
In console the warning "g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed" will appear. Quick investigation could find no solution with suggestions a python issue.
2011-05-21 17:32:20 +01:00
445f3c0123 Fix menu bug caused by Change Owner menuitem code
The right-click torrent menu would move/jump around when the option submenu was opened with the mouse, possibly due to a conflict between glade file and append menuitem code in menubar.py. Solution was to create a menuitem entry for Change Owner in glade file and update code to add submenu to this new entry.
2011-05-21 16:23:36 +01:00
eb15c96403 Add key shortcuts for menu items 2011-05-21 16:22:42 +01:00
71f411e458 Some comment explanation. 2011-05-19 00:29:30 +01:00
856a6cd1ab Pieces bar "calculation" bug fix. 2011-05-18 05:01:30 +01:00
99f2dbd178 Minor __doc__ naming change. 2011-05-18 05:01:30 +01:00
0e4747bf22 Lower debug messages level. 2011-05-18 05:01:30 +01:00
81637f4572 Add a nice border to the pieces bar. 2011-05-18 05:01:30 +01:00
25f086fa85 PiecesBar caching.
The drawings made on the pieces bar are now cached in "sub-drawings" kept in memory. If no data has changed, those "sub-drawings" are used. If data changed, redraw whatever is necessary.
2011-05-18 05:01:30 +01:00
6d57a29f1d PiecesBar rounded corners. 2011-05-18 05:01:30 +01:00
9b3f5783d5 Update ChangeLog. 2011-05-18 05:01:30 +01:00
b3492b07a1 PiecesBar
Now, either show the pieces bar or the progress bar, not both.
2011-05-18 05:01:30 +01:00
28def22625 PiecesBar enhancement.
The pieces bar will now draw status text, like a regular progress bar does, and for the overall progress, a semi-transparent overlay is also drawn.
2011-05-18 05:01:30 +01:00
427fe23bdc Minor comment cleanup. 2011-05-18 05:01:30 +01:00
da5c5d4b84 PiecesBar implementation.
We now provide an option to the user to see the states of a torrent's pieces, ie, completed, downloading, waiting, missing.
If the user has this option enabled, another 3 will be shown to him(on the GTK UI), which will allow him to choose the colors for each piece state.
2011-05-18 05:01:29 +01:00
438cbd2238 Correct the pieces states "calculation". 2011-05-18 05:01:29 +01:00
2d59b62317 Provide the option to the user to use the pieces bar or not(Glade file only). 2011-05-18 05:01:29 +01:00
19f32b1446 Provided a method to get the pieces information.
Each piece will return 0 for a missing piece, 1 for a not downloaded piece, 2 for a downloading piece and 3 for a downloaded piece.
2011-05-18 05:01:29 +01:00
9b812a4eec Extend RPC Protocol.
While adding the multiuser auth related stuff, RPC_AUTH_EVENT was added, simply to not touch how RPC_ERROR was handled. It was created to allow recreating the exception on the client side. Instead of adding another rpc event type, extend RPC_ERROR to send the proper data to recreate the exception on the client side.
2011-05-18 03:56:17 +01:00
e383187796 Fix #1281. Show a nice dialog stating that the client is incompatible on the GTK UI. 2011-05-17 22:50:05 +01:00
6151050ad4 PEP-8 2011-05-17 22:16:12 +01:00
9a3bf35cdf Include our custom lower log levels into python's logging. 2011-05-17 02:47:16 +01:00
6391970fad Updates to desktop file
Add magnet mimetype and tryexec key
Fix exec key to handle files and urls to conform with new desktop-entry spec
Update name, comment and category keys
2011-05-16 22:11:20 +01:00
0ba0e013b5 Force backwards incompatibility.
Force clients prior to 1.4 to fail authentication, this was we might reduce tickets like #1852.
2011-05-15 22:18:38 +01:00
552c898998 Fix #1844.
The submenu got lost on one of the glade files merges. Re-added.
2011-05-15 11:26:41 +01:00
bc5b4d902f Fix LP Bug #779074 - TypeError in on_key_press_event(): cannot concatenate 'str' and 'NoneType' 2011-05-12 22:42:13 +01:00
6a8e3f1c49 Minor code cleanup. 2011-05-11 09:06:21 +01:00
81ca9952e9 Moved core.conf config upgrade to core instead of pref's manager. 2011-05-10 20:15:33 +01:00
74618d5a65 GTK UI move storage fixed. Was still not allowing moves. 2011-05-10 20:13:26 +01:00
0c110c2408 Fix broken tests. Twisted deferred loops, must be stopped! 2011-05-10 11:21:24 +01:00
1ac997e7d7 Upgrade core config and handle empty AutoAdd watchdirs.
We now upgrade the core's config to include 'sequential_download'.
On the auto add plugin, if there are no watchdir, provide a default that will allow the GTK UI not to thrown an exception.
2011-05-09 15:47:10 +01:00
d4692bef42 AutoAdd Plugin. Remove line feeds from log messages. 2011-05-08 23:48:42 +01:00
77fc53afc0 Sequential downloads. Was querying for the wrong key on the torrent status. Fixed. 2011-05-08 23:46:55 +01:00
3b676eca40 Sequential downloads: Implemented in GTK UI torrent options tab. 2011-05-08 23:33:21 +01:00
ce3ce2c035 Sequential downloads: Implemented in GTK UI preferences dialog. 2011-05-08 23:11:51 +01:00
c8735b5cab Sequential downloads: Implemented in add torrent GTK UI dialog. 2011-05-08 22:55:55 +01:00
cc5f2ffe18 Implemented sequential downloads on core. 2011-05-08 22:39:11 +01:00
89b79c76a3 Multiple files prioritize first last.
Now `set_prioritize_first_last()` sets the first 2% and the last 2% of the pieces of each file on a torrent at a high priority, ie, it no longer works on just single file torrents.
2011-05-08 22:11:20 +01:00
837c39fdda Last seen complete checks.
Remove some un-necessary `lt.version_minor` checks since these checks will remain for a while, at least until deluge depends on libtorrent >= 0.16 which should preferrably not happen.
2011-05-08 21:58:26 +01:00
110026edbe AutoAdd plugin #1842
Fix bug #1842 and also implement "delete torrent file on torrent removal from session".
2011-05-08 21:38:53 +01:00
3b8ebf68a6 GTK UI menubar accounts retrieval.
Only ask for known accounts if we have the required level for it.
2011-05-08 21:36:10 +01:00
ffd344d0b5 On some "race" conditions, the torrent is removed before it's status could be retrieved. Return an empty status. 2011-05-08 21:35:06 +01:00
9d29ca7b29 Check against libtorrent >15 not >16. 2011-05-08 02:39:35 +01:00
38906468c1 Last seen complete
Update last_seen_complete when a status is queried for and that key is on the keys to get or it's a full status query. Either way, only "calculate" last seen at a minimum of one time per 60 seconds(simple caching).
2011-05-08 01:36:40 +01:00
95d7caf3ac Implement Last Seen Complete, on core and on GTK UI. 2011-05-07 20:22:55 +01:00
4044f52f77 GTK UI Torrent's options tab.
Set the apply button to sensitive if the value of a spin button changed. This was missing.
2011-05-07 15:54:10 +01:00
a7bd953169 GTK UI Connection Manager (#1824)
Warn the user if he's trying to connect to a local daemon that's not running and "start local daemon if necessary" is not enabled.
Extend and reuse the connection callbacks on the connection manager to re-use code.
2011-05-07 15:14:32 +01:00
8922717ff2 fix unrequired requests 2011-05-07 13:20:09 +01:00
117d50b728 fix a bug when the host_id doesn't exist 2011-05-07 13:20:04 +01:00
04af8965bc apply patch from #1742 2011-05-07 00:02:49 +01:00
d6f5e5b4ec fix #1537 editing trackers list, trackers have to be reselected 2011-05-06 23:44:19 +01:00
1f3a7bf44c Fix #1333 Peer list doesn't update automatically 2011-05-06 23:25:07 +01:00
2e62ced811 fix #1323 filter panels not scrollable 2011-05-06 22:33:10 +01:00
95819c79e5 Fix #1268, Torrent errors not displayed in webui 2011-05-06 22:23:25 +01:00
5ad21303c6 fix issue #1567, js from plugins not working with different base setting 2011-05-06 22:09:17 +01:00
922e64a07e fix issue #1799 2011-05-06 22:01:06 +01:00
30d70d2b9b apply patch from #1562 2011-05-06 19:16:20 +01:00
a06b350858 Correct log message. 2011-05-06 19:10:26 +01:00
06f025f4bd fix the widths on the input boxes, whitespace changes too 2011-05-06 19:03:05 +01:00
d362a6ceba fix the path given by the set-cookie header 2011-05-03 19:05:15 +01:00
138b8ae314 Sorry for the noise. Email change. 2011-05-02 05:02:46 +01:00
6f3bc5620f Fix #1824.
When connected to a client, and then trying to connect to another, the connection manager component will be stopped(while the connect deferred is still running), so, the ConnectionManager.connection_manager reference will be deleted. If that's not the case, close the dialog.
2011-05-01 07:41:44 +01:00
f2249d5803 Remove un-used import. 2011-05-01 04:46:54 +01:00
f26de83509 Don't run into loops when the auth file does not exist and we're trying to create it. 2011-05-01 04:44:42 +01:00
f6826a4f48 Fix #1822
Only query the core for the known accounts if connected to it.
2011-04-30 20:45:15 +01:00
dd3f78bd36 More changes related to automatic connections.
Auto-connecting on start of the gtk ui is now fully working.
Auto-staring localhost if needed is now also working.
Authentication failures now get passed correctly to the client implementation which will allow the user to enter username and/or password to complete authentication.
It's now possible to shutdown the daemon from the connection manager even if not on localhost, it just needs all required information to be present on the liststore.
2011-04-30 07:42:06 +01:00
63d0d0c69b GTK UI connection manager fixes.
Auto-connecting to daemon now works. Fixes #1815.
Auto-starting a `localhost` daemon now also works, the reconnecting attempts were not being "triggered".
When not connected to a daemon, "Quit & Shutdown Daemon" is not present. So #1818 is also fixed.
Some more work regarding #1819 was done.
Client now disconnects before shutting down the GTK UI.
2011-04-28 16:59:01 +01:00
1be59bb116 don't show decimals for 100% progress (100% instead of 100.00%) 2011-04-28 14:28:53 +02:00
751345fc28 minor function renaming to make things properly private 2011-04-28 14:28:53 +02:00
12ea65d188 show priorities for directories. fulfills feature request 1688 2011-04-28 14:28:53 +02:00
e950cca059 reset selection to top on alltorrent resume in case another mode has effected torrent list 2011-04-28 14:28:53 +02:00
a063095dad Make sure we have a config loaded in the connection manager. Fixes #1819. 2011-04-28 11:06:26 +01:00
39978d5ade Fix #1278 by keeping references. 2011-04-28 10:37:35 +01:00
9fa8748432 Fix some clean config dir issues.
Moved some auth stuff to `deluge.common` because they're also used on the GTK UI.
Now, if a user starts deluge in classic mode and tries to change it to client/daemon mode, he see's a dialog stating that the current session will be stopped. If he answers no, nothing is done, the classic mode pref is set back as it was. If he answers yes, all components are stopped and client is disconnected. At this stage the user can open the connection manager to start the daemon and connect.
If the user starts in client/daemon mode and switches to classic mode he see's a dialog stating that deluge must be restarted.
The GTK UI connection manager now loads it's default config with the localclient username and password. If not present in the auth file, the auth file will be recreated.
2011-04-27 22:06:13 +01:00
18b27d4b49 Remove a pref regarding auto adding in queue thinking it was from the core's previous AutoAdd. Re-Added. 2011-04-27 19:42:54 +01:00
f41f6ad46a Test fixes and #1814 fix.
All test were adapted, and some more were added to comply with the new multiuser support in deluge.
Regarding #1814, host entries in the Connection Manager UI are now migrated from the old format were automatic localhost logins were possible, which no longer is.
2011-04-27 19:32:13 +01:00
bb9a8509c8 Fix trying to load the AutoAdd component as it no longer exists in core 2011-04-27 11:03:43 -07:00
6694ac7a58 Merge branch 'master' of deluge-torrent.org:deluge 2011-04-27 17:30:09 +01:00
81d22eb730 When parsing the auth file, if an old format is found(with no auth levels), make sure that the localclient always has the ADMIN permission as he should. 2011-04-27 17:30:00 +01:00
47a9b18b89 enforce min/max values for float/int spin inputs 2011-04-27 18:09:20 +02:00
292929ba59 better handling of keyboard input in int/float spin inputs 2011-04-27 18:09:20 +02:00
cbcf413ffd use callbacks for mode switching when stopping alltorrents component. should fix bug 1686 2011-04-27 18:09:20 +02:00
4d8b34209b fix column trimming a bit 2011-04-27 18:09:20 +02:00
98a8be7131 avoid having the tests hang due to a failing to connect client! 2011-04-27 13:38:23 +01:00
2e68e0181c Remove some leftovers from the old multiuser branch. 2011-04-27 13:18:59 +01:00
e6773dfce1 Merge branch 'master' into multiuser-oldprefs 2011-04-27 13:15:05 +01:00
f56be66556 Update ChangeLog. 2011-04-27 13:06:26 +01:00
67a4fd49e9 fix problem when not showing name,state or queue columns. fix problem if there were no var length cols. 2011-04-26 22:59:48 +02:00
e992ac3eab ignore key presses that only makes sense when we have a state when we don't have a state 2011-04-26 14:18:25 +02:00
d05352db65 fix bug for selecting multiple torrents with cursor above last mark (bug 1689) 2011-04-26 14:03:49 +02:00
b1e0dd66eb handle files with [ and ] characters in them 2011-04-26 13:53:11 +02:00
897c2f981f Add help to torrent details mode.
fixes bug: 1687
2011-04-26 12:41:19 +02:00
91801e1632 Cleanup debug message new lines. 2011-04-26 10:14:39 +01:00
fa20e49a93 Fixed 2 bugs regarding torrent ownership change.
On the core, the code was not adapted to the new AuthManager. On The GtkUI, nothing was being shown to the user when errors occurred while changing ownership.
2011-04-26 08:37:20 +01:00
4432e6e6e3 Also handle moving the torrent files after adding them besides renaming or deleting(per whatchdir) 2011-04-25 16:38:49 +01:00
c225c045cb Better file modification detection. 2011-04-25 15:07:07 +01:00
e552c21f66 Automatically detect auth file changes and reloading those changes. 2011-04-25 14:43:44 +01:00
89d04a393b Upgrade old auth file, save it and reload it. 2011-04-25 14:35:01 +01:00
f1730dc4d4 Removed leftovers from the core autoadd. All autoadd features are now addressed by the AutoAdd plugin. NOTE: Console UI and Web UI should also remove the core auto add stuff. 2011-04-25 13:44:27 +01:00
fb5005e3f6 The AutoAdd plugin now supports multiusers. 2011-04-25 13:16:11 +01:00
51b5b23f76 Remove debug printing. 2011-04-25 13:12:18 +01:00
78e966946f Allow setting torrent ownership when adding new torrents. 2011-04-25 09:13:45 +01:00
936bd925d9 Some changes were left behind on last commit. 2011-04-25 08:12:46 +01:00
43e3fe2a1a Account Management Implemented.
Account management is now implemented for the GTK UI. Some changes to the core were required since the clients need to know which authentication levels exist, and, to expose account creation, update, and removal to the clients. The best effort is done to try not to compromise the auth file.
2011-04-24 17:38:35 +01:00
6ed3136c8e No server side logouts.
Do not try to for a disconnect on this branch, maybe on another one.
2011-04-24 17:19:57 +01:00
8195421c99 Some account management work. Not yet complete. 2011-04-22 18:51:51 +01:00
342da12d0c Merge branch 'master' into multiuser 2011-04-22 11:44:10 +01:00
5296fc7d4c Fix one more possible issue with regard to #1786 2011-04-22 11:42:48 +01:00
233e814547 Late import twisted's reactor, it allows the gtk reactor to be proper installed. 2011-04-22 11:33:45 +01:00
03325c5f48 Add some missing code 2011-04-22 11:27:14 +01:00
1a6742b1e2 Keep consistency on deluge.config. 2011-04-22 11:26:09 +01:00
154688a3e2 Implement __delitem__ on deluge.config.Config. 2011-04-22 11:26:09 +01:00
fe12552590 Now, when the authentication dialog appears, user fills in the password and hits ENTER, the authentication call will be made.
Implement tooltips on treeview's headers when adding columns.
Renamed the "public" state of a torrent to "shared", ie, shared among other deluge users. Allow changing shared state from clients and currently from the    GtkUi.
2011-04-22 11:26:08 +01:00
e63c33c496 Allow changing ownership of torrents. In order to achieve this, added deluge.core.set_torrents_owner(), deluge.core.get_known_accounts(), deluge.core.authmanager.get_known_accounts() and deluge.core.torrent.set_owner()`. So far only the GtkUi has this fully implemented. 2011-04-22 11:25:33 +01:00
105cb52cb0 Add method to return the current authenticated username. 2011-04-22 11:24:42 +01:00
3e0ea26e5f Remove unused method, duplicate log messages and add a method to get the logged in user's authentication level. 2011-04-22 11:24:42 +01:00
e44cac0eaa Since there's no default username for authentication, update hostlist to include the username.
Remove debug prints or extreme debugging. Minor code cleanup. Remove un-used imports.
2011-04-22 11:24:42 +01:00
86a1b801f5 Now it is possible to not even store the username on the hosts entry in the connection manager, both username and password will be asked to the user. WARNING: No more "localclient" automatic login, ie, username, is mandatory else, it will be asked to the user. 2011-04-22 11:24:42 +01:00
b3870ad6dd Use a specific response code for authentication requests. Recreate authentication request exceptions on the client end. 2011-04-22 11:24:42 +01:00
67ff83360f Use the exceptions from deluge.errors. 2011-04-22 11:22:19 +01:00
b2a16a0240 Move deluge errors to the errors module, they will be reused later on other parts of code.
Now, calling connect on client has two behaviours, if username/password is passed the client connects, authenticates and returns daemon info, if username/password is not passed, only the daemon info is returned. This might change a bit later on though.
2011-04-22 11:22:19 +01:00
e17c035521 Cleaned up previous commit regarding threads and the GTK2Reactor.
Now a dialog apears if the daemon complains about a missing password in order to authenticate. Asks the password from the user and retries to connect.
2011-04-22 11:22:19 +01:00
249398489e Removed problematic code. GTK2Reactor takes care of all that. 2011-04-22 11:22:19 +01:00
d44f59a0e7 Add some docstrings. 2011-04-22 11:22:19 +01:00
6c99204828 The GtkUi's connection manager now has the ability to edit existing host entries besides adding and deleting them.
It also asks for a password prior to attemting to connect in case the password is null, this alows host entries not to store the passwords on file like it has done so far.
NOTE: This is not yet the desired behaviour, ie, the daemon should simply complain if the authentication details are incomplete and the client should act accordingly. I had an issue with this though, I catched the errback the daemon was sending, asked the user for the password and re-tried to authenticate again. However, twisted always locked when I tried this. I'm investigating it.
2011-04-22 11:22:19 +01:00
1794f09b21 Make branch runnable. 2011-04-22 11:22:19 +01:00
b08a4679de Respect the torrents ownership and unless the logged in user is an admin, only return his own torrents plus all other public torrents. 2011-04-22 11:21:12 +01:00
bfc221fc18 Begin work on fixing up the Preference dialog
Split up the glade file for each individual page
2011-04-22 11:21:12 +01:00
5ad3a1666c Update the ErrorDialog 2011-04-22 11:20:15 +01:00
49d5ed6bde Hopefully, final fix for #1786:
We now make sure that a state file exists when trying to restore an order from it.
The best effort to restore the previous order is made, though, in some cases, since we're matching against names which are translatable, a match might not be found, in that case, continue the effort though skip the non matching column name. On next load, everything should be fine since the state file will include the, now in use, translation.
2011-04-21 20:55:01 +01:00
4b9209674e Merge branch 'master' of deluge-torrent.org:deluge 2011-04-21 18:31:03 +01:00
b9a688013f Fix #1786:
Don't reorder duplicate columns, need to dig how duplicate columns got into the state file, and also skip non visible columns.
2011-04-21 18:29:59 +01:00
387b746fae Merge branch 'master' of deluge-torrent.org:deluge 2011-04-21 10:41:15 +01:00
796109649d fix the client tests albeit in an ultra hacky way 2011-04-21 10:41:00 +01:00
d258794517 Merge branch 'master' of deluge-torrent.org:deluge 2011-04-21 00:47:01 +01:00
98f80c0eb6 Restore column order from state.
On the TorrentView's treeview, the column's position stored on state was being ignored, but event if that info was not being ignored and passed to the several `add_column`'s the order could not be added because the order the columns are added does not(might not) match what was stored in state. So, we now restore the ordering once all columns are added.
2011-04-21 00:42:36 +01:00
d18becc861 fix bug due to vim stripping regex being wrong 2011-04-20 18:37:39 +01:00
0503db85ea Merge branch 'master' of deluge-torrent.org:deluge 2011-04-20 18:34:02 +01:00
bcb636dda4 improve the core tests to use a built in webserver 2011-04-20 18:32:55 +01:00
5bc304470c Let's use what the stdlib provides us. Use email.utils.formatdate instead of strftime() a datetime object. 2011-04-14 09:29:40 +01:00
42e1e2fd20 Include proper Date header in email notifications. 2011-04-13 12:54:59 +01:00
bb0746c3e8 use os.sep and strip what's already in input box from complete options 2011-04-13 11:52:03 +02:00
19799d74b4 Include gif pixmaps in the package data 2011-04-09 22:36:12 +10:00
0d560bcd6f Add update-tracker/reannounce command for command-line/legacy interface 2011-03-29 14:56:39 +02:00
69b79756f2 Merge branch 'master' of git.deluge-torrent.org:deluge 2011-03-28 16:51:23 +01:00
fd248eb1fd split the auto_add_trackers textfield otherwise it breaks the label plugin 2011-03-28 16:51:03 +01:00
45ccd3b84a Fix libtorrent not compiling with boost libs 1.46 2011-03-26 17:33:26 +11:00
298b85c368 Improve autoadd filename matching (fixes #1614) 2011-03-26 17:33:26 +11:00
67add964de Apply patch from #1581 to add an option to enable the app indicator
interface
2011-03-22 17:16:50 -07:00
e81a279dc2 fix naming issue with close callback in popups 2011-03-19 12:38:55 +01:00
280781ded9 queue management in torrent actions 2011-03-13 12:53:13 +01:00
f30a2858ce convert the tests to use a local webserver instead of pinging deluge-torrent.org and damoxc.net 2011-03-08 14:43:09 +00:00
32b41fabd6 Handle redirection when adding a torrent by url 2011-03-09 00:44:42 +11:00
a0f9689664 Handle partial downloads due to incorrect headers (fixes #1517) 2011-03-09 00:40:15 +11:00
08843ccad5 support prefs that don't fit on the screen
remove superfluous log message
2011-03-08 12:21:45 +01:00
e0bb8869aa add some more columns 2011-03-08 11:34:59 +01:00
255af3c485 set status fields to get from visible columns 2011-03-08 00:35:55 +01:00
f35145b0a6 make alltorrents a component like it should be and get rid of alltorrentsstateupdater 2011-03-08 00:16:42 +01:00
f2d560351e add preferences for display and size of columns in alltorrent mode 2011-03-07 13:40:25 +01:00
62da60a0e4 break out each column preference 2011-03-07 12:37:23 +01:00
d9c1a56d44 use config params for columns to show 2011-03-07 12:14:36 +01:00
84f278dbcc show a 'scrollbar' of sorts for popups with a lot of text 2011-03-01 19:39:55 +01:00
356f298e9c update help display using new wrap_string.
re-wrap on resize

add some highlighting
2011-03-01 19:13:17 +01:00
5fb01dacc0 add a {!normal!} color scheme 2011-03-01 19:12:48 +01:00
8d541ad419 use new wrap_string function in MessagePopup 2011-03-01 19:12:05 +01:00
426eea154e add a wrap_string function that works properly 2011-03-01 19:11:53 +01:00
ccc047848a split long lines in torrent info popup 2011-02-28 20:22:49 +01:00
11d8332e43 make sure we're in interactive mode before checking for screen 2011-02-28 14:03:39 +01:00
2193240c66 update help for legacy mode 2011-02-27 17:15:12 +01:00
e43c532e63 remove screen.py
all functionality has been moved elsewhere at this point
2011-02-27 17:14:50 +01:00
930addb389 add 'legacy' mode, which is basically just the old deluge-console, for curmudgeons 2011-02-27 17:12:57 +01:00
fab1e8412d encode string before write to specified encoding 2011-02-24 14:18:49 +01:00
1cce30393b add interactive field to commander so command -h will work 2011-02-24 13:24:45 +01:00
510c81776f add status command 2011-02-24 13:24:35 +01:00
e7096d9509 Merge branch 'master' of deluge-torrent.org:/deluge 2011-02-24 12:13:06 +01:00
5ae242472f don't search for empty string in alltorrents.py 2011-02-24 12:11:14 +01:00
ee75786e40 handle the case where libtorrent doesn't know what files are in a torrent.
this is the case when torrent was added by a magnet link
2011-02-24 12:08:42 +01:00
87473f2cde support magnet uris in add command/dialog 2011-02-24 12:08:22 +01:00
b2f349c05d Remove unnecessary import 2011-02-23 11:22:29 -08:00
9ac0d62149 Remove some imports that are no longer neccessary 2011-02-23 11:21:47 -08:00
db46a97263 Merge branch 'master' of deluge-torrent.org:/deluge 2011-02-23 20:05:48 +01:00
4c2f9a1a0a un-revert main.py as it doesn't actually handle events. 2011-02-23 20:04:15 +01:00
64e38eac20 Revert "Fixed "PluginEnabledEvent" and "PluginDisabledEvent" the argument cannot be called name since that should contain the event name."
This reverts commit 078ed6ba71.
2011-02-23 11:01:59 -08:00
499a58f50d Revert 67ea05921c which changed how event handlers worked.
Unfortunately this will not work with plugins as they do not have the events defined and
the creation of the event object fails.
2011-02-23 10:47:16 -08:00
5f0f7204a8 don't use libtorrent anymore in add 2011-02-23 16:15:34 +01:00
62f6683730 support urls from add dialog 2011-02-23 16:12:49 +01:00
60d96c6f20 add add_spaces to InputPopup 2011-02-23 16:07:47 +01:00
d1efe5f1b4 support adding url arguments in add.py command 2011-02-23 15:53:14 +01:00
62421080ef better unicode handling and trimming 2011-02-22 18:04:16 +01:00
9e4ea0a671 don't trim rows
(basemode seems to get confused on strings with double-wide chars)
2011-02-22 17:18:12 +01:00
b11468c19b handle double-wide unicode characters 2011-02-22 17:17:55 +01:00
40a5722987 support -s STATE in info 2011-02-22 16:57:56 +01:00
956ea10a00 convert torrent_ids back into a list in case we need to remove from it 2011-02-22 16:56:54 +01:00
543fcf722c use os.path.commonprefix to do better completion 2011-02-22 14:58:40 +01:00
7f52472e9e add move command for console ui 2011-02-22 13:56:22 +01:00
5619991f2a add move storage option to torrent actions 2011-02-22 13:39:38 +01:00
2b04955128 don't double add current torrent on action popup 2011-02-22 13:39:20 +01:00
e83d540fe4 update help 2011-02-22 13:38:54 +01:00
4e5d88da82 import deluge.ui.common for TorrentInfo command 2011-02-22 12:34:29 +01:00
10816cb8f4 always have a torrents list, in case get_torrent_name gets called from a mode without get_torrent_name in new ui 2011-02-22 12:32:32 +01:00
5f8eda9204 Merge branch 'newconsole'
Conflicts:
	deluge/ui/console/main.py
2011-02-22 00:26:57 +01:00
b0c561dbbc add add_checked_input 2011-02-22 00:09:27 +01:00
1173f1c714 support globbing for multi-file add and have better fail reports 2011-02-21 17:44:12 +01:00
3da5cd9816 add get_torrent_name 2011-02-21 17:43:35 +01:00
d9d8762c8e add get_torrent_name 2011-02-21 17:41:28 +01:00
e16ee523a5 fix messagepopup height_req 2011-02-21 17:41:10 +01:00
3db7bcbfc7 make message popups a bit more sane 2011-02-21 16:30:49 +01:00
e1a3a431f0 support command line options again 2011-02-17 16:26:58 +01:00
9a3316f950 use '-' instead of '~' in progress bar 2011-02-17 16:04:54 +01:00
1789e8d03c Minor changes for command line usage 2011-02-17 16:03:11 +01:00
837322478b return deferred for proper command line behavior 2011-02-17 15:30:14 +01:00
ce2516ab2c search field is black,white 2011-02-15 20:15:43 +01:00
962bfc3d2c support searching torrent names in alltorrent view 2011-02-15 20:14:14 +01:00
4ff0fb19ee left arrow goes back to overview from torrent details 2011-02-15 19:36:17 +01:00
7a4006439b add preferences help 2011-02-15 19:10:57 +01:00
c015c3a57d update help a bit 2011-02-15 19:10:51 +01:00
8a9e732f95 lots of new preference work 2011-02-15 18:55:27 +01:00
0b3c408e64 make the edit trackers window resizable 2011-02-15 12:54:35 +00:00
d3a61bbda4 fix scrolling on the edit trackers window 2011-02-15 12:49:04 +00:00
c523958bf6 Fixes for gtk-ui translations 2011-02-14 23:50:08 +00:00
06003b3650 Fix translate issue for Trackers tree in sidebar 2011-02-14 23:49:45 +00:00
1e0005f572 Fix: os.join created root path in Remove_Empty_Folder if variable 'folder' had a leading slash 2011-02-14 23:49:04 +00:00
4a071ecba1 add an eventview 2011-02-14 12:38:18 +01:00
77eb1a5f82 prefs actually work. some tweaks to inputs to better support prefs
not all prefs available yet
2011-02-14 12:26:24 +01:00
ac8c928a5b don't always refresh on __init__ 2011-02-14 12:25:43 +01:00
23f64a5440 add back write method and keep track of events for (future) event view 2011-02-14 12:25:04 +01:00
98ca371b15 Sidebar: Enabled strings for translation and added icons to Trackers filter 2011-02-11 22:10:00 +00:00
f8737777b1 Fix #1527 - Converting unicode to unicode error in move_storage 2011-02-11 21:58:40 +00:00
e198ea14e4 Fix Create Torrent Dialog Box - Some buttons raise Type Error if no row selected 2011-02-11 21:58:32 +00:00
553f35eae5 Fix #1510 - Cannot create a torrent with only non-zero tier trackers 2011-02-11 21:58:24 +00:00
376a23e6fd Fix #1513: Unhandled Twisted Error in test_listen_port 2011-02-11 21:58:18 +00:00
077f35ec5c use selection input for cancel/apply/ok 2011-02-10 17:54:59 +01:00
00ab9ff499 support offset text/select inputs and select inputs with no message 2011-02-10 17:47:50 +01:00
20302021c4 initial prefs mode. doesn't do anything yet 2011-02-10 17:39:42 +01:00
9e5455793b remove unused code
this breaks command line right now, will put it back in later
2011-02-10 16:45:10 +01:00
7f6a1db89a start with a connection manager instead of just alltorrents 2011-02-10 01:12:14 +01:00
cdcab320fb add current_selection to SelectablePopup 2011-02-10 01:11:31 +01:00
ea22bb0b10 #1514 - Indicator Applet Patch 2011-02-09 19:15:34 +00:00
554f34a261 Fix #690 - Renaming folders does not remove old empty folders 2011-02-08 19:34:54 +00:00
ad2b13eb2c Fix #1248 - Deluge-console unicode support on redirected stdout 2011-02-08 17:36:09 +00:00
ce636ccd57 Catch a possible DivByZero error when moving folders around in fileview tab 2011-02-08 17:36:09 +00:00
053700342a Fix #1336 - Uneeded Horizontal Scrollbar shows in Files&Peers Tab 2011-02-08 17:35:57 +00:00
cd7805bfda make text input not go over width 2011-02-08 14:43:41 +01:00
79869faa53 #1494 - Add Downloaded and Uploaded columns to torrent view 2011-02-08 06:49:30 +00:00
b77f8929d6 oops, add torrent actions new file 2011-02-07 15:10:41 +01:00
e1d8025309 show torrent actions form details when 'a' pressed 2011-02-07 15:10:18 +01:00
183a97785b split off torrent actions popup 2011-02-07 15:01:07 +01:00
f748660cac show status message 2011-02-07 15:00:51 +01:00
cea6c817df Fix #1506 - max speed not restored on a yellow->green transition 2011-02-05 01:12:52 +00:00
b9ff47e10f Fix #755 - Can't set listen_ports through console UI 2011-02-05 01:12:48 +00:00
14746bf94d Fix #1450 Trailing white space in paths 2011-02-05 01:12:47 +00:00
87f871f40a Fix #1500 - Console crashes on command longer than terminal width. This error is raised if the cursor is off screen and is supressed with try-except 2011-02-05 01:12:45 +00:00
9f3ac37f25 Fix #1282 - Text for AutoManaged changed to 'On/Off' and localized 2011-02-05 01:12:44 +00:00
417a9f6e63 Fix #1373, #1386 - Creating and moving non-ascii folder names in MS Windows 2011-02-05 01:12:43 +00:00
ba6389bcac Updated help text for deluge-console on Windows 2011-02-05 01:12:42 +00:00
9bca1a72b1 Fix for deluge-console adding torrent files in Windows 2011-02-05 01:12:41 +00:00
e688b45448 Fix #1508 - TypeError in cell_data_queue() could not convert argument to correct param type 2011-02-05 01:12:36 +00:00
4c54cfedb9 Fix #1507 - Temporary file race condition in core/core.py:add_torrent_url 2011-02-05 01:12:35 +00:00
88039a0eda fix patch, missing deluge.common when adding the options 2011-02-04 19:57:31 +00:00
9a54beef78 add patch from #1473 2011-02-04 19:43:27 +00:00
b0a0574ae0 Apply patch from #1194 2011-02-04 19:37:42 +00:00
db64745862 fix priority popup title 2011-02-02 20:50:48 +01:00
0353a388b3 add option to action popup for torrent details 2011-02-02 20:49:27 +01:00
b41ebe1b89 don't show action popup if there are no torrents in the view 2011-02-02 20:49:11 +01:00
1952357f35 update help 2011-02-02 20:40:15 +01:00
6c8529b3ba updated file seperator 2011-02-02 20:39:57 +01:00
78ea5c9bd3 don't enter torrentdetails if nothing is selected 2011-02-02 18:32:03 +01:00
b35875e300 attempted fix of color/underline issue.
this is a bit of a hack, and seems to work some places, but not everywhere
2011-02-02 16:21:52 +01:00
ad498c6e42 Revert "remove special case white/black pair. doesn't seem needed and breaks white,black,attrs"
This does actually seem to break some terminals

This reverts commit ba3a093746.
2011-02-02 13:57:31 +01:00
d1b3aa54ad support setting file priorities in torrentdetails 2011-02-02 13:46:05 +01:00
d0346a104f don't need len() 2011-02-02 13:45:17 +01:00
5f888faceb handle resize in torrentdetail 2011-02-02 13:11:15 +01:00
f6f3a8e084 allow marking in file view (no actions just yet) 2011-02-02 13:09:41 +01:00
5dcc935852 fix for only drawing one effected line and only draw effected lines on marking 2011-02-02 12:50:40 +01:00
eba7c2bf17 add index value to directories in file_list 2011-02-02 12:44:07 +01:00
00fa074452 small fix for scrolling 2011-02-01 18:00:25 +01:00
5d46d2aee5 add torrentdetails state, allow state switching, move some formating to format_utils 2011-02-01 17:23:15 +01:00
007dd67ea1 only redraw effected lines on scroll. seems to get rid of the flickering problem :) 2011-01-29 14:04:32 +01:00
ff3c3f7148 add torrent can add paused. remove torrent works 2011-01-29 12:29:18 +01:00
68c04acf50 refactor + support selectinput 2011-01-28 22:42:04 +01:00
44676f282a use some caching to speed up row drawing.
still some flicker unfortunatly.  seems to be related to the length of the row line, not sure if there's much i can do there
2011-01-28 17:54:36 +01:00
182ec0cd97 specify hotkeys for filter/action popups 2011-01-28 17:34:03 +01:00
6f0b1fd7f2 support hotkeys in selectable popup 2011-01-28 17:33:51 +01:00
ba3a093746 remove special case white/black pair. doesn't seem needed and breaks white,black,attrs 2011-01-28 17:04:28 +01:00
b7e7a4bc49 Fix typo 2011-01-27 11:18:59 -08:00
ac18ecd1f0 Fix #1498: Use os.path.normpath on new_folder to remove any double slashes or other problems that could be in the string 2011-01-27 11:12:40 -08:00
2f6283ea39 initial checkin of new console ui
pretty alpha code, but it works and gives an idea of the direction the ui might go
2011-01-26 22:18:18 +01:00
b30499c6ac Fix #1484: trying to access the screen object when not using interactive mode 2011-01-16 15:59:29 -08:00
8c12c47d3e Add "none" as a log level to support quieting the logging messages. Refs #1470. 2011-01-02 16:06:28 +00:00
356808b02c Fix #1470. 2011-01-02 16:03:00 +00:00
1f800bf49a On a 64bit platform with old plugins, the deprecation code was unable to find out which was the caller module. This might also happen on other platforms although I was unable to reproduce it on x86. Anyway, handle it cleanly. 2011-01-01 18:33:41 +00:00
d1b4523733 Let log files be a little bigger, 50Mb is not that much anyway. 2010-12-28 01:58:38 +00:00
c00391a852 Merge branch 'master' into plugins-namespace 2010-12-28 01:45:50 +00:00
5841521133 Added missing import.
Removed log message that caused error. It was never logged anyway, even on the master branch before the improved logging branch was created.
2010-12-28 01:26:25 +00:00
7e2411289d Merge branch 'master' into plugins-namespace
Conflicts:
	ChangeLog
2010-12-13 12:37:37 +00:00
2fa8ca6753 Merge branch 'master' into improved-logging
Conflicts:
	ChangeLog
	deluge/plugins/autoadd/autoadd/gtkui.py
	deluge/ui/client.py
2010-12-13 12:31:20 +00:00
1c15df8e00 Merge branch 'master' of deluge-torrent.org:deluge 2010-12-12 17:50:13 +00:00
f282487806 fix bug #1355 2010-12-12 00:03:04 +00:00
078ed6ba71 Fixed "PluginEnabledEvent" and "PluginDisabledEvent" the argument cannot be called name since that should contain the event name.
Ported plugins on deluge's git to this new event dispatching style.
2010-12-11 05:42:45 +00:00
67ea05921c Implemented passing a copy of an event instead of it's arguments to event handlers. Necessary changes to the event handlers on deluge's code were made, plugins still need to be ported to this new style. 2010-12-11 05:11:18 +00:00
0f36a65aaf Update ChangeLog with the backwards incompatible notice. 2010-12-10 05:49:38 +00:00
90d23ce582 Revert e52018bfcd. Simply fail. It's documented on the ChangeLog. 2010-12-10 05:42:19 +00:00
860457ff48 Update ChangeLog. 2010-12-10 05:01:31 +00:00
e52018bfcd Dont make code that still uses the old "TorrentAddedEvent" fail, instead log a warning and make it work. 2010-12-10 04:59:05 +00:00
9bd11ab204 Update ChangeLog. 2010-12-10 04:35:41 +00:00
c164013725 Ported Feeder(although not working on current deluge), Notifications, Scheduler, Stats, Toggle and WebUi to the deluge.plugins namespace. 2010-12-10 04:31:51 +00:00
b9a8bf2409 Ported the Label plugin to the deluge.plugins namespace. 2010-12-10 04:09:25 +00:00
4c3d068f0c Improve create_plugin.py and the generated create_dev_link.sh. 2010-12-10 04:08:36 +00:00
c9e4d286c3 Ported the FreeSpace plugin to the deluge.plugins namespace. 2010-12-10 03:29:36 +00:00
e43146a4ac Simplify some code on create_plugin.py. 2010-12-10 03:25:39 +00:00
1c2eb0c737 Improve and port the create_plugin.py script to generate the plugins under the "deluge.plugins" namespace.
Any plugin not using the "deluge.plugins" namespace will get a `DeprecationWarning` printed on the console.
2010-12-10 03:15:36 +00:00
b0d77a4f20 Ported the Extractor plugin to the plugins namespace. 2010-12-10 00:35:51 +00:00
20635773b3 Ported "Blocklist", "Example" and "Execute" to the "deluge.plugins" namespace. 2010-12-09 23:11:20 +00:00
f17634ea63 Drop pkutil and simply use pkg_resources. 2010-12-09 22:18:59 +00:00
16f617d240 Initial commit to implement the "deluge.plugins" namespace package support. 2010-12-09 22:05:34 +00:00
1c7676bfe5 Finish last commit, forgot to revert some of the files. 2010-12-09 18:12:25 +00:00
63fa5bf85b Reuse existing "TorrentAddedEvent" instead of creating a new one. 2010-12-09 18:08:34 +00:00
6cefb49f28 Diferentiate adding an already managed torrent from adding a new, unmanaged torrent, to the session. 2010-12-08 19:33:05 +00:00
eeed72a977 Fix tweak_logging_levels(). 2010-12-07 14:21:45 +00:00
49e10ea0cf Fix bug introduced in previous commit. 2010-12-06 12:34:57 +00:00
26e45dcbc8 Make use of logging.handlers.WatchedFileHandler if deluge is running on python 2.6. 2010-12-06 11:59:37 +00:00
b7bc1fdb1d configmanager needs to be imported at a latter stage at least for the gtk frontend. 2010-12-06 11:45:17 +00:00
3b00a7de59 Swhiched the old style logging, ie, a single logger for all logging output to several loggers. This brings the ability to tweak the logging levels for each of the loggers, ie, we can have the "deluge" logger be at the ERROR level while having "deluge.core" at the DEBUG level, meaning we will only see log message for all of the deluge loggers above the ERROR level while still having all messages above the DEBUG level for the "deluge.core" logger and it's children. This kind of tweak can be achieved by adding a file named "logging.conf" to deluge's config dir and this is explained on the deluge.log.tweak_logging_levels function.
Passing `-r` to the cli's while also passing `-l` will make the logfile rotate when reaching 5Mb in size. Three backups will be kept at all times.
All deluge's code is now using this new style logging along with the git hosted plugins. For other plugins not hosted by deluge, which still imports `LOG` as the logger, a deprecation warning will be shown explaining the required changes needed to use the new style logging. New plugins created by the `create_plugin` script will use the new logging facilities.
2010-12-06 11:20:22 +00:00
14ec9464aa fix a bug that can occur when upgrading 1.1 config files 2010-12-01 10:21:26 +00:00
3d64f0d8da Fix #1283 Consistent icons and add localization to file priorities
Signed-off-by: John Garland <johnnybg+deluge@gmail.com>
2010-11-11 14:01:58 +11:00
87e3a5f515 rebuild the compressed javascript 2010-11-01 09:14:23 +00:00
75e9ff57de update the build file to include the spinnerfieldfix file 2010-11-01 09:13:37 +00:00
b180d2a900 remove the convert conf script that won't actually work anymore 2010-10-31 14:35:00 +00:00
1822c2bde9 fix a silly bug 2010-10-31 10:13:33 +00:00
40e6777c48 Merge branch 'master' of deluge-torrent.org:deluge 2010-10-31 09:18:26 +00:00
f88b24d507 apply 41ffee5 to master 2010-10-31 09:18:09 +00:00
593452ed63 update bbfreeze script 2010-10-29 10:11:40 +01:00
4197e129fe change location of httpdownloader as a temporary fix 2010-10-25 00:13:09 +01:00
0360cbe0b8 fix a bug in the MultiOptionsManager that didn't fire the right arguments in the initial event fire 2010-10-24 23:42:29 +01:00
d2f41fe7e5 apply patch from #1377 2010-10-24 13:30:40 +01:00
0a2e9a5324 include a file that fixes the SpinnerField onBlur method (no idea why it is set to emptyFn) 2010-10-23 22:22:00 +01:00
3c302088f6 fix the path to the loading gif (not that its actually used) 2010-10-23 21:24:06 +01:00
3b6bad2f13 fix up the tracker icon tests 2010-10-22 19:47:38 +01:00
6fd4b298f3 fix up the core tests that were erroring 2010-10-22 19:42:07 +01:00
2beec764c9 move tests back inside the deluge package, makes it easier to run trial on them 2010-10-22 16:36:52 +01:00
e5760ee341 Fix uncaught exception when quitting 2010-10-23 01:12:21 +11:00
45940b9064 Fix #1373 use of cyrllic paths 2010-10-16 12:56:00 -07:00
c97f809bdc Fix #1349 force a theme style with expander-size = 15 to show entries in the sidebar properly. 2010-10-15 19:32:13 -07:00
ae6837c88c create the toolbar with the rest of the UI 2010-10-14 13:54:26 +01:00
a827cf6c7a Keep a torrent paused after a forced recheck if it was paused to start. 2010-10-10 12:36:25 -07:00
f52e3c4aa0 add a check to ensure that the events loop doesn't continue indefinitely 2010-10-10 19:52:08 +01:00
8f7e307f33 wrap client.disconnect() call with a check to see if its classic mode 2010-10-07 00:14:21 +01:00
f1f6f137c3 Make sure config value strings are utf8 encoded (fixes #1369) 2010-10-03 18:33:57 +11:00
ff7ff8eac7 Move decode_string/utf8_encoded to common 2010-10-03 18:12:42 +11:00
4cb2bcae25 Fix sidebar not updating (#1365) 2010-10-02 23:55:51 +10:00
df95222849 Use better attribute / method names in blocklist 2010-09-26 11:39:17 +10:00
463fd3ac04 Fix attribute error in blocklist plugin 2010-09-26 11:30:58 +10:00
eb37c91866 Set locale to the user's default settings in the gtkui 2010-09-20 02:43:07 +10:00
7cd210a59b include missing theme images 2010-09-18 00:47:47 +10:00
eee27868a8 include the .order files 2010-09-16 12:16:07 +01:00
e5dec3f020 add all the other scripts to package_data 2010-09-16 08:52:16 +01:00
def1127c78 More clean-up of setup.py 2010-09-14 11:29:47 -07:00
847f2c2ebd Remove the custom 'install' class and include_package_data 2010-09-14 10:56:42 -07:00
fb49aa02a8 Fix preference page index when removing a preference page 2010-09-13 18:21:31 -07:00
f8dc66b773 Fix bugs with unicode torrents in AutoAdd plugin. 2010-09-13 02:23:10 -04:00
c17b466bae Fix bug in AutoAdd plugin where watchdirs would not display in gtkui when first enabled. 2010-09-13 02:23:09 -04:00
d9cdff9525 Increase max piece size to 8 MiB in create torrent dialog (closes #1358) 2010-09-13 08:50:29 +10:00
915db80a55 Fix VersionSplit behavior when comparing to a dev version. 2010-09-11 16:27:29 -04:00
350d4d7260 Add rpc to check if authorized to call a rpc: daemon.authorized_call() 2010-09-04 12:31:27 -07:00
4b92912577 AutoAdd plugin can now recover when one of the watchfolders has an unhandled exception. 2010-09-03 22:34:28 -04:00
a794223d96 Fix "adjustment with non-zero page size" deprication warning in autoadd plugin. 2010-09-03 22:34:27 -04:00
5811d372f9 Fix up some docstrings 2010-09-03 17:21:56 -07:00
0b2f2f2c8a Add TorrentFileCompleted event. 2010-09-03 17:11:37 -07:00
64022d7bc7 Add 'Owner' filter 2010-09-03 15:15:29 -07:00
bf715d90fd Save 'owner' and 'public' to the torrent state 2010-09-03 15:15:02 -07:00
fdbd9e6687 Fix issue when adding torrents without a 'session'. This can happen
when a plugin adds a torrent, like how the AutoAdd plugin works.  The
user that adds this torrent will be an empty string.
2010-09-03 14:28:16 -07:00
0a0383d075 Use a temp filename with add_torrent_url 2010-08-31 00:04:56 +10:00
5b1bed5a48 Update get_free_space test 2010-08-30 23:49:49 +10:00
7ed33192ec Ensure preferencesmanager only changes intended libtorrent session settings. 2010-08-26 01:31:53 -04:00
c82ba44be8 Fix scheduler so that it keeps current state, even after global settings change. 2010-08-26 01:22:14 -04:00
729daf331c Ignore global stop ratio related settings in logic, so per torrent ones are used. 2010-08-24 23:16:33 -04:00
db1835d942 Merge branch 'newscheduler' 2010-08-24 00:57:15 -04:00
7d4a316733 Add max active downloading and seeding options to scheduler. 2010-08-24 00:30:54 -04:00
da8629db97 Implemented search as you type capabilities to the treeview, ie, when the
treeview has focus and user starts typing, select the first matching
torrent name.
2010-08-24 01:38:05 +01:00
df573c66c6 Merge branch 'master' of deluge-torrent.org:deluge 2010-08-23 17:35:42 -07:00
29f61b58fb Fix key error after enabling a plugin that introduces a new status key 2010-08-23 17:34:30 -07:00
15ce2b71f9 Moved xdg import so it is not called on Windows, where it is unused. fixes #1343 2010-08-22 15:39:12 -04:00
116ccc21fd AutoAdd plugin changes
adds queue to top option
adds ability to append extension instead of deleting torrent once added
2010-08-22 00:31:41 -04:00
dee33745c8 Merge branch 'master' into multiuser 2010-08-21 13:00:47 -07:00
8586cda4e0 Fix unhandled exception when adding a torrent to the session 2010-08-21 12:53:44 -07:00
db9b5580d7 Fix issue where the save_timer is cancelled when it's not active 2010-08-21 12:53:21 -07:00
10aebd600a Add 'Owner' and 'Public' fields to the details tab 2010-08-21 12:42:01 -07:00
f0fe3c7879 Add 'Owner' and 'Public' columns to the TorrentView 2010-08-21 12:28:26 -07:00
33fd852bda Add 'public' torrent option to allow making a torrent publically viewable by other users 2010-08-21 12:25:05 -07:00
65c9dc5fa8 Add new torrent status key 'owner' for keeping track of who added the torrent to the session 2010-08-21 12:15:41 -07:00
7e2eea46d3 Fix man deluged not showing '-u' on its own line 2010-08-20 01:15:27 +10:00
01773e433f Fix #1341 issue where Config would try to cancel the save_timer when it is None. 2010-08-18 12:33:09 -07:00
ca5eaf4270 Add cache expiry check by key update times to fix issue where some status updates would not return
correctly if they were done < cache_time from the previous status request
2010-08-18 12:15:53 -07:00
7d64f057c7 Add additional test for get_torrents_status and fix the other one to properly invalidate the cache
time from startup before proceeding
2010-08-18 12:15:16 -07:00
48d016e97d Add test to demonstrate flaw in SessionProxy design. Need to keep track of update times for each
status key individually to fix this.
2010-08-18 11:06:10 -07:00
e9ce506d1c fix the script resource on windows 2010-08-14 17:38:30 +01:00
e0eb0bd06a add the apple iOS bookmark icons from #1339 2010-08-14 16:16:10 +01:00
9f992ec40d fix the system.listMethods json call when running in classic mode 2010-08-14 16:05:40 +01:00
ce8ef4f95b Add test suite for SessionProxy 2010-08-10 09:57:00 -07:00
4d0560eff2 Fix getting a torrent's status with an empty key list to return all the
torrent's status keys instead of an empty dict
2010-08-06 17:28:16 -07:00
d49cde1994 use the get_libtorrent.sh script to get libtorrent if it is missing 2010-07-22 21:13:26 +01:00
16a1173f1d change default version to 0.15 2010-07-22 18:18:15 +01:00
333d2f5562 add libtorrent fetch script 2010-07-22 18:17:51 +01:00
c7fe1bdef5 remove the libtorrent submodule 2010-07-22 18:05:46 +01:00
46a967fb8c a couple of fixes to stop the webui crashing when running within the gtkui 2010-07-18 23:11:02 +01:00
ca22e84858 Alternate tooltip when toggling session 2010-07-18 01:17:33 +10:00
20bd962e6a Add Toggle plugin 2010-07-18 00:56:56 +10:00
22a1448372 Only use an icon if it passes some sanity checks 2010-07-17 17:11:19 +10:00
722a5cd9e1 Use a blank icon when the tracker icon downloaded isn't a proper image 2010-07-15 19:17:17 -07:00
efecf38bcd Attempt to create a move_storage destination path if it doesn't exist 2010-07-15 10:51:06 -07:00
dfb75d67b9 Do not attempt to move a torrents storage if the destination path does
not exist
2010-07-12 14:45:13 -07:00
961d405921 Try to import system rencode before deluge.rencode to allow the use of the new rencode library at: http://code.google.com/p/rencode/ 2010-07-08 16:39:02 -07:00
e025b6b9db Fix hang when quitting in classic mode 2010-07-08 16:23:12 -07:00
bc5aa1bf71 Add logging the user when a torrent is added or removed 2010-07-05 21:08:15 -07:00
3cd30ea96a Use torrent state name instead of number if available 2010-07-02 18:09:21 -07:00
504751424f Use basestring instead of str and unicode 2010-07-02 15:19:42 +10:00
37a00a48a7 Fix uncaught exception when closing deluge in classic mode 2010-07-02 02:45:47 +10:00
2a2f5d90ae Fix typo 2010-07-02 02:43:32 +10:00
f0920f5638 more improvements to the shift select 2010-07-01 14:21:37 +01:00
43fb998651 fix select 'upwards' 2010-07-01 14:08:21 +01:00
148fcdbe37 allow for shift selecting in tree grids 2010-07-01 13:45:23 +01:00
de79bba540 Fix #1302 an uncaught exception in an state_changed event handler in SessionProxy was preventing the
TorrentManager's stop method from properly saving all the resume data.
2010-06-22 18:24:27 -07:00
d5881142aa Always look for -mt boost libraries first 2010-06-18 09:50:58 -07:00
494c468da8 fix typo 2010-06-12 22:47:59 +01:00
672668ccdb change bits to bytes, thanks to charles 2010-06-11 15:59:33 +01:00
538aed9147 Fix typo in label plugin - thanks konti 2010-06-11 00:49:42 +10:00
d800273891 Handle os.remove failing on windows 2010-06-08 03:19:30 +10:00
94f96c5165 Python independent version of previous commit 2010-06-08 01:55:48 +10:00
4b1d60c727 Fix console ui not liking paths with backslashes on windows (#1293) 2010-06-08 01:25:21 +10:00
cfe547b31a Print a more informative error message if the torrent file doesn't exist 2010-06-08 01:22:19 +10:00
f6195f775f Fix execute plugin only executing last event (#1306) 2010-06-08 00:17:22 +10:00
87879ab3b8 Only encode if necessary 2010-06-07 20:12:31 +10:00
81a837faed Fix unicode support in console ui (#1307) 2010-06-07 20:11:11 +10:00
c06f905702 Add some debug logging statements 2010-06-04 18:05:21 +01:00
f6f9e0234a Fix an error in the key 2010-06-04 17:37:53 +01:00
e1e1472a8f Fix saving the correct event name 2010-06-04 16:37:37 +01:00
b7e1fe1696 Save the execute config after adding/removing/saving commands 2010-06-04 16:31:51 +01:00
0314d0440f Fix typo in execute plugin 2010-05-20 00:04:43 +10:00
3226b1819d Fix man deluged not showing '-d' on its own line 2010-05-16 22:32:12 +10:00
4b8a85763c Fix remote save path dialog not disappearing after creating a torrent 2010-05-16 18:10:13 +10:00
ae4f2c3bb0 Fix only being able to click "remote path" once when creating a torrent 2010-05-16 18:08:33 +10:00
bc28b83062 Fix deluged crashing on windows when logfile's directory doesn't exist 2010-05-16 13:11:18 +10:00
2603c36e7d Revert "Fix trac wiki turning CamelCase words into broken links"
This reverts commit 81b56cce62.
2010-05-11 23:47:06 +10:00
81b56cce62 Fix trac wiki turning CamelCase words into broken links 2010-05-11 23:23:39 +10:00
649a2b6f8e Update email address and copyright 2010-05-11 03:51:45 +10:00
4caf81ef89 Fix new release check pref 2010-05-09 22:45:28 -07:00
65c33a37a1 Fix the naming of the some of the config set methods 2010-05-09 22:36:31 -07:00
eff17931eb Fix preferences manager not setting initial settings on start-up 2010-05-09 22:32:14 -07:00
b33c2abf82 Fix label plugin not remembering newly created labels 2010-05-09 17:50:39 +10:00
ba514f0b0e Remove unused code from label plugin 2010-05-09 17:39:45 +10:00
7f60867ae9 Update docstrings to use names from previous commit 2010-05-09 17:05:22 +10:00
71d8836118 Use better names for TrackerIcons' args 2010-05-09 17:01:15 +10:00
97d6f8ce80 Return the noIcon for empty strings as well 2010-05-09 16:43:22 +10:00
ca7f009e74 Raise IconsError instead of IndexError (fixes infinite looping) 2010-05-09 16:31:32 +10:00
f08e5176c3 Do not request a tracker icon if the host is "" 2010-05-08 20:06:15 -07:00
70161a54fa Simplify PreferencesManager by simply looking for the _on_get_<config key> method instead of registering a set function for each 2010-05-08 20:04:55 -07:00
a945d0a78d Use previously defined host variable instead of getting the tracker host from the TreeModel 2010-05-08 20:02:58 -07:00
245b799ccf Add test for tracker_icons for when requesting an icon for host that is "". This test results in an infinite loop. 2010-05-08 20:01:46 -07:00
0dc6c3ecfd Return 0 in get_free_space if the download_location is invalid 2010-05-08 20:00:41 -07:00
98f000cc70 rebuild deluge-all and ext-extensions 2010-05-08 16:18:48 +01:00
8d4daff068 update the build files for deluge-all and ext-extensions 2010-05-08 16:18:48 +01:00
79d68a5b9b fix the null comparison 2010-05-08 16:18:48 +01:00
412d0ee4f9 set the baseCls for the add label form panel to x-plain 2010-05-08 16:18:47 +01:00
e8788bde08 Make host_to_url support redirection and add another test 2010-05-08 16:25:16 +10:00
815a71fe8b Try favicon.ico if there's a HTMLParseError 2010-05-08 15:50:04 +10:00
fce16ba51f Fix relative redirecting in blocklist plugin 2010-05-06 23:27:04 +10:00
50cfd9c9b1 Update tests 2010-05-06 23:06:53 +10:00
369b03bffb Update version 2010-05-05 14:46:27 -07:00
1703 changed files with 599310 additions and 324527 deletions

8
.gitattributes vendored
View File

@ -1,10 +1,6 @@
/libtorrent export-ignore
/win32 export-ignore
docs/build export-ignore
docs/source export-ignore
/tests export-ignore
deluge/scripts export-ignore
.gitattributes export-ignore
.gitmodules export-ignore
.gitignore export-ignore
*.py diff=python
ext-all.js diff=minjs
*.state -merge -text

100
.github/workflows/cd.yml vendored Normal file
View File

@ -0,0 +1,100 @@
name: Package
on:
push:
tags:
- "deluge-*"
- "!deluge*-dev*"
branches:
- develop
pull_request:
types: [labeled, opened, synchronize, reopened]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
ref:
description: "Enter a tag or commit to package"
default: ""
jobs:
windows_package:
runs-on: windows-2019
if: (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'package'))
strategy:
matrix:
arch: [x64, x86]
python: ["3.9"]
libtorrent: [2.0.6, 1.2.15]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
fetch-depth: 0
# Checkout Deluge source to subdir to enable packaging any tag/commit
- name: Checkout Deluge source
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref }}
fetch-depth: 0
path: deluge_src
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python}}
architecture: ${{ matrix.arch }}
cache: pip
- name: Prepare pip
run: python -m pip install wheel
- name: Install GTK
run: |
$WebClient = New-Object System.Net.WebClient
$WebClient.DownloadFile("https://github.com/deluge-torrent/gvsbuild-release/releases/download/latest/gvsbuild-py${{ matrix.python }}-vs16-${{ matrix.arch }}.zip","C:\GTK.zip")
7z x C:\GTK.zip -oc:\GTK
echo "C:\GTK\release\lib" | Out-File -FilePath $env:GITHUB_PATH -Append
echo "C:\GTK\release\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
echo "C:\GTK\release" | Out-File -FilePath $env:GITHUB_PATH -Append
python -m pip install --no-index --find-links="C:\GTK\release\python" pycairo PyGObject
- name: Install Python dependencies
run: >
python -m pip install
twisted[tls]==22.4.0
libtorrent==${{ matrix.libtorrent }}
pyinstaller==4.10
pygame
-r requirements.txt
- name: Install Deluge
working-directory: deluge_src
run: |
python -m pip install .
python setup.py install_scripts
- name: Freeze Deluge
working-directory: packaging/win
run: |
pyinstaller --clean delugewin.spec --distpath freeze
- name: Fix OpenSSL for libtorrent x64
if: ${{ matrix.arch == 'x64' }}
working-directory: packaging/win/freeze/Deluge
run: |
cp libssl-1_1.dll libssl-1_1-x64.dll
cp libcrypto-1_1.dll libcrypto-1_1-x64.dll
- name: Make Deluge Installer
working-directory: ./packaging/win
run: |
python setup_nsis.py
makensis /Darch=${{ matrix.arch }} deluge-win-installer.nsi
- uses: actions/upload-artifact@v2
with:
name: deluge-py${{ matrix.python }}-lt${{ matrix.libtorrent }}-${{ matrix.arch }}
path: packaging/win/*.exe

98
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,98 @@
name: CI
on:
push:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
jobs:
test-linux:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.7", "3.10"]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "requirements*.txt"
- name: Sets env var for security
if: (github.event_name == 'pull_request' && contains(github.event.pull_request.body, 'security_test')) || (github.event_name == 'push' && contains(github.event.head_commit.message, 'security_test'))
run: echo "SECURITY_TESTS=True" >> $GITHUB_ENV
- name: Install dependencies
run: |
pip install --upgrade pip wheel
pip install -r requirements.txt -r requirements-tests.txt
pip install -e .
- name: Install security dependencies
if: contains(env.SECURITY_TESTS, 'True')
run: |
wget -O- $TESTSSL_URL$TESTSSL_VER | tar xz
mv -t deluge/tests/data testssl.sh-$TESTSSL_VER/testssl.sh testssl.sh-$TESTSSL_VER/etc/;
env:
TESTSSL_VER: 3.0.6
TESTSSL_URL: https://codeload.github.com/drwetter/testssl.sh/tar.gz/refs/tags/v
- name: Setup core dump directory
run: |
sudo mkdir /cores/ && sudo chmod 777 /cores/
echo "/cores/%E.%p" | sudo tee /proc/sys/kernel/core_pattern
- name: Test with pytest
run: |
ulimit -c unlimited # Enable core dumps to be captured
python -c 'from deluge._libtorrent import lt; print(lt.__version__)';
catchsegv python -X dev -m pytest -v -m "not (todo or gtkui)" deluge
- uses: actions/upload-artifact@v2
# capture all crashes as build artifacts
if: failure()
with:
name: crashes
path: /cores
test-windows:
runs-on: windows-2019
strategy:
matrix:
python-version: ["3.7", "3.10"]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "requirements*.txt"
- name: Install dependencies
run: |
pip install --upgrade pip wheel
pip install -r requirements.txt -r requirements-tests.txt
pip install -e .
- name: Test with pytest
run: |
python -c 'import libtorrent as lt; print(lt.__version__)';
pytest -v -m "not (todo or gtkui or security)" deluge

45
.github/workflows/docs.yml vendored Normal file
View File

@ -0,0 +1,45 @@
name: Docs
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: |
pip install --upgrade pip wheel
pip install tox
sudo apt-get install enchant-2
- name: Test with tox
env:
TOX_ENV: docs
run: |
tox -e $TOX_ENV

17
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: Linting
on:
push:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Run pre-commit linting
uses: pre-commit/action@v2.0.2

22
.gitignore vendored
View File

@ -1,9 +1,25 @@
*~
build
.cache
dist
*egg-info
docs/source/modules/deluge*.rst
*.egg-info/
*.dist-info/
*.egg
*.log
*.pyc
__pycache__/
*.py[cod]
*.tar.*
_trial_temp
.tox/
deluge/i18n/*/
deluge.pot
deluge/ui/web/js/*.js
deluge/ui/web/js/extjs/ext-extensions*.js
*.desktop
*.appdata.xml
.build_data*
osx/app
RELEASE-VERSION
.venv*
# used by setuptools to cache downloaded eggs
/.eggs

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "libtorrent"]
path = libtorrent
url = git://deluge-torrent.org/libtorrent

51
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,51 @@
default_language_version:
python: python3
exclude: >
(?x)^(
deluge/ui/web/docs/template/.*|
deluge/tests/data/.*svg|
)$
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
name: Fmt Black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.1
hooks:
- id: prettier
name: Fmt Prettier
# Workaround to list modified files only.
args: [--list-different]
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: Fmt isort
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
name: Chk Flake8
additional_dependencies:
- pep8-naming==0.12.1
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: double-quote-string-fixer
name: Fix Double-quotes
- id: end-of-file-fixer
name: Fix End-of-files
exclude_types: [javascript, css]
- id: mixed-line-ending
name: Fix Line endings
args: [--fix=auto]
- id: trailing-whitespace
name: Fix Trailing whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
hooks:
- id: pyupgrade
args: [--py36-plus]
stages: [manual]

6
.prettierignore Normal file
View File

@ -0,0 +1,6 @@
deluge/ui/web/css/ext-*.css
deluge/ui/web/js/extjs/ext-*.js
deluge/ui/web/docs/
deluge/ui/web/themes/images/
*.py*
*.html

13
.prettierrc.yaml Normal file
View File

@ -0,0 +1,13 @@
trailingComma: "es5"
tabWidth: 4
singleQuote: true
overrides:
- files:
- "*.yaml"
- ".*.yaml"
- "*.yml"
- ".*.yml"
- "*.md"
options:
tabWidth: 2
singleQuote: false

420
.pylintrc Normal file
View File

@ -0,0 +1,420 @@
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS
# Add files or directories matching the regex patterns to the blacklist. The
# regex matches against base names, not paths.
ignore-patterns=
# Pickle collected data for later comparisons.
persistent=yes
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=
# Use multiple processes to speed up Pylint.
jobs=2
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=
# Allow optimization of some AST trees. This will activate a peephole AST
# optimizer, which will apply various small optimizations. For instance, it can
# be used to obtain the result of joining multiple strings with the addition
# operator. Joining a lot of strings can lead to a maximum recursion error in
# Pylint and this flag can prevent that. It has one side effect, the resulting
# AST will be different than the one from reality. This option is deprecated
# and it will be removed in Pylint 2.0.
optimize-ast=no
[MESSAGES CONTROL]
# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
confidence=
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
#enable=
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
#
# Arranged by category and use symbolic names instead of ids.
disable=
# Convention
missing-docstring, invalid-name, bad-continuation,
# Error
no-member, no-name-in-module,
# Information
locally-disabled,
# Refactor
no-self-use, too-many-arguments, too-many-branches, too-many-instance-attributes,
too-many-locals, too-few-public-methods, too-many-public-methods, too-many-statements,
# Refactor msgs that should eventually be enabled:
redefined-variable-type, too-many-ancestors,
too-many-nested-blocks, too-many-return-statements,
# Warning
unused-argument, protected-access, import-error, unused-variable,
attribute-defined-outside-init,
# Warning msgs that should eventually be enabled:
arguments-differ, global-statement, fixme, broad-except
[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html. You can also give a reporter class, eg
# mypackage.mymodule.MyReporterClass.
output-format=parseable
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]". This option is deprecated
# and it will be removed in Pylint 2.0.
files-output=no
# Tells whether to display a full report or only the messages
reports=no
# Python expression which should return a note less than 10 (10 is the highest
# note). You have access to the variables errors warning, statement which
# respectively contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details
#msg-template=
[SPELLING]
# Spelling dictionary name. Available dictionaries: none. To make it working
# install python-enchant package.
spelling-dict=
# List of comma separated words that should not be checked.
spelling-ignore-words=
# A path to a file that contains private dictionary; one word per line.
spelling-private-dict-file=
# Tells whether to store unknown words to indicated private dictionary in
# --spelling-private-dict-file option instead of raising a message.
spelling-store-unknown-words=no
[BASIC]
# Good variable names which should always be accepted, separated by a comma
good-names=d,i,j,k,ex,Run,_,log
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
# Colon-delimited sets of names that determine each other's naming style when
# the name regexes allow several styles.
name-group=
# Include a hint for the correct naming format with invalid-name
include-naming-hint=no
# List of decorators that produce properties, such as abc.abstractproperty. Add
# to this list to register other decorators that produce valid properties.
property-classes=abc.abstractproperty
# Regular expression matching correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for function names
function-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for variable names
variable-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct constant names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
# Naming hint for constant names
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
# Regular expression matching correct attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for attribute names
attr-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for argument names
argument-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct class attribute names
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
# Naming hint for class attribute names
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
# Regular expression matching correct inline iteration names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
# Naming hint for inline iteration names
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
# Regular expression matching correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$
# Naming hint for class names
class-name-hint=[A-Z_][a-zA-Z0-9]+$
# Regular expression matching correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
# Naming hint for module names
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
# Regular expression matching correct method names
method-rgx=[a-z_][a-z0-9_]{2,40}$
# Naming hint for method names
method-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=__.*__
# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=-1
[ELIF]
# Maximum number of nested blocks for function / method body
max-nested-blocks=5
[LOGGING]
# Logging modules to check that the string format arguments are in logging
# function parameter format
logging-modules=logging
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=120
# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=no
# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,dict-separator
# Maximum number of lines in a module
max-module-lines=1550
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
# Number of spaces of indent required inside a hanging or continued line.
indent-after-paren=4
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
expected-line-ending-format=LF
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO
[VARIABLES]
# Tells whether we should check for unused import in __init__ files.
init-import=no
# A regular expression matching the name of dummy variables (i.e. expectedly
# not used).
dummy-variables-rgx=_$|dummy
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins=_,_n,__request__,WindowsError
# List of strings which can identify a callback function by name. A callback
# name must start or end with one of those strings.
callbacks=cb_,_cb
# List of qualified module names which can have objects that can redefine
# builtins.
redefining-builtins-modules=
[TYPECHECK]
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis. It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=
# List of class names for which member attributes should not be checked (useful
# for classes with dynamically set attributes). This supports the use of
# qualified names.
ignored-classes=SQLObject,twisted.internet.reactor
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members=REQUEST,acl_users,aq_parent
# List of decorators that produce context managers, such as
# contextlib.contextmanager. Add to this list to register other decorators that
# produce valid context managers.
contextmanager-decorators=contextlib.contextmanager
[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=4
# Ignore comments when computing similarities.
ignore-comments=yes
# Ignore docstrings when computing similarities.
ignore-docstrings=yes
# Ignore imports when computing similarities.
ignore-imports=no
[IMPORTS]
# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,TERMIOS,Bastion,rexec
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled)
import-graph=
# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled)
ext-import-graph=
# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled)
int-import-graph=
# Force import order to recognize a module as part of the standard
# compatibility libraries.
known-standard-library=
# Force import order to recognize a module as part of a third party library.
known-third-party=enchant
[DESIGN]
# Maximum number of arguments for function / method
max-args=7
# Argument names that match this expression will be ignored. Default to name
# with leading underscore
ignored-argument-names=_.*
# Maximum number of locals for function / method body
max-locals=15
# Maximum number of return / yield for function / method body
max-returns=6
# Maximum number of branch for function / method body
max-branches=12
# Maximum number of statements in function / method body
max-statements=50
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of attributes for a class (see R0902).
max-attributes=7
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
# Maximum number of boolean expressions in a if statement
max-bool-expr=5
[CLASSES]
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=mcs
# List of member names, which should be excluded from the protected access
# warning.
exclude-protected=_asdict,_fields,_replace,_source,_make
[EXCEPTIONS]
# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception

22
.readthedocs.yml Normal file
View File

@ -0,0 +1,22 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# Optionally build your docs in additional formats such as PDF and ePub
formats: all
# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: requirements.txt
- requirements: docs/requirements.txt
- method: setuptools
path: .

790
AUTHORS Normal file
View File

@ -0,0 +1,790 @@
Authors:
* Andrew Resch ('andar') <andrewresch@gmail.com>
* Damien Churchill ('damoxc') <damoxc@gmail.com>
Main Developers:
* Andrew Resch
* Damien Churchill
* John Garland ('johnnyg') <johnnybg+deluge@gmail.com>
* Calum Lind ('cas') <calumlind+deluge@gmail.com>
libtorrent (http://www.libtorrent.org):
* Arvid Norberg
Contributors (and Past Developers):
* Zach Tibbitts <zach@collegegeek.org>
* Alon Zakai ('Kripken') <kripkensteiner@gmail.com>
* Marcos Mobley ('markybob') <markybob@gmail.com>
* Alex Dedul
* Sadrul Habib Chowdhury
* Ido Abramovich <ido.deluge@gmail.com>
* Martijn Voncken <mvoncken@gmail.com>
* Mark Stahler ('kramed') <markstahler@gmail.com>
* Pedro Algarvio ('s0undt3ch') <ufs@ufsoft.org>
* Cristian Greco ('cgreco') <cristian@regolo.cc>
* Chase Sterling ('gazpachoKing') <chase.sterling@gmail.com>
Plugin Developers:
* Autoadd : Chase Sterling
* Blocklist : John Garland
* Execute : Damien Churchill
* Extractor : Andrew Resch
* Label : Martijn Voncken
* Notifications : Pedro Algarvio
* Scheduler : Andrew Resch
* Webui : Damien Churchill
Images Authors:
* files: deluge/ui/data/pixmaps/*.svg, *.png
deluge/ui/web/icons/active.png, alert.png, all.png, checking.png, dht.png,
downloading.png, inactive.png, queued.png, seeding.png, traffic.png
deluge/ui/web/images/deluge*.png
deluge/ui/web/icons/apple-pre-*.png, deluge*.png
copyright: Calum Lind
license: GPLv3
* files: deluge/plugins/blocklist/blocklist/data/*.png
deluge/ui/data/pixmaps/tracker_warning16.png, tracker_all16.png, lock48.png
copyright: Gnome Icon Theme
license: GPLv2
url: http://ftp.acc.umu.se/pub/GNOME/sources/gnome-icon-theme
* files: deluge/ui/data/pixmaps/magnet*.svg, *.png
copyright: Matias Wilkman
license:
* files: deluge/ui/data/pixmaps/flags/*.png
copyright: Mark James <mjames@gmail.com>
license: Public Domain
url: http://famfamfam.com/lab/icons/flags/
* files: deluge/ui/web/icons/*.png
exceptions: apple-pre-*.png, active.png, alert.png, all.png, deluge.png, dht.png,
downloading.png, inactive.png, queued.png, seeding.png, traffic.png
copyright: Yusuke Kamiyamane <p@yusukekamiyamane.com>
license: Creative Commons Attribution 3.0 License
url: http://p.yusukekamiyamane.com/
* files: deluge/ui/web/images/spinner.gif, spinner-split.gif
copyright: Steven Chim
license: BSD license
url: http://members.upc.nl/j.chim/ext/spinner2/ext-spinner.html
Translation Contributors:
* files: deluge/i18n/*.po
Aaron Wang Shi
abbigss
ABCdatos
Abcx
Actam
Adam
adaminikisi
adi_oporanu
Adrian Goll
afby
Ahmades
Ahmad Farghal
Ahmad Gharbeia أحمد غربية
akira
Aki Sivula
Alan Pepelko
Alberto
Alberto Ferrer
alcatr4z
AlckO
Aleksej Korgenkov
Alessio Treglia
Alexander Ilyashov
Alexander Matveev
Alexander Saltykov
Alexander Taubenkorb
Alexander Telenga
Alexander Yurtsev
Alexandre Martani
Alexandre Rosenfeld
Alexandre Sapata Carbonell
Alexey Osipov
Alin Claudiu Radut
allah
AlSim
Alvaro Carrillanca P.
A.Matveev
Andras Hipsag
András Kárász
Andrea Ratto
Andreas Johansson
Andreas Str
André F. Oliveira
AndreiF
andrewh
Angel Guzman Maeso
Aníbal Deboni Neto
animarval
Antonio Cono
antoniojreyes
Anton Shestakov
Anton Yakutovich
antou
Arkadiusz Kalinowski
Artin
artir
Astur
Athanasios Lefteris
Athmane MOKRAOUI (ButterflyOfFire)
Augusta Carla Klug
Avoledo Marco
axaard
AxelRafn
Axezium
Ayont
b3rx
Bae Taegil
Bajusz Tamás
Balaam's Miracle
Ballestein
Bent Ole Fosse
berto89
bigx
Bjorn Inge Berg
blackbird
Blackeyed
blackmx
BlueSky
Blutheo
bmhm
bob00work
boenki
Bogdan Bădic-Spătariu
bonpu
Boone
boss01
Branislav Jovanović
bronze
brownie
Brus46
bumper
butely
BXCracer
c0nfidencal
Can Kaya
Carlos Alexandro Becker
cassianoleal
Cédric.h
César Rubén
chaoswizard
Chen Tao
chicha
Chien Cheng Wei
Christian Kopac
Christian Widell
Christoffer Brodd-Reijer
christooss
CityAceE
Clopy
Clusty
cnu
Commandant
Constantinos Koniaris
Coolmax
cosmix
Costin Chirvasuta
CoVaLiDiTy
cow_2001
Crispin Kirchner
crom
Cruster
Cybolic
Dan Bishop
Danek
Dani
Daniel Demarco
Daniel Ferreira
Daniel Frank
Daniel Holm
Daniel Høyer Iversen
Daniel Marynicz
Daniel Nylander
Daniel Patriche
Daniel Schildt
Daniil Sorokin
Dante Díaz
Daria Michalska
DarkenCZ
Darren
Daspah
David Eurenius
davidhjelm
David Machakhelidze
Dawid Dziurdzia
Daya Adianto
dcruz
Deady
Dereck Wonnacott
Devgru
Devid Antonio FiloniDevilDogTG
di0rz`
Dialecti Valsamou
Diego Medeiros
Dkzoffy
Dmitrij D. Czarkoff
Dmitriy Geels
Dmitry Olyenyov
Dominik Kozaczko
Dominik Lübben
doomster
Dorota Król
Doyen Philippe
Dread Knight
DreamSonic
duan
Duong Thanh An
DvoglavaZver
dwori
dylansmrjones
Ebuntor
Edgar Alejandro Jarquin Flores
Eetu
ekerazha
Elias Julkunen
elparia
Emberke
Emiliano Goday Caneda
EndelWar
eng.essam
enubuntu
ercangun
Erdal Ronahi
ergin üresin
Eric
Éric Lassauge
Erlend Finvåg
Errdil
ethan shalev
Evgeni Spasov
ezekielnin
Fabian Ordelmans
Fabio Mazanatti
Fábio Nogueira
FaCuZ
Felipe Lerena
Fernando Pereira
fjetland
Florian Schäfer
FoBoS
Folke
Force
fosk
fragarray
freddeg
Frédéric Perrin
Fredrik Kilegran
FreeAtMind
Fulvio Ciucci
Gabor Kelemen
Galatsanos Panagiotis
Gaussian
gdevitis
Georg Brzyk
George Dumitrescu
Georgi Arabadjiev
Georg Sieber
Gerd Radecke
Germán Heusdens
Gianni Vialetto
Gigih Aji Ibrahim
Giorgio Wicklein
Giovanni Rapagnani
Giuseppe
gl
glen
granjerox
Green Fish
greentea
Greyhound
G. U.
Guillaume BENOIT
Guillaume Pelletier
Gustavo Henrique Klug
gutocarvalho
Guybrush88
Hans Rødtang
HardDisk
Hargas Gábor
Heitor Thury Barreiros Barbosa
helios91940
helix84
Helton Rodrigues
Hendrik Luup
Henrique Ferreiro
Henry Goury-Laffont
Hezy Amiel
hidro
hoball
hokten
Holmsss
hristo.num
Hubert Życiński
Hyo
Iarwain
ibe
ibear
Id2ndR
Igor Zubarev
IKON (Ion)
imen
Ionuț Jula
Isabelle STEVANT
István Nyitrai
Ivan Petrovic
Ivan Prignano
IvaSerge
jackmc
Jacks0nxD
Jack Shen
Jacky Yeung
Jacques Stadler
Janek Thomaschewski
Jan Kaláb
Jan Niklas Hasse
Jasper Groenewegen
Javi Rodríguez
Jayasimha (ಜಯಸಿಂಹ)
jeannich
Jeff Bailes
Jesse Zilstorff
Joan Duran
João Santos
Joar Bagge
Joe Anderson
Joel Calado
Johan Linde
John Garland
Jojan
jollyr0ger
Jonas Bo Grimsgaard
Jonas Granqvist
Jonas Slivka
Jonathan Zeppettini
Jørgen
Jørgen Tellnes
josé
José Geraldo Gouvêa
José Iván León Islas
José Lou C.
Jose Sun
Jr.
Jukka Kauppinen
Julián Alarcón
julietgolf
Jusic
Justzupi
Kaarel
Kai Thomsen
Kalman Tarnay
Kamil Páral
Kane_F
kaotiks@gmail.com
Kateikyoushii
kaxhinaz
Kazuhiro NISHIYAMA
Kerberos
Keresztes Ákos
kevintyk
kiersie
Kimbo^
Kim Lübbe
kitzOgen
Kjetil Rydland
kluon
kmikz
Knedlyk
koleoptero
Kőrösi Krisztián
Kouta
Krakatos
Krešo Kunjas
kripken
Kristaps
Kristian Øllegaard
Kristoffer Egil Bonarjee
Krzysztof Janowski
Krzysztof Zawada
Larry Wei Liu
laughterwym
Laur Mõtus
lazka
leandrud
lê bình
Le Coz Florent
Leo
liorda
LKRaider
LoLo_SaG
Long Tran
Lorenz
Low Kian Seong
Luca Andrea Rossi
Luca Ferretti
Lucky LIX
Luis Gomes
Luis Reis
Łukasz Wyszyński
luojie-dune
maaark
Maciej Chojnacki
Maciej Meller
Mads Peter Rommedahl
Major Kong
Malaki
malde
Malte Lenz
Mantas Kriaučiūnas
Mara Sorella
Marcin
Marcin Falkiewicz
marcobra
Marco da Silva
Marco de Moulin
Marco Rodrigues
Marcos
Marcos Escalier
Marcos Mobley
Marcus Ekstrom
Marek Dębowski
Mário Buči
Mario Munda
Marius Andersen
Marius Hudea
Marius Mihai
Mariusz Cielecki
Mark Krapivner
marko-markovic
Markus Brummer
Markus Sutter
Martin
Martin Dybdal
Martin Iglesias
Martin Lettner
Martin Pihl
Masoud Kalali
mat02
Matej Urbančič
Mathias-K
Mathieu Arès
Mathieu D. (MatToufoutu)
Mathijs
Matrik
Matteo Renzulli
Matteo Settenvini
Matthew Gadd
Matthias Benkard
Matthias Mailänder
Mattias Ohlsson
Mauro de Carvalho
Max Molchanov
Me
MercuryCC
Mert Bozkurt
Mert Dirik
MFX
mhietar
mibtha
Michael Budde
Michael Kaliszka
Michalis Makaronides
Michał Tokarczyk
Miguel Pires da Rosa
Mihai Capotă
Miika Metsälä
Mikael Fernblad
Mike Sierra
mikhalek
Milan Prvulović
Milo Casagrande
Mindaugas
Miroslav Matejaš
misel
mithras
Mitja Pagon
M.Kitchen
Mohamed Magdy
moonkey
MrBlonde
muczy
Münir Ekinci
Mustafa Temizel
mvoncken
Mytonn
NagyMarton
neaion
Neil Lin
Nemo
Nerijus Arlauskas
Nicklas Larsson
Nicolaj Wyke
Nicola Piovesan
Nicolas Sabatier
Nicolas Velin
Nightfall
NiKoB
Nikolai M. Riabov
Niko_Thien
niska
Nithir
noisemonkey
nomemohes
nosense
null
Nuno Estêvão
Nuno Santos
nxxs
nyo
obo
Ojan
Olav Andreas Lindekleiv
oldbeggar
Olivier FAURAX
orphe
osantana
Osman Tosun
OssiR
otypoks
ounn
Oz123
Özgür BASKIN
Pablo Carmona A.
Pablo Ledesma
Pablo Navarro Castillo
Paco Molinero
Pål-Eivind Johnsen
pano
Paolo Naldini
Paracelsus
Patryk13_03
Patryk Skorupa
PattogoTehen
Paul Lange
Pavcio
Paweł Wysocki
Pedro Brites Moita
Pedro Clemente Pereira Neto
Pekka "PEXI" Niemistö
Penegal
Penzo
perdido
Peter Kotrcka
Peter Skov
Peter Van den Bosch
Petter Eklund
Petter Viklund
phatsphere
Phenomen
Philipi
Philippides Homer
phoenix
pidi
Pierre Quillery
Pierre Rudloff
Pierre Slamich
Pietrao
Piotr Strębski
Piotr Wicijowski
Pittmann Tamás
Playmolas
Prescott
Prescott_SK
pronull
Przemysław Kulczycki
Pumy
pushpika
PY
qubicllj
r21vo
Rafał Barański
rainofchaos
Rajbir
ras0ir
Rat
rd1381
Renato
Rene Hennig
Rene Pärts
Ricardo Duarte
Richard
Robert Hrovat
Roberth Sjonøy
Robert Lundmark
Robin Jakobsson
Robin Kåveland
Rodrigo Donado
Roel Groeneveld
rohmaru
Rolf Christensen
Rolf Leggewie
Roni Kantis
Ronmi
Rostislav Raykov
royto
RuiAmaro
Rui Araújo
Rui Moura
Rune Svendsen
Rusna
Rytis
Sabirov Mikhail
salseeg
Sami Koskinen
Samir van de Sand
Samuel Arroyo Acuña
Samuel R. C. Vale
Sanel
Santi
Santi Martínez Cantelli
Sardan
Sargate Kanogan
Sarmad Jari
Saša Bodiroža
sat0shi
Saulius Pranckevičius
Savvas Radevic
Sebastian Krauß
Sebastián Porta
Sedir
Sefa Denizoğlu
sekolands
Selim Suerkan
semsomi
Sergii Golovatiuk
setarcos
Sheki
Shironeko
Shlomil
silfiriel
Simone Tolotti
Simone Vendemia
sirkubador
Sławomir Więch
slip
slyon
smoke
Sonja
spectral
spin_555
spitf1r3
Spiziuz
Spyros Theodoritsis
SqUe
Squigly
srtck
Stefan Horning
Stefano Maggiolo
Stefano Roberto Soleti
steinberger
Stéphane Travostino
Stephan Klein
Steven De Winter
Stevie
Stian24
stylius
Sukarn Maini
Sunjae Park
Susana Pereira
szymon siglowy
takercena
TAS
Taygeto
temy4
texxxxxx
thamood
Thanos Chatziathanassiou
Tharawut Paripaiboon
Theodoor
Théophane Anestis
Thor Marius K. Høgås
Tiago Silva
Tiago Sousa
Tikkel
tim__b
Tim Bordemann
Tim Fuchs
Tim Kornhammar
Timo
Timo Jyrinki
Timothy Babych
TitkosRejtozo
Tom
Tomas Gustavsson
Tomas Valentukevičius
Tomasz Dominikowski
Tomislav Plavčić
Tom Mannerhagen
Tommy Mikkelsen
Tom Verdaat
Tony Manco
Tor Erling H. Opsahl
Toudi
tqm_z
Trapanator
Tribaal
Triton
TuniX12
Tuomo Sipola
turbojugend_gr
Turtle.net
twilight
tymmej
Ulrik
Umarzuki Mochlis
unikob
Vadim Gusev
Vagi
Valentin Bora
Valmantas Palikša
VASKITTU
Vassilis Skoullis
vetal17
vicedo
viki
villads hamann
Vincent Garibal
Vincent Ortalda
vinchi007
Vinícius de Figueiredo Silva
Vinzenz Vietzke
virtoo
virtual_spirit
Vitor Caike
Vitor Lamas Gatti
Vladimir Lazic
Vladimir Sharshov
Wanderlust
Wander Nauta
Ward De Ridder
WebCrusader
webdr
Wentao Tang
wilana
Wilfredo Ernesto Guerrero Campos
Wim Champagne
World Sucks
Xabi Ezpeleta
Xavi de Moner
XavierToo
XChesser
Xiaodong Xu
xyb
Yaron
Yasen Pramatarov
YesPoX
Yuren Ju
Yves MATHIEU
zekopeko
zhuqin
Zissan
Γιάννης Κατσαμπίρης
Артём Попов
Миша
Шаймарданов Максим
蔡查理

259
CHANGELOG.md Normal file
View File

@ -0,0 +1,259 @@
# Changelog
## 2.1.1 (2022-07-10)
### Core
- Fix missing trackers added via magnet
- Fix handling magnets with tracker tiers
## 2.1.0 (2022-06-28)
### Breaking changes
- Python 2 support removed (Python >= 3.6)
- libtorrent minimum requirement increased (>= 1.2).
### Core
- Add support for SVG tracker icons.
- Fix tracker icon error handling.
- Fix cleaning-up tracker icon temp files.
- Fix Plugin manager to handle new metadata 2.1.
- Hide passwords in config logs.
- Fix cleaning-up temp files in add_torrent_url.
- Fix KeyError in sessionproxy after torrent delete.
- Remove libtorrent deprecated functions.
- Fix file_completed_alert handling.
- Add plugin keys to get_torrents_status.
- Add support for pygeoip dependency.
- Fix crash logging to Windows protected folder.
- Add is_interface and is_interface_name to validate network interfaces.
- Fix is_url and is_infohash error with None value.
- Fix load_libintl error.
- Add support for IPv6 in host lists.
- Add systemd user services.
- Fix refresh and expire the torrent status cache.
- Fix crash when logging errors initializing gettext.
### Web UI
- Fix ETA column sorting in correct order (#3413).
- Fix defining foreground and background colors.
- Accept charset in content-type for json messages.
- Fix 'Complete Seen' and 'Completed' sorting.
- Fix encoding HTML entities for torrent attributes to prevent XSS.
### Gtk UI
- Fix download location textbox width.
- Fix obscured port number in Connection Manager.
- Increase connection manager default height.
- Fix bug with setting move completed in Options tab.
- Fix adding daemon accounts.
- Add workaround for crash on Windows with ico or gif icons.
- Hide account password length in log.
- Added a torrent menu option for magnet copy.
- Fix unable to prefetch magnet in thinclient mode.
- Use GtkSpinner when testing open port.
- Update About Dialog year.
- Fix Edit Torrents dialogs close issues.
- Fix ETA being copied to neighboring empty cells.
- Disable GTK CSD by default on Windows.
### Console UI
- Fix curses.init_pair raise ValueError on Py3.10.
- Swap j and k key's behavior to fit vim mode.
- Fix torrent details status error.
- Fix incorrect test for when a host is online.
- Add the torrent label to info command.
### AutoAdd
- Fix handling torrent decode errors.
- Fix error dialog not being shown on error.
### Blocklist
- Add frequency unit to interval label.
### Notifications
- Fix UnicodeEncodeError upon non-ascii torrent name.
## 2.0.5 (2021-12-15)
### WebUI
- Fix js minifying error resulting in WebUI blank screen.
- Silence erronous missing translations warning.
## 2.0.4 (2021-12-12)
### Packaging
- Fix python optional setup.py requirements
### Gtk UI
- Add detection of torrent URL on GTK UI focus
- Fix piecesbar crashing when enabled
- Remove num_blocks_cache_hits in stats
- Fix unhandled error with empty clipboard
- Add torrentdetails tabs position menu (#3441)
- Hide pygame community banner in console
- Fix cmp function for None types (#3309)
- Fix loading config with double-quotes in string
- Fix Status tab download speed and uploaded
### Web UI
- Handle torrent add failures
- Add menu option to copy magnet URI
- Fix md5sums in torrent files breaking file listing (#3388)
- Add country flag alt/title for accessibility
### Console UI
- Fix allowing use of windows-curses on Windows
- Fix hostlist status lookup errors
- Fix AttributeError setting config values
- Fix setting 'Skip' priority
### Core
- Add workaround libtorrent 2.0 file_progress error
- Fix allow enabling any plugin Python version
- Export torrent get_magnet_uri method
- Fix loading magnet with resume_data and no metadata (#3478)
- Fix httpdownloader reencoding torrent file downloads (#3440)
- Fix lt listen_interfaces not comma-separated (#3337)
- Fix unable to remove magnet with delete_copies enabled (#3325)
- Fix Python 3.8 compatibility
- Fix loading config with double-quotes in string
- Fix pickle loading non-ascii state error (#3298)
- Fix creation of pidfile via command option
- Fix for peer.client UnicodeDecodeError
- Fix show_file unhandled dbus error
### Documentation
- Add How-to guides about services.
### Stats plugin
- Fix constant session status key warnings
- Fix cairo error
### Notifications plugin
- Fix email KeyError with status name
- Fix unhandled TypeErrors on Python 3
### Autoadd plugin
- Fix magnet missing applied labels
### Execute plugin
- Fix failing to run on Windows (#3439)
## 2.0.3 (2019-06-12)
### Gtk UI
- Fix errors running on Wayland (#3265).
- Fix Peers Tab tooltip and context menu errors (#3266).
### Web UI
- Fix TypeError in Peers Tab setting country flag.
- Fix reverse proxy header TypeError (#3260).
- Fix request.base 'idna' codec error (#3261).
- Fix unable to change password (#3262).
### Extractor plugin
- Fix potential error starting plugin.
### Documentation
- Fix macOS install typo.
- Fix Windows install instructions.
## 2.0.2 (2019-06-08)
### Packaging
- Add systemd deluged and deluge-web service files to package tarball (#2034)
### Core
- Fix Python 2 compatibility issue with SimpleNamespace.
## 2.0.1 (2019-06-07)
### Packaging
- Fix `setup.py` build error without git installed.
## 2.0.0 (2019-06-06)
### Codebase
- Ported to Python 3
### Core
- Improved Logging
- Removed the AutoAdd feature on the core. It's now handled with the AutoAdd
plugin, which is also shipped with Deluge, and it does a better job and
now, it even supports multiple users perfectly.
- Authentication/Permission exceptions are now sent to clients and recreated
there to allow acting upon them.
- Updated SSL/TLS Protocol parameters for better security.
- Make the distinction between adding to the session new unmanaged torrents
and torrents loaded from state. This will break backwards compatibility.
- Pass a copy of an event instead of passing the event arguments to the
event handlers. This will break backwards compatibility.
- Allow changing ownership of torrents.
- File modifications on the auth file are now detected and when they happen,
the file is reloaded. Upon finding an old auth file with an old format, an
upgrade to the new format is made, file saved, and reloaded.
- Authentication no longer requires a username/password. If one or both of
these is missing, an authentication error will be sent to the client
which should then ask the username/password to the user.
- Implemented sequential downloads.
- Provide information about a torrent's pieces states
- Add Option To Specify Outgoing Connection Interface.
- Fix potential for host_id collision when creating hostlist entries.
### Gtk UI
- Ported to GTK3 (3rd-party plugins will need updated).
- Allow changing ownership of torrents.
- Host entries in the Connection Manager UI are now editable.
- Implemented sequential downloads UI handling.
- Add optional pieces bar instead of a regular progress bar in torrent status tab.
- Make torrent opening compatible with all Unicode paths.
- Fix magnet association button on Windows.
- Add keyboard shortcuts for changing queue position:
- Up: `Ctrl+Alt+Up`
- Down: `Ctrl+Alt+Down`
- Top: `Ctrl+Alt+Shift+Up`
- Bottom: `Ctrl+Alt+Shift+Down`
### Web UI
- Server (deluge-web) now daemonizes by default, use '-d' or '--do-not-daemonize' to disable.
- Fixed the '--base' option to work for regular use, not just with reverse proxies.
### Blocklist Plugin
- Implemented whitelist support to both core and GTK UI.
- Implemented IP filter cleaning before each update. Restarting the deluge
daemon is no longer needed.
- If "check_after_days" is 0(zero), the timer is not started anymore. It
would keep updating one call after the other. If the value changed, the
timer is now stopped and restarted using the new value.

117
ChangeLog
View File

@ -1,117 +0,0 @@
=== Deluge 1.3.0 (In Development) ===
==== Core ====
* Implement #1063 option to delete torrent file copy on torrent removal - patch from Ghent
* Implement #457 progress bars for folders
* Implement #1012 httpdownloader supports gzip decoding
* #496: Remove deprecated functions in favour of get_session_status()
* #1112: Fix renaming files in add torrent dialog
* #1247: Fix deluge-gtk from hanging on shutdown
* #995: Rewrote tracker_icons
==== Blocklist ====
* Implement local blocklist support
* #861: Pause transfers until blocklist is imported
==== Web ====
* Migrate to ExtJS 3.1
* Add gzip compression of HTTP data to the server
* Improve the efficiency of the TorrentGrid
=== Deluge 1.2.0 - "Bursting like an infected kidney" (10 January 2010) ===
==== Core ====
* Implement new RPC protocol DelugeRPC replacing XMLRPC
* Move to a twisted framework
* Add an 'Error' filter for Trackers to show trackers that currently have a tracker error
* Use system GeoIP database if available, this is now an optional dependency
==== GtkUI ====
* Remove SignalReceiver
* Implemented a cross-platform IPC method thus removing the DBUS dependency
* Implement a "True" Classic Mode where there is no longer a separate daemon process
* Add preferences option "Add torrent in paused state"
* Add tracker icons to the Tracker column
* Implement #259 show tooltip with country name in the peers tab
* Add an error category to the tracker sidebar list
* Add Find More Plugins button to Plugins preference page
* Fix #518 remove header in add torrent dialog to save vertical space
* Add a Cache preferences page to adjust cache settings and examine cache status
* Add ability to rename files prior to adding them
* Fix shutdown handler with GNOME session manager
* Allow 4 MiB piece sizes when creating a torrent
==== ConsoleUI ====
* Changed to use curses for a more interactive client
==== WebUI ====
* Move over to using Twisted-Web for the webserver.
* Move to only AJAX interface built upon Ext-JS.
==== Plugins ====
* Add Scheduler plugin
* Add Extractor plugin
==== Misc ====
* PyGTK dependency bumped to => 2.12 to use new tooltip system
* Add new scripts for invoking UIs: deluge-gtk, deluge-web, deluge-console
* Remove GeoIP database from the source tree
=== Deluge 1.1.0 - "Time gas!" (10 January 2009) ===
==== Core ====
* Implement #79 ability to change outgoing port range
* Implement #296 ability to change peer TOS byte
* Add per-torrent move on completed settings
* Implement #414 use async save_resume_data method
* Filter Manager with torrent filtering in get_torrents_status , for sidebar and plugins.
* Implement #368 add torrents by infohash/magnet uri (trackerless torrents)
* Remove remaining gtk functions in common
* Tracker icons.
* Add ETA for torrents with stop at seed ratio set
* Fix #47 the state and config files are no longer invalidated when there is no diskspace
* Fix #619 return "" instead of "Infinity" if seconds == 0 in ftime
* Add -P, --pidfile option to deluged
==== GtkUI ====
* Add peer progress to the peers tab
* Add ability to manually add peers
* Sorting # column will place downloaders above seeds
* Remove dependency on libtorrent for add torrent dialog
* Allow adding multiple trackers at once in the edit tracker dialog
* Implement #28 Create Torrent Dialog
* Redesiged sidebar with filters for Active and Tracker (see Filter Manager)
* Implement #428 the ability to rename files and directories
* Implement #229 add date added column
* Implement #596 show speeds in title
* Fix #636 not setting the daemon's config directory when using --config= with the UI in classic mode.
* Fix #624 do not allow changing file priorities when using compact allocation
* Fix #602 re-did files/peers tab state saving/loading
* Fix gtk warnings
* Add protocol traffic statusbar item
* Rework the Remove Torrent Dialog to only have 2 options, remove data and remove from session.
* Add "Install Plugin" and "Rescan Plugins" buttons to the Plugins preferences
* Make active port test use internal graphic instead of launching browser
==== WebUI ====
* Lots of smaller tweaks.
* All details tabs have the same features as in gtk-ui 1.0.x
* Persistent sessions #486
* Plugin improvements for easy use of templates and images in eggs. #497
* Classic template takes over some style elements from white template.
* https (for users that know how to create certificates)
* Easier apache mod_proxy use.
* Redesigned sidebar
==== AjaxUI ====
* Hosted in a webui template.
==== ConsoleUI ====
* New ConsoleUI written by Idoa01
* Callable from command-line for scripts.
==== Plugins ====
* Stats plugin for graphs.
* Label plugin for grouping torrents and per torrent settings.
==== Misc ====
* Implement #478 display UI options in usage help
* Fix #547 add description to name field per HIG entry 2.1.1.1
* Fix #531 set default log level to ERROR and add 2 command-line options, "-L, --loglevel" and "-q, --quiet".

30
DEPENDS
View File

@ -1,30 +0,0 @@
=== Core ===
* python >= 2.5
* twisted >= 8.1
* twisted-web >= 8.1
* pyopenssl
* simplejson (if python < 2.6)
* setuptools
* gettext
* pyxdg
* geoip-database (optional)
* libtorrent >= 0.14, or build the included version
* If building included libtorrent::
* boost >= 1.34.1
* openssl
* zlib
=== UIs ===
* chardet
=== Gtk ===
* python-notify (libnotify python wrapper)
* pygame
* pygtk >= 2.12
* librsvg
* xdg-utils
=== Web ===
* mako

100
DEPENDS.md Normal file
View File

@ -0,0 +1,100 @@
# Deluge dependencies
The following are required to install and run Deluge. They are separated into
sections to distinguish the precise requirements for each module.
All modules will require the [common](#common) section dependencies.
## Prerequisite
- [Python] _>= 3.6_
## Build
- [setuptools]
- [intltool] - Optional: Desktop file translation for \*nix.
- [closure-compiler] - Minify javascript (alternative is [rjsmin])
## Common
- [Twisted] _>= 17.1_ - Use `TLS` extras for `service_identity` and `idna`.
- [OpenSSL] _>= 1.0.1_
- [pyOpenSSL]
- [rencode] _>= 1.0.2_ - Encoding library.
- [PyXDG] - Access freedesktop.org standards for \*nix.
- [xdg-utils] - Provides xdg-open for \*nix.
- [zope.interface]
- [chardet] - Optional: Encoding detection.
- [setproctitle] - Optional: Renaming processes.
- [Pillow] - Optional: Support for resizing tracker icons.
- [dbus-python] - Optional: Show item location in filemanager.
- [ifaddr] - Optional: Verify network interfaces.
### Linux and BSD
- [distro] - Optional: OS platform information.
### Windows OS
- [pywin32]
- [certifi]
## Core (deluged daemon)
- [libtorrent] _>= 1.2.0_
- [GeoIP] or [pygeoip] - Optional: IP address country lookup. (_Debian: `python-geoip`_)
## GTK UI
- [GTK+] >= 3.10
- [PyGObject]
- [Pycairo]
- [librsvg] _>= 2_
- [libappindicator3] w/GIR - Optional: Ubuntu system tray icon.
### MacOS
- [GtkOSXApplication]
## Web UI
- [mako]
## Plugins
### Notifications
- [pygame] - Optional: Play sounds
- [libnotify] w/GIR - Optional: Desktop popups.
[python]: https://www.python.org/
[setuptools]: https://setuptools.readthedocs.io/en/latest/
[intltool]: https://freedesktop.org/wiki/Software/intltool/
[closure-compiler]: https://developers.google.com/closure/compiler/
[rjsmin]: https://pypi.org/project/rjsmin/
[openssl]: https://www.openssl.org/
[pyopenssl]: https://pyopenssl.org
[twisted]: https://twistedmatrix.com
[pillow]: https://pypi.org/project/Pillow/
[libtorrent]: https://libtorrent.org/
[zope.interface]: https://pypi.org/project/zope.interface/
[distro]: https://github.com/nir0s/distro
[pywin32]: https://github.com/mhammond/pywin32
[certifi]: https://pypi.org/project/certifi/
[dbus-python]: https://pypi.org/project/dbus-python/
[setproctitle]: https://pypi.org/project/setproctitle/
[gtkosxapplication]: https://github.com/jralls/gtk-mac-integration
[chardet]: https://chardet.github.io/
[rencode]: https://github.com/aresch/rencode
[pyxdg]: https://www.freedesktop.org/wiki/Software/pyxdg/
[xdg-utils]: https://www.freedesktop.org/wiki/Software/xdg-utils/
[gtk+]: https://www.gtk.org/
[pycairo]: https://cairographics.org/pycairo/
[pygobject]: https://pygobject.readthedocs.io/en/latest/
[geoip]: https://pypi.org/project/GeoIP/
[mako]: https://www.makotemplates.org/
[pygame]: https://www.pygame.org/
[libnotify]: https://developer.gnome.org/libnotify/
[python-appindicator]: https://packages.ubuntu.com/xenial/python-appindicator
[librsvg]: https://wiki.gnome.org/action/show/Projects/LibRsvg
[ifaddr]: https://pypi.org/project/ifaddr/

View File

@ -1,12 +1,36 @@
recursive-include docs/man *
recursive-include deluge *
recursive-include win32 *
include *.md
include AUTHORS
include LICENSE
include RELEASE-VERSION
include msgfmt.py
include minify_web_js.py
include version.py
include gen_web_gettext.py
recursive-exclude deluge *.egg-link
exclude deluge/ui/web/gen_gettext.py
exclude deluge/ui/web/css/*-debug.css
exclude deluge/ui/web/js/build.sh
exclude deluge/ui/web/js/Deluge*.js
exclude deluge/ui/web/js/*-debug.js
prune deluge/ui/web/docs
prune deluge/scripts
graft docs/man
graft packaging/systemd
include deluge/i18n/*.po
recursive-exclude deluge/i18n *.mo
graft deluge/plugins
recursive-exclude deluge/plugins create_dev_link.sh *.pyc *.egg
prune deluge/plugins/*/build
prune deluge/plugins/*/*.egg-info
graft deluge/tests/
recursive-exclude deluge/tests *.pyc
graft deluge/ui/data
recursive-exclude deluge/ui/data *.desktop *.xml
graft deluge/ui/gtk3/glade
include deluge/ui/web/index.html
include deluge/ui/web/css/*.css
include deluge/ui/web/js/*.js
graft deluge/ui/web/js/deluge-all/
graft deluge/ui/web/js/extjs/
graft deluge/ui/web/themes
graft deluge/ui/web/render
graft deluge/ui/web/icons
graft deluge/ui/web/images

94
README
View File

@ -1,94 +0,0 @@
==========================
Deluge BitTorrent Client
==========================
Homepage: http://deluge-torrent.org
Authors:
Andrew Resch
Damien Churchill
For past developers and contributers see: http://dev.deluge-torrent.org/wiki/About
==========================
License
==========================
Deluge is under the GNU GPLv3 license.
Icon data/pixmaps/deluge.svg and derivatives in data/icons are copyright
Andrew Wedderburn and are under the GNU GPLv3.
All other icons in data/pixmaps are copyright Andrew Resch and are under
the GNU GPLv3.
==========================
Contact/Support:
==========================
We have two options available for support:
Our Forum, at: http://forum.deluge-torrent.org
or
Our IRC Channel, at #deluge on Freenode: http://freenode.net
==========================
Installation Instructions:
==========================
For more detailed instructions see: http://dev.deluge-torrent.org/wiki/Installing/Source
See: DEPENDS for a full list of dependencies.
First, make sure you have the proper build dependencies installed. On a normal
Debian or Ubuntu system:
sudo apt-get install g++ make python-all-dev python-all python-dbus \
python-gtk2 python-notify librsvg2-common python-xdg python-support \
subversion libboost-dev libboost-python-dev \
libboost-thread-dev libboost-date-time-dev libboost-filesystem-dev \
libssl-dev zlib1g-dev python-setuptools \
python-mako python-twisted-web python-chardet python-simplejson
The names of the packages may vary depending on your OS / distro.
Once you have the needed libraries installed, build and install by running:
$ python setup.py build
$ sudo python setup.py install
==========================
FAQ
==========================
How to start the various user-interfaces
Gtk:
deluge-gtk
Console:
deluge-console
Web:
deluge-web
Go to http://localhost:8112/ default-password = "deluge"
Why is deluge still listed in my system tray even after I close it ?
You closed the gtk user-interface but you did not close the daemon. Choose "Quit & Shutdown Daemon" to close both Daemon and gtk-ui.
How do I start the daemon?
deluged
How do I start the daemon with logging to console?
deluged -d -L <log level>
I can't connect to the daemon from another machine
* Configure the daemon to allow remote connections
* Add a user to the auth file located in the config folder: ~/.config/deluge/auth
* Restart the daemon.
I upgraded from 0.5 and plugin x is missing
1.0 is a rewrite, all old 0.5 plugins have to be rewritten.
For the full FAQ see: http://dev.deluge-torrent.org/wiki/Faq

71
README.md Normal file
View File

@ -0,0 +1,71 @@
# Deluge BitTorrent Client
[![build-status]][github-ci] [![docs-status]][rtd-deluge]
Deluge is a BitTorrent client that utilizes a daemon/client model.
It has various user interfaces available such as the GTK-UI, Web-UI and
Console-UI. It uses [libtorrent][lt] at its core to handle the BitTorrent
protocol.
## Install
From [PyPi](https://pypi.org/project/deluge):
pip install deluge
with all optional dependencies:
pip install deluge[all]
From source code:
pip install .
with all optional dependencies:
pip install .[all]
See [DEPENDS](DEPENDS.md) and [Installing/Source] for dependency details.
## Usage
The various user-interfaces and Deluge daemon can be started with the following commands.
Use the `--help` option for further command options.
### Gtk UI
`deluge` or `deluge-gtk`
### Console UI
`deluge-console`
### Web UI
`deluge-web`
Open http://localhost:8112 with default password `deluge`.
### Daemon
`deluged`
See the [Thinclient guide] to connect to the daemon from another computer.
## Contact
- [Homepage](https://deluge-torrent.org)
- [User guide][user guide]
- [Forum](https://forum.deluge-torrent.org)
- [IRC Libera.Chat #deluge](irc://irc.libera.chat/deluge)
- [Discord](https://discord.gg/nwaHSE6tqn)
[user guide]: https://dev.deluge-torrent.org/wiki/UserGuide
[thinclient guide]: https://dev.deluge-torrent.org/wiki/UserGuide/ThinClient
[installing/source]: https://dev.deluge-torrent.org/wiki/Installing/Source
[build-status]: https://github.com/deluge-torrent/deluge/actions/workflows/ci.yml/badge.svg?branch=develop "CI"
[github-ci]: https://github.com/deluge-torrent/deluge/actions/workflows/ci.yml
[docs-status]: https://readthedocs.org/projects/deluge/badge/?version=latest
[rtd-deluge]: https://deluge.readthedocs.io/en/latest/?badge=latest "Documentation Status"
[lt]: https://libtorrent.org

View File

@ -1,23 +0,0 @@
import os
# Paths to exclude
EXCLUSIONS = [
"deluge/scripts"
]
POTFILE_IN = "deluge/i18n/POTFILES.in"
print "Creating " + POTFILE_IN + " .."
to_translate = []
for (dirpath, dirnames, filenames) in os.walk("deluge"):
for filename in filenames:
if os.path.splitext(filename)[1] in (".py", ".glade") and dirpath not in EXCLUSIONS:
to_translate.append(os.path.join(dirpath, filename))
f = open(POTFILE_IN, "wb")
for line in to_translate:
f.write(line + "\n")
f.close()
print "Done"

View File

@ -1,6 +0,0 @@
#!/bin/bash
for size in 16 22 24 32 36 48 64 72 96 128 192 256; do mkdir -p deluge/data/\
icons/hicolor/${size}x${size}/apps; rsvg-convert -w ${size} -h ${size} \
-o deluge/data/icons/hicolor/${size}x${size}/apps/deluge.png deluge/data/pixmaps\
/deluge.svg; mkdir -p deluge/data/icons/scalable/apps/; cp deluge/data/pixmaps/\
deluge.svg deluge/data/icons/scalable/apps/deluge.svg; done

View File

@ -1,20 +0,0 @@
from new import classobj
from deluge.core.core import Core
from deluge.core.daemon import Daemon
class RpcApi:
pass
def scan_for_methods(obj):
methods = {
'__doc__': 'Methods available in %s' % obj.__name__.lower()
}
for d in dir(obj):
if not hasattr(getattr(obj,d), '_rpcserver_export'):
continue
methods[d] = getattr(obj, d)
cobj = classobj(obj.__name__.lower(), (object,), methods)
setattr(RpcApi, obj.__name__.lower(), cobj)
scan_for_methods(Core)
scan_for_methods(Daemon)

View File

@ -1,60 +1,35 @@
#
# _libtorrent.py
#
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
"""
This module is used to handle the importing of libtorrent.
This module is used to handle the importing of libtorrent and also controls
the minimum versions of libtorrent that this version of Deluge supports.
We use this module to control what versions of libtorrent this version of Deluge
supports.
** Usage **
>>> from deluge._libtorrent import lt
Example:
>>> from deluge._libtorrent import lt
"""
REQUIRED_VERSION = "0.14.9.0"
def check_version(LT):
from deluge.common import VersionSplit
if VersionSplit(lt.version) < VersionSplit(REQUIRED_VERSION):
raise ImportError("This version of Deluge requires libtorrent >=%s!" % REQUIRED_VERSION)
from deluge.common import VersionSplit, get_version
from deluge.error import LibtorrentImportError
try:
import deluge.libtorrent as lt
check_version(lt)
except ImportError:
import libtorrent as lt
check_version(lt)
try:
import libtorrent as lt
except ImportError as ex:
raise LibtorrentImportError('No libtorrent library found: %s' % (ex))
REQUIRED_VERSION = '1.2.0.0'
LT_VERSION = lt.__version__
if VersionSplit(LT_VERSION) < VersionSplit(REQUIRED_VERSION):
raise LibtorrentImportError(
f'Deluge {get_version()} requires libtorrent >= {REQUIRED_VERSION}'
)

384
deluge/argparserbase.py Normal file
View File

@ -0,0 +1,384 @@
#
# Copyright (C) 2007 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import argparse
import logging
import os
import platform
import sys
import textwrap
import deluge.log
from deluge import common
from deluge.configmanager import get_config_dir, set_config_dir
def find_subcommand(self, args=None, sys_argv=True):
"""Find if a subcommand has been supplied.
Args:
args (list, optional): The argument list to search through.
sys_argv (bool): Use sys.argv[1:] if args is None.
Returns:
int: Index of the subcommand or '-1' if none found.
"""
subcommand_found = -1
if args is None:
args = sys.argv[1:] if sys_argv is None else []
for x in self._subparsers._actions:
if not isinstance(x, argparse._SubParsersAction):
continue
for sp_name in x._name_parser_map:
if sp_name in args:
subcommand_found = args.index(sp_name)
return subcommand_found
def set_default_subparser(self, name, abort_opts=None):
"""Sets the default argparse subparser.
Args:
name (str): The name of the default subparser.
abort_opts (list): The arguments to test for in case no subcommand is found.
If any of the values are found, the default subparser will
not be inserted into sys.argv.
Returns:
list: The arguments found in sys.argv if no subcommand found, else None
"""
found_abort_opts = []
abort_opts = [] if abort_opts is None else abort_opts
test_args = sys.argv[1:]
subparser_found = self.find_subcommand(args=test_args)
for i, arg in enumerate(test_args):
if subparser_found == i:
break
if arg in abort_opts:
found_abort_opts.append(arg)
if subparser_found == -1:
if found_abort_opts:
# Found one or more of arguments in abort_opts
return found_abort_opts
# insert default in first position, this implies no
# global options without a sub_parsers specified
sys.argv.insert(1, name)
return None
argparse.ArgumentParser.find_subcommand = find_subcommand
argparse.ArgumentParser.set_default_subparser = set_default_subparser
def _get_version_detail():
version_str = '%s\n' % (common.get_version())
try:
from deluge._libtorrent import LT_VERSION
version_str += 'libtorrent: %s\n' % LT_VERSION
except ImportError:
pass
version_str += 'Python: %s\n' % platform.python_version()
version_str += f'OS: {platform.system()} {common.get_os_version()}\n'
return version_str
class DelugeTextHelpFormatter(argparse.RawDescriptionHelpFormatter):
"""Help message formatter which retains formatting of all help text."""
def _split_lines(self, text, width):
"""
Do not remove whitespaces in string but still wrap text to max width.
Instead of passing the entire text to textwrap.wrap, split and pass each
line instead. This way list formatting is not mangled by textwrap.wrap.
"""
wrapped_lines = []
for line in text.splitlines():
wrapped_lines.extend(textwrap.wrap(line, width, subsequent_indent=' '))
return wrapped_lines
def _format_action_invocation(self, action):
"""
Combines the options with comma and displays the argument
value only once instead of after both options.
Instead of: -s <arg>, --long-opt <arg>
Show : -s, --long-opt <arg>
"""
if not action.option_strings:
(metavar,) = self._metavar_formatter(action, action.dest)(1)
return metavar
else:
parts = []
# if the Optional doesn't take a value, format is:
# -s, --long
if action.nargs == 0:
parts.extend(action.option_strings)
# if the Optional takes a value, format is:
# -s, --long ARGS
else:
default = action.dest.upper()
args_string = self._format_args(action, default)
opt = ', '.join(action.option_strings)
parts.append(f'{opt} {args_string}')
return ', '.join(parts)
class HelpAction(argparse._HelpAction):
def __call__(self, parser, namespace, values, option_string=None):
if hasattr(parser, 'subparser'):
subparser = getattr(parser, 'subparser')
subparser.print_help()
else:
parser.print_help()
parser.exit()
class ArgParserBase(argparse.ArgumentParser):
def __init__(self, *args, **kwargs):
if 'formatter_class' not in kwargs:
kwargs['formatter_class'] = lambda prog: DelugeTextHelpFormatter(
prog, max_help_position=33, width=90
)
kwargs['add_help'] = kwargs.get('add_help', False)
common_help = kwargs.pop('common_help', True)
self.log_stream = sys.stdout
if 'log_stream' in kwargs:
self.log_stream = kwargs['log_stream']
del kwargs['log_stream']
super().__init__(*args, **kwargs)
self.common_setup = False
self.process_arg_group = False
self.group = self.add_argument_group(_('Common Options'))
if common_help:
self.group.add_argument(
'-h', '--help', action=HelpAction, help=_('Print this help message')
)
self.group.add_argument(
'-V',
'--version',
action='version',
version='%(prog)s ' + _get_version_detail(),
help=_('Print version information'),
)
self.group.add_argument(
'-v',
action='version',
version='%(prog)s ' + _get_version_detail(),
help=argparse.SUPPRESS,
) # Deprecated arg
self.group.add_argument(
'-c',
'--config',
metavar='<config>',
help=_('Set the config directory path'),
)
self.group.add_argument(
'-l',
'--logfile',
metavar='<logfile>',
help=_('Output to specified logfile instead of stdout'),
)
self.group.add_argument(
'-L',
'--loglevel',
choices=[level for k in deluge.log.levels for level in (k, k.upper())],
help=_('Set the log level (none, error, warning, info, debug)'),
metavar='<level>',
)
self.group.add_argument(
'--logrotate',
nargs='?',
const='2M',
metavar='<max-size>',
help=_(
'Enable logfile rotation, with optional maximum logfile size, '
'default: %(const)s (Logfile rotation count is 5)'
),
)
self.group.add_argument(
'-q',
'--quiet',
action='store_true',
help=_('Quieten logging output (Same as `--loglevel none`)'),
)
self.group.add_argument(
'--profile',
metavar='<profile-file>',
nargs='?',
default=False,
help=_(
'Profile %(prog)s with cProfile. Outputs to stdout '
'unless a filename is specified'
),
)
def parse_args(self, args=None):
"""Parse UI arguments and handle common and process group options.
Notes:
Unknown arguments results in usage text printed and system exit.
Args:
args (list, optional): The arguments to parse.
Returns:
argparse.Namespace: The parsed arguments.
"""
options = super().parse_args(args=args)
return self._handle_ui_options(options)
def parse_known_ui_args(self, args, withhold=None):
"""Parse UI arguments and handle common and process group options without error.
Args:
args (list): The arguments to parse.
withhold (list): Values to ignore in the args list.
Returns:
argparse.Namespace: The parsed arguments.
"""
if withhold:
args = [a for a in args if a not in withhold]
options, remaining = super().parse_known_args(args=args)
options.remaining = remaining
# Handle common and process group options
return self._handle_ui_options(options)
def _handle_ui_options(self, options):
"""Handle UI common and process group options.
Args:
options (argparse.Namespace): The parsed options.
Returns:
argparse.Namespace: The parsed options.
"""
if not self.common_setup:
self.common_setup = True
# Setup the logger
if options.quiet:
options.loglevel = 'none'
if options.loglevel:
options.loglevel = options.loglevel.lower()
logfile_mode = 'w'
logrotate = options.logrotate
if options.logrotate:
logfile_mode = 'a'
logrotate = common.parse_human_size(options.logrotate)
# Setup the logger
deluge.log.setup_logger(
level=options.loglevel,
filename=options.logfile,
filemode=logfile_mode,
logrotate=logrotate,
output_stream=self.log_stream,
)
if options.config:
if not set_config_dir(options.config):
log = logging.getLogger(__name__)
log.error('There was an error setting the config dir! Exiting..')
sys.exit(1)
else:
if not os.path.exists(common.get_default_config_dir()):
os.makedirs(common.get_default_config_dir())
if self.process_arg_group:
self.process_arg_group = False
# If donotdaemonize is set, skip process forking.
if not (common.windows_check() or options.donotdaemonize):
if os.fork():
os._exit(0)
os.setsid()
# Do second fork
if os.fork():
os._exit(0)
# Ensure process doesn't keep any directory in use that may prevent a filesystem unmount.
os.chdir(get_config_dir())
# Write pid file before chuid
if options.pidfile:
with open(options.pidfile, 'w') as _file:
_file.write('%d\n' % os.getpid())
if not common.windows_check():
if options.group:
if not options.group.isdigit():
import grp
options.group = grp.getgrnam(options.group)[2]
os.setgid(options.group)
if options.user:
if not options.user.isdigit():
import pwd
options.user = pwd.getpwnam(options.user)[2]
os.setuid(options.user)
return options
def add_process_arg_group(self):
"""Adds a grouping of common process args to control a daemon to the parser"""
self.process_arg_group = True
self.group = self.add_argument_group(_('Process Control Options'))
self.group.add_argument(
'-P',
'--pidfile',
metavar='<pidfile>',
action='store',
help=_('Pidfile to store the process id'),
)
if not common.windows_check():
self.group.add_argument(
'-d',
'--do-not-daemonize',
dest='donotdaemonize',
action='store_true',
help=_('Do not daemonize (fork) this process'),
)
self.group.add_argument(
'-f',
'--fork',
dest='donotdaemonize',
action='store_false',
help=argparse.SUPPRESS,
) # Deprecated arg
self.group.add_argument(
'-U',
'--user',
metavar='<user>',
action='store',
help=_('Change to this user on startup (Requires root)'),
)
self.group.add_argument(
'-g',
'--group',
metavar='<group>',
action='store',
help=_('Change to this group on startup (Requires root)'),
)

View File

@ -9,121 +9,140 @@
# License.
# Written by Petru Paler
# Updated by Calum Lind to support Python 3.
class BTFailure(Exception):
pass
DICT_DELIM = b'd'
END_DELIM = b'e'
INT_DELIM = b'i'
LIST_DELIM = b'l'
BYTE_SEP = b':'
# Minor modifications made by Andrew Resch to replace the BTFailure errors with Exceptions
def decode_int(x, f):
f += 1
newf = x.index('e', f)
newf = x.index(END_DELIM, f)
n = int(x[f:newf])
if x[f] == '-':
if x[f + 1] == '0':
raise ValueError
elif x[f] == '0' and newf != f+1:
if x[f : f + 1] == b'-' and x[f + 1 : f + 2] == b'0':
raise ValueError
return (n, newf+1)
elif x[f : f + 1] == b'0' and newf != f + 1:
raise ValueError
return (n, newf + 1)
def decode_string(x, f):
colon = x.index(':', f)
colon = x.index(BYTE_SEP, f)
n = int(x[f:colon])
if x[f] == '0' and colon != f+1:
if x[f : f + 1] == b'0' and colon != f + 1:
raise ValueError
colon += 1
return (x[colon:colon+n], colon+n)
return (x[colon : colon + n], colon + n)
def decode_list(x, f):
r, f = [], f+1
while x[f] != 'e':
v, f = decode_func[x[f]](x, f)
r, f = [], f + 1
while x[f : f + 1] != END_DELIM:
v, f = decode_func[x[f : f + 1]](x, f)
r.append(v)
return (r, f + 1)
def decode_dict(x, f):
r, f = {}, f+1
while x[f] != 'e':
r, f = {}, f + 1
while x[f : f + 1] != END_DELIM:
k, f = decode_string(x, f)
r[k], f = decode_func[x[f]](x, f)
r[k], f = decode_func[x[f : f + 1]](x, f)
return (r, f + 1)
decode_func = {}
decode_func['l'] = decode_list
decode_func['d'] = decode_dict
decode_func['i'] = decode_int
decode_func['0'] = decode_string
decode_func['1'] = decode_string
decode_func['2'] = decode_string
decode_func['3'] = decode_string
decode_func['4'] = decode_string
decode_func['5'] = decode_string
decode_func['6'] = decode_string
decode_func['7'] = decode_string
decode_func['8'] = decode_string
decode_func['9'] = decode_string
decode_func[LIST_DELIM] = decode_list
decode_func[DICT_DELIM] = decode_dict
decode_func[INT_DELIM] = decode_int
decode_func[b'0'] = decode_string
decode_func[b'1'] = decode_string
decode_func[b'2'] = decode_string
decode_func[b'3'] = decode_string
decode_func[b'4'] = decode_string
decode_func[b'5'] = decode_string
decode_func[b'6'] = decode_string
decode_func[b'7'] = decode_string
decode_func[b'8'] = decode_string
decode_func[b'9'] = decode_string
def bdecode(x):
try:
r, l = decode_func[x[0]](x, 0)
except (IndexError, KeyError, ValueError):
raise Exception("not a valid bencoded string")
return r
from types import StringType, IntType, LongType, DictType, ListType, TupleType
r, __ = decode_func[x[0:1]](x, 0)
except (LookupError, TypeError, ValueError):
raise BTFailure('Not a valid bencoded string')
else:
return r
class Bencached(object):
class Bencached:
__slots__ = ['bencoded']
def __init__(self, s):
self.bencoded = s
def encode_bencached(x,r):
def encode_bencached(x, r):
r.append(x.bencoded)
def encode_int(x, r):
r.extend(('i', str(x), 'e'))
r.extend((INT_DELIM, str(x).encode('utf8'), END_DELIM))
def encode_bool(x, r):
if x:
encode_int(1, r)
else:
encode_int(0, r)
encode_int(1 if x else 0, r)
def encode_string(x, r):
r.extend((str(len(x)), ':', x))
encode_bytes(x.encode('utf8'), r)
def encode_bytes(x, r):
r.extend((str(len(x)).encode('utf8'), BYTE_SEP, x))
def encode_list(x, r):
r.append('l')
r.append(LIST_DELIM)
for i in x:
encode_func[type(i)](i, r)
r.append('e')
r.append(END_DELIM)
def encode_dict(x,r):
r.append('d')
ilist = x.items()
ilist.sort()
for k, v in ilist:
r.extend((str(len(k)), ':', k))
def encode_dict(x, r):
r.append(DICT_DELIM)
for k, v in sorted(x.items()):
try:
k = k.encode('utf8')
except AttributeError:
pass
r.extend((str(len(k)).encode('utf8'), BYTE_SEP, k))
encode_func[type(v)](v, r)
r.append('e')
r.append(END_DELIM)
encode_func = {}
encode_func[Bencached] = encode_bencached
encode_func[IntType] = encode_int
encode_func[LongType] = encode_int
encode_func[StringType] = encode_string
encode_func[ListType] = encode_list
encode_func[TupleType] = encode_list
encode_func[DictType] = encode_dict
encode_func[int] = encode_int
encode_func[list] = encode_list
encode_func[tuple] = encode_list
encode_func[dict] = encode_dict
encode_func[bool] = encode_bool
encode_func[str] = encode_string
encode_func[bytes] = encode_bytes
try:
from types import BooleanType
encode_func[BooleanType] = encode_bool
except ImportError:
pass
def bencode(x):
r = []
encode_func[type(x)](x, r)
return ''.join(r)
return b''.join(r)

File diff suppressed because it is too large Load Diff

View File

@ -1,48 +1,49 @@
#
# component.py
#
# Copyright (C) 2007-2010 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
from twisted.internet.defer import maybeDeferred, succeed, DeferredList, fail
from twisted.internet.task import LoopingCall
from deluge.log import LOG as log
import logging
import traceback
from collections import defaultdict
from twisted.internet import reactor
from twisted.internet.defer import DeferredList, fail, maybeDeferred, succeed
from twisted.internet.task import LoopingCall, deferLater
log = logging.getLogger(__name__)
class ComponentAlreadyRegistered(Exception):
pass
class Component(object):
"""
Component objects are singletons managed by the :class:`ComponentRegistry`.
class ComponentException(Exception):
def __init__(self, message, tb):
super().__init__(message)
self.message = message
self.tb = tb
def __str__(self):
s = super().__str__()
return '{}\n{}'.format(s, ''.join(self.tb))
def __eq__(self, other):
if isinstance(other, self.__class__):
return self.message == other.message
else:
return False
def __ne__(self, other):
return not self.__eq__(other)
class Component:
"""Component objects are singletons managed by the :class:`ComponentRegistry`.
When a new Component object is instantiated, it will be automatically
registered with the :class:`ComponentRegistry`.
@ -86,105 +87,142 @@ class Component(object):
still be considered in a Started state.
"""
def __init__(self, name, interval=1, depend=None):
"""Initialize component.
Args:
name (str): Name of component.
interval (int, optional): The interval in seconds to call the update function.
depend (list, optional): The names of components this component depends on.
"""
self._component_name = name
self._component_interval = interval
self._component_depend = depend
self._component_state = "Stopped"
self._component_state = 'Stopped'
self._component_timer = None
self._component_starting_deferred = None
self._component_stopping_deferred = None
_ComponentRegistry.register(self)
def __del__(self):
if _ComponentRegistry:
_ComponentRegistry.deregister(self)
def _component_start_timer(self):
if hasattr(self, "update"):
if hasattr(self, 'update'):
self._component_timer = LoopingCall(self.update)
self._component_timer.start(self._component_interval)
def _component_start(self):
def on_start(result):
self._component_state = "Started"
self._component_state = 'Started'
self._component_starting_deferred = None
self._component_start_timer()
return True
def on_start_fail(result):
self._component_state = "Stopped"
self._component_state = 'Stopped'
self._component_starting_deferred = None
log.error(result)
return result
return fail(result)
if self._component_state == "Stopped":
if hasattr(self, "start"):
self._component_state = "Starting"
d = maybeDeferred(self.start)
d.addCallback(on_start)
d.addErrback(on_start_fail)
if self._component_state == 'Stopped':
if hasattr(self, 'start'):
self._component_state = 'Starting'
d = deferLater(reactor, 0, self.start)
d.addCallbacks(on_start, on_start_fail)
self._component_starting_deferred = d
else:
d = maybeDeferred(on_start, None)
elif self._component_state == "Starting":
elif self._component_state == 'Starting':
return self._component_starting_deferred
elif self._component_state == "Started":
elif self._component_state == 'Started':
d = succeed(True)
else:
d = fail("Cannot start a component not in a Stopped state!")
d = fail(
ComponentException(
'Trying to start component "%s" but it is '
'not in a stopped state. Current state: %s'
% (self._component_name, self._component_state),
traceback.format_stack(limit=4),
)
)
return d
def _component_stop(self):
def on_stop(result):
self._component_state = "Stopped"
self._component_state = 'Stopped'
if self._component_timer and self._component_timer.running:
self._component_timer.stop()
return True
if self._component_state != "Stopped" and self._component_state != "Stopping":
if hasattr(self, "stop"):
self._component_state = "Stopping"
def on_stop_fail(result):
self._component_state = 'Started'
self._component_stopping_deferred = None
log.error(result)
return result
if self._component_state != 'Stopped' and self._component_state != 'Stopping':
if hasattr(self, 'stop'):
self._component_state = 'Stopping'
d = maybeDeferred(self.stop)
d.addCallback(on_stop)
d.addErrback(on_stop_fail)
self._component_stopping_deferred = d
else:
d = maybeDeferred(on_stop, None)
if self._component_state == "Stopping":
if self._component_state == 'Stopping':
return self._component_stopping_deferred
return succeed(None)
def _component_pause(self):
def on_pause(result):
self._component_state = "Paused"
self._component_state = 'Paused'
if self._component_state == "Started":
if self._component_state == 'Started':
if self._component_timer and self._component_timer.running:
d = maybeDeferred(self._component_timer.stop)
d.addCallback(on_pause)
else:
d = succeed(None)
elif self._component_state == "Paused":
elif self._component_state == 'Paused':
d = succeed(None)
else:
d = fail("Cannot pause a component in a non-Started state!")
d = fail(
ComponentException(
'Trying to pause component "%s" but it is '
'not in a started state. Current state: %s'
% (self._component_name, self._component_state),
traceback.format_stack(limit=4),
)
)
return d
def _component_resume(self):
def on_resume(result):
self._component_state = "Started"
self._component_state = 'Started'
if self._component_state == "Paused":
if self._component_state == 'Paused':
d = maybeDeferred(self._component_start_timer)
d.addCallback(on_resume)
else:
d = fail("Component cannot be resumed from a non-Paused state!")
d = fail(
ComponentException(
'Trying to resume component "%s" but it is '
'not in a paused state. Current state: %s'
% (self._component_name, self._component_state),
traceback.format_stack(limit=4),
)
)
return d
def _component_shutdown(self):
def on_stop(result):
if hasattr(self, "shutdown"):
if hasattr(self, 'shutdown'):
return maybeDeferred(self.shutdown)
return succeed(None)
@ -192,69 +230,97 @@ class Component(object):
d.addCallback(on_stop)
return d
class ComponentRegistry(object):
"""
The ComponentRegistry holds a list of currently registered
:class:`Component` objects. It is used to manage the Components by
starting, stopping, pausing and shutting them down.
def get_state(self):
return self._component_state
def start(self):
pass
def stop(self):
pass
def update(self):
pass
def shutdown(self):
pass
class ComponentRegistry:
"""The ComponentRegistry holds a list of currently registered :class:`Component` objects.
It is used to manage the Components by starting, stopping, pausing and shutting them down.
"""
def __init__(self):
self.components = {}
# Stores all of the components that are dependent on a particular component
self.dependents = defaultdict(list)
def register(self, obj):
"""
Registers a component object with the registry. This is done
automatically when a Component object is instantiated.
"""Register a component object with the registry.
:param obj: the Component object
:type obj: object
Note:
This is done automatically when a Component object is instantiated.
:raises ComponentAlreadyRegistered: if a component with the same name is already registered.
Args:
obj (Component): A component object to register.
Raises:
ComponentAlreadyRegistered: If a component with the same name is already registered.
"""
name = obj._component_name
if name in self.components:
raise ComponentAlreadyRegistered(
"Component already registered with name %s" % name)
'Component already registered with name %s' % name
)
self.components[obj._component_name] = obj
if obj._component_depend:
for depend in obj._component_depend:
self.dependents[depend].append(name)
def deregister(self, name):
"""
Deregisters a component from the registry. A stop will be
def deregister(self, obj):
"""Deregister a component from the registry. A stop will be
issued to the component prior to deregistering it.
:param name: the name of the component
:type name: string
Args:
obj (Component): a component object to deregister
Returns:
Deferred: a deferred object that will fire once the Component has been
successfully deregistered
"""
if obj in self.components.values():
log.debug('Deregistering Component: %s', obj._component_name)
d = self.stop([obj._component_name])
if name in self.components:
log.debug("Deregistering Component: %s", name)
d = self.stop([name])
def on_stop(result, name):
del self.components[name]
return d.addCallback(on_stop, name)
# Component may have been removed, so pop to ensure it doesn't fail
self.components.pop(name, None)
return d.addCallback(on_stop, obj._component_name)
else:
return succeed(None)
def start(self, names=[]):
"""
Starts Components that are currently in a Stopped state and their
dependencies. If *names* is specified, will only start those
Components and their dependencies and if not it will start all
registered components.
def start(self, names=None):
"""Start Components, and their dependencies, that are currently in a Stopped state.
:param names: a list of Components to start
:type names: list
Note:
If no names are specified then all registered components will be started.
:returns: a Deferred object that will fire once all Components have been sucessfully started
:rtype: twisted.internet.defer.Deferred
Args:
names (list): A list of Components to start and their dependencies.
Returns:
Deferred: Fired once all Components have been successfully started.
"""
# Start all the components if names is empty
if not names:
names = self.components.keys()
names = list(self.components)
elif isinstance(names, str):
names = [names]
@ -274,109 +340,124 @@ class ComponentRegistry(object):
return DeferredList(deferreds)
def stop(self, names=[]):
"""
Stops Components that are currently not in a Stopped state. If
*names* is specified, then it will only stop those Components,
and if not it will stop all the registered Components.
def stop(self, names=None):
"""Stop Components that are currently not in a Stopped state.
:param names: a list of Components to start
:type names: list
Note:
If no names are specified then all registered components will be stopped.
:returns: a Deferred object that will fire once all Components have been sucessfully stopped
:rtype: twisted.internet.defer.Deferred
Args:
names (list): A list of Components to stop.
Returns:
Deferred: Fired once all Components have been successfully stopped.
"""
if not names:
names = self.components.keys()
names = list(self.components)
elif isinstance(names, str):
names = [names]
def on_dependents_stopped(result, name):
return self.components[name]._component_stop()
stopped_in_deferred = set()
deferreds = []
for name in names:
if name in stopped_in_deferred:
continue
if name in self.components:
deferreds.append(self.components[name]._component_stop())
if name in self.dependents:
# If other components depend on this component, stop them first
d = self.stop(self.dependents[name]).addCallback(
on_dependents_stopped, name
)
deferreds.append(d)
stopped_in_deferred.update(self.dependents[name])
else:
deferreds.append(self.components[name]._component_stop())
return DeferredList(deferreds)
def pause(self, names=[]):
"""
Pauses Components that are currently in a Started state. If
*names* is specified, then it will only pause those Components,
and if not it will pause all the registered Components.
def pause(self, names=None):
"""Pause Components that are currently in a Started state.
:param names: a list of Components to pause
:type names: list
Note:
If no names are specified then all registered components will be paused.
:returns: a Deferred object that will fire once all Components have been sucessfully paused
:rtype: twisted.internet.defer.Deferred
Args:
names (list): A list of Components to pause.
Returns:
Deferred: Fired once all Components have been successfully paused.
"""
if not names:
names = self.components.keys()
names = list(self.components)
elif isinstance(names, str):
names = [names]
deferreds = []
for name in names:
if self.components[name]._component_state == "Started":
if self.components[name]._component_state == 'Started':
deferreds.append(self.components[name]._component_pause())
return DeferredList(deferreds)
def resume(self, names=[]):
"""
Resumes Components that are currently in a Paused state. If
*names* is specified, then it will only resume those Components,
and if not it will resume all the registered Components.
def resume(self, names=None):
"""Resume Components that are currently in a Paused state.
:param names: a list of Components to resume
:type names: list
Note:
If no names are specified then all registered components will be resumed.
:returns: a Deferred object that will fire once all Components have been sucessfully resumed
:rtype: twisted.internet.defer.Deferred
Args:
names (list): A list of Components to to resume.
Returns:
Deferred: Fired once all Components have been successfully resumed.
"""
if not names:
names = self.components.keys()
names = list(self.components)
elif isinstance(names, str):
names = [names]
deferreds = []
for name in names:
if self.components[name]._component_state == "Paused":
if self.components[name]._component_state == 'Paused':
deferreds.append(self.components[name]._component_resume())
return DeferredList(deferreds)
def shutdown(self):
"""
Shutdowns all Components regardless of state. This will call
:meth:`stop` on call the components prior to shutting down. This should
be called when the program is exiting to ensure all Components have a
chance to properly shutdown.
"""Shutdown all Components regardless of state.
:returns: a Deferred object that will fire once all Components have been sucessfully resumed
:rtype: twisted.internet.defer.Deferred
This will call stop() on all the components prior to shutting down. This should be called
when the program is exiting to ensure all Components have a chance to properly shutdown.
Returns:
Deferred: Fired once all Components have been successfully shut down.
"""
deferreds = []
for component in self.components.values():
deferreds.append(component._component_shutdown())
def on_stopped(result):
return DeferredList(
[comp._component_shutdown() for comp in list(self.components.values())]
)
return DeferredList(deferreds)
return self.stop(list(self.components)).addCallback(on_stopped)
def update(self):
"""
Updates all Components that are in a Started state.
"""
"""Update all Components that are in a Started state."""
for component in self.components.items():
component.update()
try:
component.update()
except BaseException as ex:
log.exception(ex)
_ComponentRegistry = ComponentRegistry()
@ -388,17 +469,18 @@ resume = _ComponentRegistry.resume
update = _ComponentRegistry.update
shutdown = _ComponentRegistry.shutdown
def get(name):
"""
Return a reference to a component.
"""Return a reference to a component.
:param name: the Component name to get
:type name: string
Args:
name (str): The Component name to get.
:returns: the Component object
:rtype: object
Returns:
Component: The Component object.
:raises KeyError: if the Component does not exist
Raises:
KeyError: If the Component does not exist.
"""
return _ComponentRegistry.components[name]

View File

@ -1,38 +1,10 @@
#
# config.py
#
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#
#
"""
Deluge Config Module
@ -45,9 +17,9 @@ The format of the config file is two json encoded dicts:
<version dict>
<content dict>
The version dict contains two keys: file and format. The format version is
controlled by the Config class. It should only be changed when anything below
it is changed directly by the Config class. An example of this would be if we
The version dict contains two keys: file and format. The format version is
controlled by the Config class. It should only be changed when anything below
it is changed directly by the Config class. An example of this would be if we
changed the serializer for the content to something different.
The config file version is changed by the 'owner' of the config file. This is
@ -66,228 +38,312 @@ this can only be done for the 'config file version' and not for the 'format'
version as this will be done internally.
"""
import cPickle as pickle
import shutil
import json
import logging
import os
import pickle
import shutil
from codecs import getwriter
from tempfile import NamedTemporaryFile
import deluge.common
from deluge.log import LOG as log
from deluge.common import JSON_FORMAT, get_default_config_dir
json = deluge.common.json
log = logging.getLogger(__name__)
def prop(func):
"""Function decorator for defining property attributes
The decorated function is expected to return a dictionary
containing one or more of the following pairs:
fget - function for getting attribute value
fset - function for setting attribute value
fdel - function for deleting attribute
This can be conveniently constructed by the locals() builtin
function; see:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/205183
"""
return property(doc=func.__doc__, **func())
def find_json_objects(text, decoder=json.JSONDecoder()):
"""Find json objects in text.
Args:
text (str): The text to find json objects within.
Returns:
list: A list of tuples containing start and end locations of json
objects in the text. e.g. [(start, end), ...]
def find_json_objects(s):
"""
Find json objects in a string.
:param s: the string to find json objects in
:type s: string
:returns: a list of tuples containing start and end locations of json objects in the string `s`
:rtype: [(start, end), ...]
"""
objects = []
opens = 0
start = s.find("{")
offset = start
offset = 0
while True:
try:
start = text.index('{', offset)
except ValueError:
break
if start < 0:
return []
for index, c in enumerate(s[offset:]):
if c == "{":
opens += 1
elif c == "}":
opens -= 1
if opens == 0:
objects.append((start, index+offset+1))
start = index + offset + 1
try:
__, index = decoder.raw_decode(text[start:])
except json.decoder.JSONDecodeError:
offset = start + 1
else:
offset = start + index
objects.append((start, offset))
return objects
class Config(object):
"""
This class is used to access/create/modify config files
:param filename: the name of the config file
:param defaults: dictionary of default values
:param config_dir: the path to the config directory
def cast_to_existing_type(value, old_value):
"""Attempt to convert new value type to match old value type"""
types_match = isinstance(old_value, (type(None), type(value)))
if value is not None and not types_match:
old_type = type(old_value)
# Skip convert to bytes since requires knowledge of encoding and value should
# be unicode anyway.
if old_type is bytes:
return value
return old_type(value)
return value
class Config:
"""This class is used to access/create/modify config files.
Args:
filename (str): The config filename.
defaults (dict): The default config values to insert before loading the config file.
config_dir (str): the path to the config directory.
file_version (int): The file format for the default config values when creating
a fresh config. This value should be increased whenever a new migration function is
setup to convert old config files. (default: 1)
log_mask_funcs (dict): A dict of key:function, used to mask sensitive
key values (e.g. passwords) when logging is enabled.
"""
def __init__(self, filename, defaults=None, config_dir=None):
def __init__(
self,
filename,
defaults=None,
config_dir=None,
file_version=1,
log_mask_funcs=None,
):
self.__config = {}
self.__set_functions = {}
self.__change_callbacks = []
self.__log_mask_funcs = log_mask_funcs if log_mask_funcs else {}
# These hold the version numbers and they will be set when loaded
self.__version = {
"format": 1,
"file": 1
}
self.__version = {'format': 1, 'file': file_version}
# This will get set with a reactor.callLater whenever a config option
# is set.
self._save_timer = None
if defaults:
self.__config = dict(defaults)
for key, value in defaults.items():
self.set_item(key, value, default=True)
# Load the config from file in the config_dir
if config_dir:
self.__config_file = os.path.join(config_dir, filename)
else:
self.__config_file = deluge.common.get_default_config_dir(filename)
self.__config_file = get_default_config_dir(filename)
self.load()
def callLater(self, period, func, *args, **kwargs): # noqa: N802 ignore camelCase
"""Wrapper around reactor.callLater for test purpose."""
from twisted.internet import reactor
return reactor.callLater(period, func, *args, **kwargs)
def __contains__(self, item):
return item in self.__config
def __setitem__(self, key, value):
"""
See
:meth:`set_item`
"""
"""See set_item"""
return self.set_item(key, value)
def set_item(self, key, value):
"""
Sets item 'key' to 'value' in the config dictionary, but does not allow
changing the item's type unless it is None. If the types do not match,
it will attempt to convert it to the set type before raising a ValueError.
def set_item(self, key, value, default=False):
"""Sets item 'key' to 'value' in the config dictionary.
:param key: string, item to change to change
:param value: the value to change item to, must be same type as what is currently in the config
Does not allow changing the item's type unless it is None.
:raises ValueError: raised when the type of value is not the same as\
what is currently in the config and it could not convert the value
If the types do not match, it will attempt to convert it to the
set type before raising a ValueError.
**Usage**
Args:
key (str): Item to change to change.
value (any): The value to change item to, must be same type as what is
currently in the config.
default (optional, bool): When setting a default value skip func or save
callbacks.
>>> config = Config("test.conf")
>>> config["test"] = 5
>>> config["test"]
5
Raises:
ValueError: Raised when the type of value is not the same as what is
currently in the config and it could not convert the value.
Examples:
>>> config = Config('test.conf')
>>> config['test'] = 5
>>> config['test']
5
"""
if not self.__config.has_key(key):
self.__config[key] = value
log.debug("Setting '%s' to %s of %s", key, value, type(value))
return
if isinstance(value, bytes):
value = value.decode()
if self.__config[key] == value:
return
# Do not allow the type to change unless it is None
oldtype, newtype = type(self.__config[key]), type(value)
if value is not None and oldtype != type(None) and oldtype != newtype:
if key in self.__config:
try:
value = oldtype(value)
value = cast_to_existing_type(value, self.__config[key])
except ValueError:
log.warning("Type '%s' invalid for '%s'", newtype, key)
log.warning('Value Type "%s" invalid for key: %s', type(value), key)
raise
else:
if self.__config[key] == value:
return
log.debug("Setting '%s' to %s of %s", key, value, type(value))
if log.isEnabledFor(logging.DEBUG):
if key in self.__log_mask_funcs:
value = self.__log_mask_funcs[key](value)
log.debug(
'Setting key "%s" to: %s (of type: %s)',
key,
value,
type(value),
)
self.__config[key] = value
# Skip save or func callbacks if setting default value for keys
if default:
return
# Run the set_function for this key if any
from twisted.internet import reactor
try:
for func in self.__set_functions[key]:
reactor.callLater(0, func, key, value)
except KeyError:
pass
for func in self.__set_functions.get(key, []):
self.callLater(0, func, key, value)
try:
def do_change_callbacks(key, value):
for func in self.__change_callbacks:
func(key, value)
reactor.callLater(0, do_change_callbacks, key, value)
except:
self.callLater(0, do_change_callbacks, key, value)
except Exception:
pass
# We set the save_timer for 5 seconds if not already set
if not self._save_timer or not self._save_timer.active():
self._save_timer = reactor.callLater(5, self.save)
self._save_timer = self.callLater(5, self.save)
def __getitem__(self, key):
"""
See
:meth:`get_item`
"""
"""See get_item"""
return self.get_item(key)
def get_item(self, key):
"""
Gets the value of item 'key'
"""Gets the value of item 'key'.
:param key: the item for which you want it's value
:return: the value of item 'key'
Args:
key (str): The item for which you want it's value.
:raises KeyError: if 'key' is not in the config dictionary
Returns:
any: The value of item 'key'.
**Usage**
Raises:
ValueError: If 'key' is not in the config dictionary.
>>> config = Config("test.conf", defaults={"test": 5})
>>> config["test"]
5
Examples:
>>> config = Config('test.conf', defaults={'test': 5})
>>> config['test']
5
"""
return self.__config[key]
def register_change_callback(self, callback):
def get(self, key, default=None):
"""Gets the value of item 'key' if key is in the config, else default.
If default is not given, it defaults to None, so that this method
never raises a KeyError.
Args:
key (str): the item for which you want it's value
default (any): the default value if key is missing
Returns:
any: The value of item 'key' or default.
Examples:
>>> config = Config('test.conf', defaults={'test': 5})
>>> config.get('test', 10)
5
>>> config.get('bad_key', 10)
10
"""
Registers a callback function that will be called when a value is changed in the config dictionary
try:
return self.get_item(key)
except KeyError:
return default
:param callback: the function, callback(key, value)
def __delitem__(self, key):
"""
See
:meth:`del_item`
"""
self.del_item(key)
**Usage**
def del_item(self, key):
"""Deletes item with a specific key from the configuration.
>>> config = Config("test.conf", defaults={"test": 5})
>>> def cb(key, value):
... print key, value
...
>>> config.register_change_callback(cb)
Args:
key (str): The item which you wish to delete.
Raises:
ValueError: If 'key' is not in the config dictionary.
Examples:
>>> config = Config('test.conf', defaults={'test': 5})
>>> del config['test']
"""
del self.__config[key]
# We set the save_timer for 5 seconds if not already set
if not self._save_timer or not self._save_timer.active():
self._save_timer = self.callLater(5, self.save)
def register_change_callback(self, callback):
"""Registers a callback function for any changed value.
Will be called when any value is changed in the config dictionary.
Args:
callback (func): The function to call with parameters: f(key, value).
Examples:
>>> config = Config('test.conf', defaults={'test': 5})
>>> def cb(key, value):
... print key, value
...
>>> config.register_change_callback(cb)
"""
self.__change_callbacks.append(callback)
def register_set_function(self, key, function, apply_now=True):
"""
Register a function to be called when a config value changes
"""Register a function to be called when a config value changes.
:param key: the item to monitor for change
:param function: the function to call when the value changes, f(key, value)
:keyword apply_now: if True, the function will be called after it's registered
Args:
key (str): The item to monitor for change.
function (func): The function to call when the value changes, f(key, value).
apply_now (bool): If True, the function will be called immediately after it's registered.
**Usage**
>>> config = Config("test.conf", defaults={"test": 5})
>>> def cb(key, value):
... print key, value
...
>>> config.register_set_function("test", cb, apply_now=True)
test 5
Examples:
>>> config = Config('test.conf', defaults={'test': 5})
>>> def cb(key, value):
... print key, value
...
>>> config.register_set_function('test', cb, apply_now=True)
test 5
"""
log.debug("Registering function for %s key..", key)
log.debug('Registering function for %s key..', key)
if key not in self.__set_functions:
self.__set_functions[key] = []
@ -296,93 +352,108 @@ what is currently in the config and it could not convert the value
# Run the function now if apply_now is set
if apply_now:
function(key, self.__config[key])
return
def apply_all(self):
"""
Calls all set functions
"""Calls all set functions.
**Usage**
>>> config = Config("test.conf", defaults={"test": 5})
>>> def cb(key, value):
... print key, value
...
>>> config.register_set_function("test", cb, apply_now=False)
>>> config.apply_all()
test 5
Examples:
>>> config = Config('test.conf', defaults={'test': 5})
>>> def cb(key, value):
... print key, value
...
>>> config.register_set_function('test', cb, apply_now=False)
>>> config.apply_all()
test 5
"""
log.debug("Calling all set functions..")
for key, value in self.__set_functions.iteritems():
log.debug('Calling all set functions..')
for key, value in self.__set_functions.items():
for func in value:
func(key, self.__config[key])
def apply_set_functions(self, key):
"""
Calls set functions for `:param:key`.
"""Calls set functions for `:param:key`.
:param key: str, the config key
Args:
key (str): the config key
"""
log.debug("Calling set functions for key %s..", key)
log.debug('Calling set functions for key %s..', key)
if key in self.__set_functions:
for func in self.__set_functions[key]:
func(key, self.__config[key])
def load(self, filename=None):
"""
Load a config file
:param filename: if None, uses filename set in object initialization
"""Load a config file.
Args:
filename (str): If None, uses filename set in object initialization
"""
if not filename:
filename = self.__config_file
try:
data = open(filename, "rb").read()
except IOError, e:
log.warning("Unable to open config file %s: %s", filename, e)
with open(filename, encoding='utf8') as _file:
data = _file.read()
except OSError as ex:
log.warning('Unable to open config file %s: %s', filename, ex)
return
objects = find_json_objects(data)
if not len(objects):
# No json objects found, try depickling it
try:
self.__config.update(pickle.loads(data))
except Exception, e:
log.exception(e)
log.warning("Unable to load config file: %s", filename)
except Exception as ex:
log.exception(ex)
log.warning('Unable to load config file: %s', filename)
elif len(objects) == 1:
start, end = objects[0]
try:
self.__config.update(json.loads(data[start:end]))
except Exception, e:
log.exception(e)
log.warning("Unable to load config file: %s", filename)
except Exception as ex:
log.exception(ex)
log.warning('Unable to load config file: %s', filename)
elif len(objects) == 2:
try:
start, end = objects[0]
self.__version.update(json.loads(data[start:end]))
start, end = objects[1]
self.__config.update(json.loads(data[start:end]))
except Exception, e:
log.exception(e)
log.warning("Unable to load config file: %s", filename)
log.debug("Config %s version: %s.%s loaded: %s", filename,
self.__version["format"], self.__version["file"], self.__config)
except Exception as ex:
log.exception(ex)
log.warning('Unable to load config file: %s', filename)
if not log.isEnabledFor(logging.DEBUG):
return
config = self.__config
if self.__log_mask_funcs:
config = {
key: self.__log_mask_funcs[key](config[key])
if key in self.__log_mask_funcs
else config[key]
for key in config
}
log.debug(
'Config %s version: %s.%s loaded: %s',
filename,
self.__version['format'],
self.__version['file'],
config,
)
def save(self, filename=None):
"""
Save configuration to disk
"""Save configuration to disk.
:param filename: if None, uses filename set in object initiliazation
:rtype bool:
:return: whether or not the save succeeded.
Args:
filename (str): If None, uses filename set in object initialization
Returns:
bool: Whether or not the save succeeded.
"""
if not filename:
@ -390,49 +461,53 @@ what is currently in the config and it could not convert the value
# Check to see if the current config differs from the one on disk
# We will only write a new config file if there is a difference
try:
data = open(filename, "rb").read()
with open(filename, encoding='utf8') as _file:
data = _file.read()
objects = find_json_objects(data)
start, end = objects[0]
version = json.loads(data[start:end])
start, end = objects[1]
loaded_data = json.loads(data[start:end])
if self.__config == loaded_data and self.__version == version:
# The config has not changed so lets just return
self._save_timer.cancel()
return
except Exception, e:
log.warning("Unable to open config file: %s", filename)
if self._save_timer and self._save_timer.active():
self._save_timer.cancel()
return True
except (OSError, IndexError) as ex:
log.warning('Unable to open config file: %s because: %s', filename, ex)
# Save the new config and make sure it's written to disk
try:
log.debug("Saving new config file %s", filename + ".new")
f = open(filename + ".new", "wb")
json.dump(self.__version, f, indent=2)
json.dump(self.__config, f, indent=2)
f.flush()
os.fsync(f.fileno())
f.close()
except Exception, e:
log.error("Error writing new config file: %s", e)
with NamedTemporaryFile(
prefix=os.path.basename(filename) + '.', delete=False
) as _file:
filename_tmp = _file.name
log.debug('Saving new config file %s', filename_tmp)
json.dump(self.__version, getwriter('utf8')(_file), **JSON_FORMAT)
json.dump(self.__config, getwriter('utf8')(_file), **JSON_FORMAT)
_file.flush()
os.fsync(_file.fileno())
except OSError as ex:
log.error('Error writing new config file: %s', ex)
return False
# Resolve symlinked config files before backing up and saving.
filename = os.path.realpath(filename)
# Make a backup of the old config
try:
log.debug("Backing up old config file to %s~", filename)
shutil.move(filename, filename + "~")
except Exception, e:
log.error("Error backing up old config..")
log.debug('Backing up old config file to %s.bak', filename)
shutil.move(filename, filename + '.bak')
except OSError as ex:
log.warning('Unable to backup old config: %s', ex)
# The new config file has been written successfully, so let's move it over
# the existing one.
try:
log.debug("Moving new config file %s to %s..", filename + ".new", filename)
shutil.move(filename + ".new", filename)
except Exception, e:
log.error("Error moving new config file: %s", e)
log.debug('Moving new config file %s to %s', filename_tmp, filename)
shutil.move(filename_tmp, filename)
except OSError as ex:
log.error('Error moving new config file: %s', ex)
return False
else:
return True
@ -441,47 +516,53 @@ what is currently in the config and it could not convert the value
self._save_timer.cancel()
def run_converter(self, input_range, output_version, func):
"""
Runs a function that will convert file versions in the `:param:input_range`
to the `:param:output_version`.
"""Runs a function that will convert file versions.
:param input_range: tuple, (int, int) the range of input versions this
function will accept
:param output_version: int, the version this function will return
:param func: func, the function that will do the conversion, it will take
the config dict as an argument and return the augmented dict
Args:
input_range (tuple): (int, int) The range of input versions this function will accept.
output_version (int): The version this function will convert to.
func (func): The function that will do the conversion, it will take the config
dict as an argument and return the augmented dict.
:raises ValueError: if the output_version is less than the input_range
Raises:
ValueError: If output_version is less than the input_range.
"""
if output_version in input_range or output_version <= max(input_range):
raise ValueError("output_version needs to be greater than input_range")
raise ValueError('output_version needs to be greater than input_range')
if self.__version["file"] not in input_range:
log.debug("File version %s is not in input_range %s, ignoring converter function..",
self.__version["file"], input_range)
if self.__version['file'] not in input_range:
log.debug(
'File version %s is not in input_range %s, ignoring converter function..',
self.__version['file'],
input_range,
)
return
try:
self.__config = func(self.__config)
except Exception, e:
log.exception(e)
log.error("There was an exception try to convert config file %s %s to %s",
self.__config_file, self.__version["file"], output_version)
raise e
except Exception as ex:
log.exception(ex)
log.error(
'There was an exception try to convert config file %s %s to %s',
self.__config_file,
self.__version['file'],
output_version,
)
raise ex
else:
self.__version["file"] = output_version
self.__version['file'] = output_version
self.save()
@property
def config_file(self):
return self.__config_file
@prop
def config():
@property
def config(self):
"""The config dictionary"""
def fget(self):
return self.__config
def fdel(self):
return self.save()
return locals()
return self.__config
@config.deleter
def config(self):
return self.save()

View File

@ -1,47 +1,24 @@
#
# configmanager.py
#
# Copyright (C) 2007 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import logging
import os
import deluge.common
from deluge.log import LOG as log
import deluge.log
from deluge.config import Config
log = logging.getLogger(__name__)
class _ConfigManager:
def __init__(self):
log.debug("ConfigManager started..")
log.debug('ConfigManager started..')
self.config_files = {}
self.__config_directory = None
@ -52,7 +29,6 @@ class _ConfigManager:
return self.__config_directory
def __del__(self):
log.debug("ConfigManager stopping..")
del self.config_files
def set_config_dir(self, directory):
@ -67,16 +43,19 @@ class _ConfigManager:
if not directory:
return False
log.info("Setting config directory to: %s", directory)
# Ensure absolute dirpath
directory = os.path.abspath(directory)
log.info('Setting config directory to: %s', directory)
if not os.path.exists(directory):
# Try to create the config folder if it doesn't exist
try:
os.makedirs(directory)
except Exception, e:
log.error("Unable to make config directory: %s", e)
except OSError as ex:
log.error('Unable to make config directory: %s', ex)
return False
elif not os.path.isdir(directory):
log.error("Config directory needs to be a directory!")
log.error('Config directory needs to be a directory!')
return False
self.__config_directory = directory
@ -86,6 +65,7 @@ class _ConfigManager:
# to reload based on the new config directory
self.save()
self.config_files = {}
deluge.log.tweak_logging_levels()
return True
@ -106,30 +86,42 @@ class _ConfigManager:
# We need to return True to keep the timer active
return True
def get_config(self, config_file, defaults=None):
def get_config(self, config_file, defaults=None, file_version=1):
"""Get a reference to the Config object for this filename"""
log.debug("Getting config '%s'", config_file)
log.debug('Getting config: %s', config_file)
# Create the config object if not already created
if config_file not in self.config_files.keys():
self.config_files[config_file] = Config(config_file, defaults, self.config_directory)
if config_file not in self.config_files:
self.config_files[config_file] = Config(
config_file,
defaults,
config_dir=self.config_directory,
file_version=file_version,
)
return self.config_files[config_file]
# Singleton functions
_configmanager = _ConfigManager()
def ConfigManager(config, defaults=None):
return _configmanager.get_config(config, defaults)
def ConfigManager(config, defaults=None, file_version=1): # NOQA: N802
return _configmanager.get_config(
config, defaults=defaults, file_version=file_version
)
def set_config_dir(directory):
"""Sets the config directory, else just uses default"""
return _configmanager.set_config_dir(directory)
return _configmanager.set_config_dir(deluge.common.decode_bytes(directory))
def get_config_dir(filename=None):
if filename != None:
if filename is not None:
return os.path.join(_configmanager.get_config_dir(), filename)
else:
return _configmanager.get_config_dir()
def close(config):
return _configmanager.close(config)

192
deluge/conftest.py Normal file
View File

@ -0,0 +1,192 @@
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import tempfile
import warnings
from unittest.mock import Mock, patch
import pytest
import pytest_twisted
from twisted.internet import reactor
from twisted.internet.defer import Deferred, maybeDeferred
from twisted.internet.error import CannotListenError
from twisted.python.failure import Failure
import deluge.component as _component
import deluge.configmanager
from deluge.common import get_localhost_auth
from deluge.tests import common
from deluge.ui.client import client as _client
DEFAULT_LISTEN_PORT = 58900
@pytest.fixture
def listen_port(request):
if request and 'daemon' in request.fixturenames:
try:
return request.getfixturevalue('daemon').listen_port
except Exception:
pass
return DEFAULT_LISTEN_PORT
@pytest.fixture
def mock_callback():
"""Returns a `Mock` object which can be registered as a callback to test against.
If callback was not called within `timeout` seconds, it will raise a TimeoutError.
The returned Mock instance will have a `deferred` attribute which will complete when the callback has been called.
"""
def reset():
if mock.called:
original_reset_mock()
deferred = Deferred()
deferred.addTimeout(0.5, reactor)
mock.side_effect = lambda *args, **kw: deferred.callback((args, kw))
mock.deferred = deferred
mock = Mock()
original_reset_mock = mock.reset_mock
mock.reset_mock = reset
mock.reset_mock()
return mock
@pytest.fixture
def config_dir(tmp_path):
deluge.configmanager.set_config_dir(tmp_path)
yield tmp_path
@pytest_twisted.async_yield_fixture()
async def client(request, config_dir, monkeypatch, listen_port):
# monkeypatch.setattr(
# _client, 'connect', functools.partial(_client.connect, port=listen_port)
# )
try:
username, password = get_localhost_auth()
except Exception:
username, password = '', ''
await _client.connect(
'localhost',
port=listen_port,
username=username,
password=password,
)
yield _client
if _client.connected():
await _client.disconnect()
@pytest_twisted.async_yield_fixture
async def daemon(request, config_dir):
listen_port = DEFAULT_LISTEN_PORT
logfile = f'daemon_{request.node.name}.log'
if hasattr(request.cls, 'daemon_custom_script'):
custom_script = request.cls.daemon_custom_script
else:
custom_script = ''
for dummy in range(10):
try:
d, daemon = common.start_core(
listen_port=listen_port,
logfile=logfile,
timeout=5,
timeout_msg='Timeout!',
custom_script=custom_script,
print_stdout=True,
print_stderr=True,
config_directory=config_dir,
)
await d
except CannotListenError as ex:
exception_error = ex
listen_port += 1
except (KeyboardInterrupt, SystemExit):
raise
else:
break
else:
raise exception_error
daemon.listen_port = listen_port
yield daemon
await daemon.kill()
@pytest.fixture(autouse=True)
def common_fixture(config_dir, request, monkeypatch, listen_port):
"""Adds some instance attributes to test classes for backwards compatibility with old testing."""
def fail(self, reason):
if isinstance(reason, Failure):
reason = reason.value
return pytest.fail(str(reason))
if request.instance:
request.instance.patch = monkeypatch.setattr
request.instance.config_dir = config_dir
request.instance.listen_port = listen_port
request.instance.id = lambda: request.node.name
request.cls.fail = fail
@pytest_twisted.async_yield_fixture(scope='function')
async def component(request):
"""Verify component registry is clean, and clean up after test."""
if len(_component._ComponentRegistry.components) != 0:
warnings.warn(
'The component._ComponentRegistry.components is not empty on test setup.\n'
'This is probably caused by another test that did not clean up after finishing!: %s'
% _component._ComponentRegistry.components
)
yield _component
await _component.shutdown()
_component._ComponentRegistry.components.clear()
_component._ComponentRegistry.dependents.clear()
@pytest_twisted.async_yield_fixture(scope='function')
async def base_fixture(common_fixture, component, request):
"""This fixture is autoused on all tests that subclass BaseTestCase"""
self = request.instance
if hasattr(self, 'set_up'):
try:
await maybeDeferred(self.set_up)
except Exception as exc:
warnings.warn('Error caught in test setup!\n%s' % exc)
pytest.fail('Error caught in test setup!\n%s' % exc)
yield
if hasattr(self, 'tear_down'):
try:
await maybeDeferred(self.tear_down)
except Exception as exc:
pytest.fail('Error caught in test teardown!\n%s' % exc)
@pytest.mark.usefixtures('base_fixture')
class BaseTestCase:
"""This is the base class that should be used for all test classes
that create classes that inherit from deluge.component.Component. It
ensures that the component registry has been cleaned up when tests
have finished.
"""
@pytest.fixture
def mock_mkstemp(tmp_path):
"""Return known tempfile location to verify file deleted"""
tmp_file = tempfile.mkstemp(dir=tmp_path)
with patch('tempfile.mkstemp', return_value=tmp_file):
yield tmp_file

View File

@ -1,71 +1,58 @@
#
# alertmanager.py
#
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
"""
The AlertManager handles all the libtorrent alerts.
This should typically only be used by the Core. Plugins should utilize the
This should typically only be used by the Core. Plugins should utilize the
`:mod:EventManager` for similar functionality.
"""
import logging
from types import SimpleNamespace
from twisted.internet import reactor
import deluge.component as component
from deluge._libtorrent import lt
from deluge.common import decode_bytes
log = logging.getLogger(__name__)
from deluge.log import LOG as log
class AlertManager(component.Component):
def __init__(self):
log.debug("AlertManager initialized..")
component.Component.__init__(self, "AlertManager", interval=0.05)
self.session = component.get("Core").session
"""AlertManager fetches and processes libtorrent alerts"""
self.session.set_alert_mask(
lt.alert.category_t.error_notification |
lt.alert.category_t.port_mapping_notification |
lt.alert.category_t.storage_notification |
lt.alert.category_t.tracker_notification |
lt.alert.category_t.status_notification |
lt.alert.category_t.ip_block_notification |
lt.alert.category_t.performance_warning)
def __init__(self):
log.debug('AlertManager init...')
component.Component.__init__(self, 'AlertManager', interval=0.3)
self.session = component.get('Core').session
# Increase the alert queue size so that alerts don't get lost.
self.alert_queue_size = 10000
self.set_alert_queue_size(self.alert_queue_size)
alert_mask = (
lt.alert.category_t.error_notification
| lt.alert.category_t.port_mapping_notification
| lt.alert.category_t.storage_notification
| lt.alert.category_t.tracker_notification
| lt.alert.category_t.status_notification
| lt.alert.category_t.ip_block_notification
| lt.alert.category_t.performance_warning
| lt.alert.category_t.file_progress_notification
)
self.session.apply_settings({'alert_mask': alert_mask})
# handlers is a dictionary of lists {"alert_type": [handler1,h2,..]}
self.handlers = {}
self.delayed_calls = []
def update(self):
@ -73,8 +60,9 @@ class AlertManager(component.Component):
self.handle_alerts()
def stop(self):
for dc in self.delayed_calls:
dc.cancel()
for delayed_call in self.delayed_calls:
if delayed_call.active():
delayed_call.cancel()
self.delayed_calls = []
def register_handler(self, alert_type, handler):
@ -93,7 +81,7 @@ class AlertManager(component.Component):
# Append the handler to the list in the handlers dictionary
self.handlers[alert_type].append(handler)
log.debug("Registered handler for alert %s", alert_type)
log.debug('Registered handler for alert %s', alert_type)
def deregister_handler(self, handler):
"""
@ -102,31 +90,53 @@ class AlertManager(component.Component):
:param handler: func, the handler function to deregister
"""
# Iterate through all handlers and remove 'handler' where found
for (key, value) in self.handlers.items():
for (dummy_key, value) in self.handlers.items():
if handler in value:
# Handler is in this alert type list
value.remove(handler)
def handle_alerts(self, wait=False):
def handle_alerts(self):
"""
Pops all libtorrent alerts in the session queue and handles them
appropriately.
Pops all libtorrent alerts in the session queue and handles them appropriately.
"""
alerts = self.session.pop_alerts()
if not alerts:
return
num_alerts = len(alerts)
if log.isEnabledFor(logging.DEBUG):
log.debug('Alerts queued: %s', num_alerts)
if num_alerts > 0.9 * self.alert_queue_size:
log.warning(
'Warning total alerts queued, %s, passes 90%% of queue size.',
num_alerts,
)
:param wait: bool, if True then the handler functions will be run right
away and waited to return before processing the next alert
"""
alert = self.session.pop_alert()
# Loop through all alerts in the queue
while alert is not None:
for alert in alerts:
alert_type = type(alert).__name__
# Display the alert message
log.debug("%s: %s", alert_type, alert.message())
if log.isEnabledFor(logging.DEBUG):
log.debug('%s: %s', alert_type, decode_bytes(alert.message()))
# Call any handlers for this alert type
if alert_type in self.handlers:
for handler in self.handlers[alert_type]:
if not wait:
self.delayed_calls.append(reactor.callLater(0, handler, alert))
else:
handler(alert)
if log.isEnabledFor(logging.DEBUG):
log.debug('Handling alert: %s', alert_type)
# Copy alert attributes
alert_copy = SimpleNamespace(
**{
attr: getattr(alert, attr)
for attr in dir(alert)
if not attr.startswith('__')
}
)
self.delayed_calls.append(reactor.callLater(0, handler, alert_copy))
alert = self.session.pop_alert()
def set_alert_queue_size(self, queue_size):
"""Sets the maximum size of the libtorrent alert queue"""
log.info('Alert Queue Size set to %s', queue_size)
self.alert_queue_size = queue_size
component.get('Core').apply_session_setting(
'alert_queue_size', self.alert_queue_size
)

View File

@ -1,62 +1,68 @@
#
# authmanager.py
#
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2011 Pedro Algarvio <pedro@algarvio.me>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import logging
import os
import random
import stat
import shutil
import deluge.component as component
import deluge.configmanager as configmanager
import deluge.error
from deluge.common import (
AUTH_LEVEL_ADMIN,
AUTH_LEVEL_DEFAULT,
AUTH_LEVEL_NONE,
AUTH_LEVEL_NORMAL,
AUTH_LEVEL_READONLY,
create_localclient_account,
)
from deluge.error import AuthenticationRequired, AuthManagerError, BadLoginError
from deluge.log import LOG as log
log = logging.getLogger(__name__)
AUTH_LEVEL_NONE = 0
AUTH_LEVEL_READONLY = 1
AUTH_LEVEL_NORMAL = 5
AUTH_LEVEL_ADMIN = 10
AUTH_LEVELS_MAPPING = {
'NONE': AUTH_LEVEL_NONE,
'READONLY': AUTH_LEVEL_READONLY,
'DEFAULT': AUTH_LEVEL_DEFAULT,
'NORMAL': AUTH_LEVEL_NORMAL,
'ADMIN': AUTH_LEVEL_ADMIN,
}
AUTH_LEVELS_MAPPING_REVERSE = {v: k for k, v in AUTH_LEVELS_MAPPING.items()}
AUTH_LEVEL_DEFAULT = AUTH_LEVEL_NORMAL
class BadLoginError(deluge.error.DelugeError):
pass
class Account:
__slots__ = ('username', 'password', 'authlevel')
def __init__(self, username, password, authlevel):
self.username = username
self.password = password
self.authlevel = authlevel
def data(self):
return {
'username': self.username,
'password': self.password,
'authlevel': AUTH_LEVELS_MAPPING_REVERSE[self.authlevel],
'authlevel_int': self.authlevel,
}
def __repr__(self):
return '<Account username="{username}" authlevel={authlevel}>'.format(
username=self.username,
authlevel=self.authlevel,
)
class AuthManager(component.Component):
def __init__(self):
component.Component.__init__(self, "AuthManager")
component.Component.__init__(self, 'AuthManager', interval=10)
self.__auth = {}
self.__auth_modification_time = None
def start(self):
self.__load_auth_file()
@ -67,80 +73,213 @@ class AuthManager(component.Component):
def shutdown(self):
pass
def update(self):
auth_file = configmanager.get_config_dir('auth')
# Check for auth file and create if necessary
if not os.path.isfile(auth_file):
log.info('Authfile not found, recreating it.')
self.__load_auth_file()
return
auth_file_modification_time = os.stat(auth_file).st_mtime
if self.__auth_modification_time != auth_file_modification_time:
log.info('Auth file changed, reloading it!')
self.__load_auth_file()
def authorize(self, username, password):
"""
Authorizes users based on username and password
"""Authorizes users based on username and password.
:param username: str, username
:param password: str, password
:returns: int, the auth level for this user
:rtype: int
Args:
username (str): Username
password (str): Password
:raises BadLoginError: if the username does not exist or password does not match
Returns:
int: The auth level for this user.
Raises:
AuthenticationRequired: If additional details are required to authenticate.
BadLoginError: If the username does not exist or password does not match.
"""
if not username:
raise AuthenticationRequired(
'Username and Password are required.', username
)
if username not in self.__auth:
# Let's try to re-load the file.. Maybe it's been updated
self.__load_auth_file()
if username not in self.__auth:
raise BadLoginError("Username does not exist")
raise BadLoginError('Username does not exist', username)
if self.__auth[username][0] == password:
if self.__auth[username].password == password:
# Return the users auth level
return int(self.__auth[username][1])
return self.__auth[username].authlevel
elif not password and self.__auth[username].password:
raise AuthenticationRequired('Password is required', username)
else:
raise BadLoginError("Password does not match")
raise BadLoginError('Password does not match', username)
def __create_localclient_account(self):
"""
Returns the string.
"""
# We create a 'localclient' account with a random password
def has_account(self, username):
return username in self.__auth
def get_known_accounts(self):
"""Returns a list of known deluge usernames."""
self.__load_auth_file()
return [account.data() for account in self.__auth.values()]
def create_account(self, username, password, authlevel):
if username in self.__auth:
raise AuthManagerError('Username in use.', username)
if authlevel not in AUTH_LEVELS_MAPPING:
raise AuthManagerError('Invalid auth level: %s' % authlevel)
try:
from hashlib import sha1 as sha_hash
except ImportError:
from sha import new as sha_hash
return "localclient:" + sha_hash(str(random.random())).hexdigest() + ":" + str(AUTH_LEVEL_ADMIN) + "\n"
self.__auth[username] = Account(
username, password, AUTH_LEVELS_MAPPING[authlevel]
)
self.write_auth_file()
return True
except Exception as ex:
log.exception(ex)
raise ex
def update_account(self, username, password, authlevel):
if username not in self.__auth:
raise AuthManagerError('Username not known', username)
if authlevel not in AUTH_LEVELS_MAPPING:
raise AuthManagerError('Invalid auth level: %s' % authlevel)
try:
self.__auth[username].username = username
self.__auth[username].password = password
self.__auth[username].authlevel = AUTH_LEVELS_MAPPING[authlevel]
self.write_auth_file()
return True
except Exception as ex:
log.exception(ex)
raise ex
def remove_account(self, username):
if username not in self.__auth:
raise AuthManagerError('Username not known', username)
elif username == component.get('RPCServer').get_session_user():
raise AuthManagerError(
'You cannot delete your own account while logged in!', username
)
del self.__auth[username]
self.write_auth_file()
return True
def write_auth_file(self):
filename = 'auth'
filepath = os.path.join(configmanager.get_config_dir(), filename)
filepath_bak = filepath + '.bak'
filepath_tmp = filepath + '.tmp'
try:
if os.path.isfile(filepath):
log.debug('Creating backup of %s at: %s', filename, filepath_bak)
shutil.copy2(filepath, filepath_bak)
except OSError as ex:
log.error('Unable to backup %s to %s: %s', filepath, filepath_bak, ex)
else:
log.info('Saving the %s at: %s', filename, filepath)
try:
with open(filepath_tmp, 'w', encoding='utf8') as _file:
for account in self.__auth.values():
_file.write(
'%(username)s:%(password)s:%(authlevel_int)s\n'
% account.data()
)
_file.flush()
os.fsync(_file.fileno())
shutil.move(filepath_tmp, filepath)
except OSError as ex:
log.error('Unable to save %s: %s', filename, ex)
if os.path.isfile(filepath_bak):
log.info('Restoring backup of %s from: %s', filename, filepath_bak)
shutil.move(filepath_bak, filepath)
self.__load_auth_file()
def __load_auth_file(self):
auth_file = configmanager.get_config_dir("auth")
# Check for auth file and create if necessary
if not os.path.exists(auth_file):
localclient = self.__create_localclient_account()
fd = open(auth_file, "w")
fd.write(localclient)
fd.flush()
os.fsync(fd.fileno())
fd.close()
# Change the permissions on the file so only this user can read/write it
os.chmod(auth_file, stat.S_IREAD | stat.S_IWRITE)
f = [localclient]
else:
# Load the auth file into a dictionary: {username: password, ...}
f = open(auth_file, "r").readlines()
save_and_reload = False
filename = 'auth'
auth_file = configmanager.get_config_dir(filename)
auth_file_bak = auth_file + '.bak'
for line in f:
if line.startswith("#"):
# This is a comment line
continue
line = line.strip()
# Check for auth file and create if necessary
if not os.path.isfile(auth_file):
create_localclient_account()
return self.__load_auth_file()
auth_file_modification_time = os.stat(auth_file).st_mtime
if self.__auth_modification_time is None:
self.__auth_modification_time = auth_file_modification_time
elif self.__auth_modification_time == auth_file_modification_time:
# File didn't change, no need for re-parsing's
return
for _filepath in (auth_file, auth_file_bak):
log.info('Opening %s for load: %s', filename, _filepath)
try:
lsplit = line.split(":")
except Exception, e:
log.error("Your auth file is malformed: %s", e)
with open(_filepath, encoding='utf8') as _file:
file_data = _file.readlines()
except OSError as ex:
log.warning('Unable to load %s: %s', _filepath, ex)
file_data = []
else:
log.info('Successfully loaded %s: %s', filename, _filepath)
break
# Load the auth file into a dictionary: {username: Account(...)}
for line in file_data:
line = line.strip()
if line.startswith('#') or not line:
# This line is a comment or empty
continue
lsplit = line.split(':')
if len(lsplit) == 2:
username, password = lsplit
log.warning("Your auth entry for %s contains no auth level, using AUTH_LEVEL_DEFAULT(%s)..", username, AUTH_LEVEL_DEFAULT)
level = AUTH_LEVEL_DEFAULT
log.warning(
'Your auth entry for %s contains no auth level, '
'using AUTH_LEVEL_DEFAULT(%s)..',
username,
AUTH_LEVEL_DEFAULT,
)
if username == 'localclient':
authlevel = AUTH_LEVEL_ADMIN
else:
authlevel = AUTH_LEVEL_DEFAULT
# This is probably an old auth file
save_and_reload = True
elif len(lsplit) == 3:
username, password, level = lsplit
username, password, authlevel = lsplit
else:
log.error("Your auth file is malformed: Incorrect number of fields!")
log.error('Your auth file is malformed: Incorrect number of fields!')
continue
self.__auth[username.strip()] = (password.strip(), level)
username = username.strip()
password = password.strip()
try:
authlevel = int(authlevel)
except ValueError:
try:
authlevel = AUTH_LEVELS_MAPPING[authlevel]
except KeyError:
log.error(
'Your auth file is malformed: %r is not a valid auth level',
authlevel,
)
continue
if "localclient" not in self.__auth:
open(auth_file, "a").write(self.__create_localclient_account())
self.__auth[username] = Account(username, password, authlevel)
if 'localclient' not in self.__auth:
create_localclient_account(True)
return self.__load_auth_file()
if save_and_reload:
log.info('Re-writing auth file (upgrade)')
self.write_auth_file()
self.__auth_modification_time = auth_file_modification_time

View File

@ -1,135 +0,0 @@
#
# autoadd.py
#
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#
#
import os
from deluge._libtorrent import lt
import deluge.component as component
from deluge.configmanager import ConfigManager
from deluge.log import LOG as log
MAX_NUM_ATTEMPTS = 10
class AutoAdd(component.Component):
def __init__(self):
component.Component.__init__(self, "AutoAdd", depend=["TorrentManager"], interval=5)
# Get the core config
self.config = ConfigManager("core.conf")
# A list of filenames
self.invalid_torrents = []
# Filename:Attempts
self.attempts = {}
# Register set functions
self.config.register_set_function("autoadd_enable",
self._on_autoadd_enable, apply_now=True)
self.config.register_set_function("autoadd_location",
self._on_autoadd_location)
def update(self):
if not self.config["autoadd_enable"]:
# We shouldn't be updating because autoadd is not enabled
component.pause("AutoAdd")
return
# Check the auto add folder for new torrents to add
if not os.path.isdir(self.config["autoadd_location"]):
log.warning("Invalid AutoAdd folder: %s", self.config["autoadd_location"])
component.pause("AutoAdd")
return
for filename in os.listdir(self.config["autoadd_location"]):
if filename.split(".")[-1] == "torrent":
try:
filepath = os.path.join(self.config["autoadd_location"], filename)
except UnicodeDecodeError, e:
log.error("Unable to auto add torrent due to inproper filename encoding: %s", e)
continue
try:
filedump = self.load_torrent(filepath)
except (RuntimeError, Exception), e:
# If the torrent is invalid, we keep track of it so that we
# can try again on the next pass. This is because some
# torrents may not be fully saved during the pass.
log.debug("Torrent is invalid: %s", e)
if filename in self.invalid_torrents:
self.attempts[filename] += 1
if self.attempts[filename] >= MAX_NUM_ATTEMPTS:
os.rename(filepath, filepath + ".invalid")
del self.attempts[filename]
self.invalid_torrents.remove(filename)
else:
self.invalid_torrents.append(filename)
self.attempts[filename] = 1
continue
# The torrent looks good, so lets add it to the session
component.get("TorrentManager").add(filedump=filedump, filename=filename)
os.remove(filepath)
def load_torrent(self, filename):
try:
log.debug("Attempting to open %s for add.", filename)
_file = open(filename, "rb")
filedump = _file.read()
if not filedump:
raise RuntimeError, "Torrent is 0 bytes!"
_file.close()
except IOError, e:
log.warning("Unable to open %s: %s", filename, e)
raise e
# Get the info to see if any exceptions are raised
info = lt.torrent_info(lt.bdecode(filedump))
return filedump
def _on_autoadd_enable(self, key, value):
log.debug("_on_autoadd_enable")
if value:
component.resume("AutoAdd")
else:
component.pause("AutoAdd")
def _on_autoadd_location(self, key, value):
log.debug("_on_autoadd_location")
# We need to resume the component just incase it was paused due to
# an invalid autoadd location.
if self.config["autoadd_enable"]:
component.resume("AutoAdd")

File diff suppressed because it is too large Load Diff

View File

@ -1,206 +1,203 @@
#
# daemon.py
#
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
"""The Deluge daemon"""
import logging
import os
import gettext
import locale
import pkg_resources
import socket
from twisted.internet import reactor
import twisted.internet.error
import deluge.component as component
import deluge.configmanager
import deluge.common
from deluge.common import get_version, is_ip, is_process_running, windows_check
from deluge.configmanager import get_config_dir
from deluge.core.core import Core
from deluge.core.rpcserver import RPCServer, export
from deluge.log import LOG as log
import deluge.error
from deluge.error import DaemonRunningError
class Daemon(object):
def __init__(self, options=None, args=None, classic=False):
# Check for another running instance of the daemon
if os.path.isfile(deluge.configmanager.get_config_dir("deluged.pid")):
# Get the PID and the port of the supposedly running daemon
try:
(pid, port) = open(deluge.configmanager.get_config_dir("deluged.pid")).read().strip().split(";")
pid = int(pid)
port = int(port)
except ValueError:
pid = None
port = None
if windows_check():
from win32api import SetConsoleCtrlHandler
from win32con import CTRL_CLOSE_EVENT, CTRL_SHUTDOWN_EVENT
log = logging.getLogger(__name__)
def process_running(pid):
if deluge.common.windows_check():
# Do some fancy WMI junk to see if the PID exists in Windows
from win32com.client import GetObject
def get_proclist():
WMI = GetObject('winmgmts:')
processes = WMI.InstancesOf('Win32_Process')
return [process.Properties_('ProcessID').Value for process in processes]
return pid in get_proclist()
else:
# We can just use os.kill on UNIX to test if the process is running
try:
os.kill(pid, 0)
except OSError:
return False
else:
return True
def is_daemon_running(pid_file):
"""
Check for another running instance of the daemon using the same pid file.
if pid is not None and process_running(pid):
# Ok, so a process is running with this PID, let's make doubly-sure
# it's a deluged process by trying to open a socket to it's port.
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect(("127.0.0.1", port))
except socket.error:
# Can't connect, so it must not be a deluged process..
pass
else:
# This is a deluged!
s.close()
raise deluge.error.DaemonRunningError("There is a deluge daemon running with this config directory!")
Args:
pid_file: The location of the file with pid, port values.
# Initialize gettext
Returns:
bool: True is daemon is running, False otherwise.
"""
try:
with open(pid_file) as _file:
pid, port = (int(x) for x in _file.readline().strip().split(';'))
except (OSError, ValueError):
return False
if is_process_running(pid):
# Ensure it's a deluged process by trying to open a socket to it's port.
_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
locale.setlocale(locale.LC_ALL, '')
if hasattr(locale, "bindtextdomain"):
locale.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n"))
if hasattr(locale, "textdomain"):
locale.textdomain("deluge")
gettext.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n"))
gettext.textdomain("deluge")
gettext.install("deluge", pkg_resources.resource_filename("deluge", "i18n"))
except Exception, e:
log.error("Unable to initialize gettext/locale: %s", e)
import __builtin__
__builtin__.__dict__["_"] = lambda x: x
_socket.connect(('127.0.0.1', port))
except OSError:
# Can't connect, so pid is not a deluged process.
return False
else:
# This is a deluged process!
_socket.close()
return True
# Twisted catches signals to terminate, so just have it call the shutdown
# method.
reactor.addSystemEventTrigger("after", "shutdown", self.shutdown)
class Daemon:
"""The Deluge Daemon class"""
def __init__(
self,
listen_interface=None,
outgoing_interface=None,
interface=None,
port=None,
standalone=False,
read_only_config_keys=None,
):
"""
Args:
listen_interface (str, optional): The IP address to listen to
BitTorrent connections on.
outgoing_interface (str, optional): The network interface name or
IP address to open outgoing BitTorrent connections on.
interface (str, optional): The IP address the daemon will
listen for UI connections on.
port (int, optional): The port the daemon will listen for UI
connections on.
standalone (bool, optional): If True the client is in Standalone
mode otherwise, if False, start the daemon as separate process.
read_only_config_keys (list of str, optional): A list of config
keys that will not be altered by core.set_config() RPC method.
"""
self.standalone = standalone
self.pid_file = get_config_dir('deluged.pid')
log.info('Deluge daemon %s', get_version())
if is_daemon_running(self.pid_file):
raise DaemonRunningError(
'Deluge daemon already running with this config directory!'
)
# Twisted catches signals to terminate, so just have it call the shutdown method.
reactor.addSystemEventTrigger('before', 'shutdown', self._shutdown)
# Catch some Windows specific signals
if deluge.common.windows_check():
from win32api import SetConsoleCtrlHandler
from win32con import CTRL_CLOSE_EVENT
from win32con import CTRL_SHUTDOWN_EVENT
if windows_check():
def win_handler(ctrl_type):
log.debug("ctrl_type: %s", ctrl_type)
"""Handle the Windows shutdown or close events."""
log.debug('windows handler ctrl_type: %s', ctrl_type)
if ctrl_type == CTRL_CLOSE_EVENT or ctrl_type == CTRL_SHUTDOWN_EVENT:
self.__shutdown()
self._shutdown()
return 1
SetConsoleCtrlHandler(win_handler)
version = deluge.common.get_version()
log.info("Deluge daemon %s", version)
log.debug("options: %s", options)
log.debug("args: %s", args)
# Set the config directory
if options and options.config:
deluge.configmanager.set_config_dir(options.config)
from deluge.core.core import Core
# Start the core as a thread and join it until it's done
self.core = Core()
self.core = Core(
listen_interface=listen_interface,
outgoing_interface=outgoing_interface,
read_only_config_keys=read_only_config_keys,
)
port = self.core.config["daemon_port"]
if options and options.port:
port = options.port
if options and options.ui_interface:
interface = options.ui_interface
else:
interface = ""
if port is None:
port = self.core.config['daemon_port']
self.port = port
if interface and not is_ip(interface):
log.error('Invalid UI interface (must be IP Address): %s', interface)
interface = None
self.rpcserver = RPCServer(
port=port,
allow_remote=self.core.config["allow_remote"],
listen=not classic,
interface=interface
allow_remote=self.core.config['allow_remote'],
listen=not standalone,
interface=interface,
)
log.debug(
'Listening to UI on: %s:%s and bittorrent on: %s Making connections out on: %s',
interface,
port,
listen_interface,
outgoing_interface,
)
def start(self):
# Register the daemon and the core RPCs
self.rpcserver.register_object(self.core)
self.rpcserver.register_object(self)
# Make sure we start the PreferencesManager first
component.start("PreferencesManager")
component.start('PreferencesManager')
if not classic:
# Write out a pid file all the time, we use this to see if a deluged is running
# We also include the running port number to do an additional test
open(deluge.configmanager.get_config_dir("deluged.pid"), "wb").write(
"%s;%s\n" % (os.getpid(), port))
if not self.standalone:
log.info('Deluge daemon starting...')
# Create pid file to track if deluged is running, also includes the port number.
pid = os.getpid()
log.debug('Storing pid %s & port %s in: %s', pid, self.port, self.pid_file)
with open(self.pid_file, 'w') as _file:
_file.write(f'{pid};{self.port}\n')
component.start()
try:
reactor.run()
finally:
self._shutdown()
log.debug('Remove pid file: %s', self.pid_file)
os.remove(self.pid_file)
log.info('Deluge daemon shutdown successfully')
@export()
def shutdown(self, *args, **kwargs):
log.debug('Deluge daemon shutdown requested...')
reactor.callLater(0, reactor.stop)
def _shutdown(self, *args, **kwargs):
try:
os.remove(deluge.configmanager.get_config_dir("deluged.pid"))
except Exception, e:
log.exception(e)
log.error("Error removing deluged.pid!")
component.shutdown()
try:
reactor.stop()
except twisted.internet.error.ReactorNotRunning:
log.debug("Tried to stop the reactor but it is not running..")
@export()
def info(self):
"""
Returns some info from the daemon.
:returns: str, the version number
"""
return deluge.common.get_version()
log.info('Deluge daemon shutting down, waiting for components to shutdown...')
if not self.standalone:
return component.shutdown()
@export()
def get_method_list(self):
"""
Returns a list of the exported methods.
"""
"""Returns a list of the exported methods."""
return self.rpcserver.get_method_list()
@export()
def get_version(self):
"""Returns the daemon version"""
return get_version()
@export(1)
def authorized_call(self, rpc):
"""Determines if session auth_level is authorized to call RPC.
Args:
rpc (str): A RPC, e.g. core.get_torrents_status
Returns:
bool: True if authorized to call RPC, otherwise False.
"""
if rpc not in self.get_method_list():
return False
return (
self.rpcserver.get_session_auth_level()
>= self.rpcserver.get_rpc_auth_level(rpc)
)

140
deluge/core/daemon_entry.py Normal file
View File

@ -0,0 +1,140 @@
#
# Copyright (C) 2007 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2010 Pedro Algarvio <pedro@algarvio.me>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import os
import sys
from logging import DEBUG, FileHandler, getLogger
from twisted.internet.error import CannotListenError
from deluge.argparserbase import ArgParserBase
from deluge.common import run_profiled
from deluge.configmanager import get_config_dir
from deluge.i18n import setup_mock_translation
def add_daemon_options(parser):
group = parser.add_argument_group(_('Daemon Options'))
group.add_argument(
'-u',
'--ui-interface',
metavar='<ip-addr>',
action='store',
help=_('IP address to listen for UI connections'),
)
group.add_argument(
'-p',
'--port',
metavar='<port>',
action='store',
type=int,
help=_('Port to listen for UI connections on'),
)
group.add_argument(
'-i',
'--interface',
metavar='<ip-addr>',
dest='listen_interface',
action='store',
help=_('IP address to listen for BitTorrent connections'),
)
group.add_argument(
'-o',
'--outgoing-interface',
metavar='<interface>',
dest='outgoing_interface',
action='store',
help=_(
'The network interface name or IP address for outgoing BitTorrent connections.'
),
)
group.add_argument(
'--read-only-config-keys',
metavar='<comma-separated-keys>',
action='store',
help=_('Config keys to be unmodified by `set_config` RPC'),
type=str,
default='',
)
parser.add_process_arg_group()
def start_daemon(skip_start=False):
"""
Entry point for daemon script
Args:
skip_start (bool): If starting daemon should be skipped.
Returns:
deluge.core.daemon.Daemon: A new daemon object
"""
setup_mock_translation()
# Setup the argument parser
parser = ArgParserBase()
add_daemon_options(parser)
options = parser.parse_args()
# Check for any daemons running with this same config
from deluge.core.daemon import is_daemon_running
pid_file = get_config_dir('deluged.pid')
if is_daemon_running(pid_file):
print(
'Cannot run multiple daemons with same config directory.\n'
'If you believe this is an error, force starting by deleting: %s' % pid_file
)
sys.exit(1)
log = getLogger(__name__)
# If no logfile specified add logging to default location (as well as stdout)
if not options.logfile:
options.logfile = get_config_dir('deluged.log')
file_handler = FileHandler(options.logfile)
log.addHandler(file_handler)
def run_daemon(options):
try:
from deluge.core.daemon import Daemon
daemon = Daemon(
listen_interface=options.listen_interface,
outgoing_interface=options.outgoing_interface,
interface=options.ui_interface,
port=options.port,
read_only_config_keys=options.read_only_config_keys.split(','),
)
if skip_start:
return daemon
else:
daemon.start()
except CannotListenError as ex:
log.error(
'Cannot start deluged, listen port in use.\n'
' Check for other running daemons or services using this port: %s:%s',
ex.interface,
ex.port,
)
sys.exit(1)
except Exception as ex:
log.error('Unable to start deluged: %s', ex)
if log.isEnabledFor(DEBUG):
log.exception(ex)
sys.exit(1)
finally:
log.info('Exiting...')
if options.pidfile:
os.remove(options.pidfile)
return run_profiled(
run_daemon, options, output_file=options.profile, do_profile=options.profile
)

View File

@ -1,44 +1,21 @@
#
# eventmanager.py
#
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import logging
import deluge.component as component
from deluge.log import LOG as log
log = logging.getLogger(__name__)
class EventManager(component.Component):
def __init__(self):
component.Component.__init__(self, "EventManager")
component.Component.__init__(self, 'EventManager')
self.handlers = {}
def emit(self, event):
@ -48,12 +25,20 @@ class EventManager(component.Component):
:param event: DelugeEvent
"""
# Emit the event to the interested clients
component.get("RPCServer").emit_event(event)
component.get('RPCServer').emit_event(event)
# Call any handlers for the event
if event.name in self.handlers:
for handler in self.handlers[event.name]:
#log.debug("Running handler %s for event %s with args: %s", event.name, handler, event.args)
handler(*event.args)
# log.debug('Running handler %s for event %s with args: %s', event.name, handler, event.args)
try:
handler(*event.args)
except Exception as ex:
log.error(
'Event handler %s failed in %s with exception %s',
event.name,
handler,
ex,
)
def register_event_handler(self, event, handler):
"""

View File

@ -1,120 +1,125 @@
#
# core.py
#
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import logging
import deluge.component as component
from deluge.log import LOG as log
from deluge.common import TORRENT_STATE
STATE_SORT = ["All", "Downloading", "Seeding", "Active", "Paused", "Queued"]
log = logging.getLogger(__name__)
#special purpose filters:
STATE_SORT = ['All', 'Active'] + TORRENT_STATE
# Special purpose filters:
def filter_keywords(torrent_ids, values):
#cleanup.
keywords = ",".join([v.lower() for v in values])
keywords = keywords.split(",")
# Cleanup
keywords = ','.join([v.lower() for v in values])
keywords = keywords.split(',')
for keyword in keywords:
torrent_ids = filter_one_keyword(torrent_ids, keyword)
return torrent_ids
def filter_one_keyword(torrent_ids, keyword):
"""
search torrent on keyword.
searches title,state,tracker-status,tracker,files
"""
all_torrents = component.get("TorrentManager").torrents
#filter:
found = False
all_torrents = component.get('TorrentManager').torrents
for torrent_id in torrent_ids:
torrent = all_torrents[torrent_id]
if keyword in torrent.filename.lower():
yield torrent_id
elif keyword in torrent.state.lower():
yield torrent_id
elif torrent.trackers and keyword in torrent.trackers[0]["url"]:
elif torrent.trackers and keyword in torrent.trackers[0]['url']:
yield torrent_id
elif keyword in torrent_id:
yield torrent_id
#i want to find broken torrents (search on "error", or "unregistered")
# Want to find broken torrents (search on "error", or "unregistered")
elif keyword in torrent.tracker_status.lower():
yield torrent_id
else:
for t_file in torrent.get_files():
if keyword in t_file["path"].lower():
if keyword in t_file['path'].lower():
yield torrent_id
break
def filter_by_name(torrent_ids, search_string):
all_torrents = component.get('TorrentManager').torrents
try:
search_string, match_case = search_string[0].split('::match')
except ValueError:
search_string = search_string[0]
match_case = False
if match_case is False:
search_string = search_string.lower()
for torrent_id in torrent_ids:
torrent_name = all_torrents[torrent_id].get_name()
if match_case is False:
torrent_name = all_torrents[torrent_id].get_name().lower()
else:
torrent_name = all_torrents[torrent_id].get_name()
if search_string in torrent_name:
yield torrent_id
def tracker_error_filter(torrent_ids, values):
filtered_torrent_ids = []
tm = component.get("TorrentManager")
tm = component.get('TorrentManager')
# If this is a tracker_host, then we need to filter on it
if values[0] != "Error":
if values[0] != 'Error':
for torrent_id in torrent_ids:
if values[0] == tm[torrent_id].get_status(["tracker_host"])["tracker_host"]:
if values[0] == tm[torrent_id].get_status(['tracker_host'])['tracker_host']:
filtered_torrent_ids.append(torrent_id)
return filtered_torrent_ids
# Check all the torrent's tracker_status for 'Error:' and only return torrent_ids
# that have this substring in their tracker_status
# Check torrent's tracker_status for 'Error:' and return those torrent_ids
for torrent_id in torrent_ids:
if "Error:" in tm[torrent_id].get_status(["tracker_status"])["tracker_status"]:
if 'Error:' in tm[torrent_id].get_status(['tracker_status'])['tracker_status']:
filtered_torrent_ids.append(torrent_id)
return filtered_torrent_ids
class FilterManager(component.Component):
"""FilterManager
"""
class FilterManager(component.Component):
"""FilterManager"""
def __init__(self, core):
component.Component.__init__(self, "FilterManager")
log.debug("FilterManager init..")
component.Component.__init__(self, 'FilterManager')
log.debug('FilterManager init..')
self.core = core
self.torrents = core.torrentmanager
self.registered_filters = {}
self.register_filter("keyword", filter_keywords)
self.register_filter('keyword', filter_keywords)
self.register_filter('name', filter_by_name)
self.tree_fields = {}
self.register_tree_field("state", self._init_state_tree)
def _init_tracker_tree():
return {"Error": 0}
self.register_tree_field("tracker_host", _init_tracker_tree)
self.register_tree_field('state', self._init_state_tree)
self.register_filter("tracker_host", tracker_error_filter)
def _init_tracker_tree():
return {'Error': 0}
self.register_tree_field('tracker_host', _init_tracker_tree)
self.register_filter('tracker_host', tracker_error_filter)
def _init_users_tree():
return {'': 0}
self.register_tree_field('owner', _init_users_tree)
def filter_torrent_ids(self, filter_dict):
"""
@ -124,55 +129,61 @@ class FilterManager(component.Component):
if not filter_dict:
return self.torrents.get_torrent_list()
#sanitize input: filter-value must be a list of strings
# Sanitize input: filter-value must be a list of strings
for key, value in filter_dict.items():
if isinstance(value, str):
filter_dict[key] = [value]
filter_dict[key] = [value]
if "id"in filter_dict: #optimized filter for id:
torrent_ids = filter_dict["id"]
del filter_dict["id"]
# Optimized filter for id
if 'id' in filter_dict:
torrent_ids = list(filter_dict['id'])
del filter_dict['id']
else:
torrent_ids = self.torrents.get_torrent_list()
if not filter_dict: #return if there's nothing more to filter
# Return if there's nothing more to filter
if not filter_dict:
return torrent_ids
#special purpose: state=Active.
if "state" in filter_dict:
# Special purpose, state=Active.
if 'state' in filter_dict:
# We need to make sure this is a list for the logic below
filter_dict["state"] = list(filter_dict["state"])
filter_dict['state'] = list(filter_dict['state'])
if "state" in filter_dict and "Active" in filter_dict["state"]:
filter_dict["state"].remove("Active")
if not filter_dict["state"]:
del filter_dict["state"]
if 'state' in filter_dict and 'Active' in filter_dict['state']:
filter_dict['state'].remove('Active')
if not filter_dict['state']:
del filter_dict['state']
torrent_ids = self.filter_state_active(torrent_ids)
if not filter_dict: #return if there's nothing more to filter
if not filter_dict:
return torrent_ids
#Registered filters:
for field, values in filter_dict.items():
# Registered filters
for field, values in list(filter_dict.items()):
if field in self.registered_filters:
# a set filters out the doubles.
torrent_ids = list(set(self.registered_filters[field](torrent_ids, values)))
# Filters out doubles
torrent_ids = list(
set(self.registered_filters[field](torrent_ids, values))
)
del filter_dict[field]
if not filter_dict: #return if there's nothing more to filter
if not filter_dict:
return torrent_ids
#leftover filter arguments:
#default filter on status fields.
status_func = self.core.get_torrent_status #premature optimalisation..
torrent_keys, plugin_keys = self.torrents.separate_keys(
list(filter_dict), torrent_ids
)
# Leftover filter arguments, default filter on status fields.
for torrent_id in list(torrent_ids):
status = status_func(torrent_id, filter_dict.keys()) #status={key:value}
for field, values in filter_dict.iteritems():
if (not status[field] in values) and torrent_id in torrent_ids:
status = self.core.create_torrent_status(
torrent_id, torrent_keys, plugin_keys
)
for field, values in filter_dict.items():
if field in status and status[field] in values:
continue
elif torrent_id in torrent_ids:
torrent_ids.remove(torrent_id)
return torrent_ids
def get_filter_tree(self, show_zero_hits=True, hide_cat=None):
@ -181,57 +192,58 @@ class FilterManager(component.Component):
for use in sidebar.
"""
torrent_ids = self.torrents.get_torrent_list()
status_func = self.core.get_torrent_status #premature optimalisation..
tree_keys = list(self.tree_fields.keys())
tree_keys = list(self.tree_fields)
if hide_cat:
for cat in hide_cat:
tree_keys.remove(cat)
items = dict( (field, self.tree_fields[field]()) for field in tree_keys)
torrent_keys, plugin_keys = self.torrents.separate_keys(tree_keys, torrent_ids)
items = {field: self.tree_fields[field]() for field in tree_keys}
#count status fields.
for torrent_id in list(torrent_ids):
status = status_func(torrent_id, tree_keys) #status={key:value}
status = self.core.create_torrent_status(
torrent_id, torrent_keys, plugin_keys
) # status={key:value}
for field in tree_keys:
value = status[field]
items[field][value] = items[field].get(value, 0) + 1
items["tracker_host"]["All"] = len(torrent_ids)
if 'tracker_host' in items:
items['tracker_host']['All'] = len(torrent_ids)
items['tracker_host']['Error'] = len(
tracker_error_filter(torrent_ids, ('Error',))
)
if "tracker_host" in items:
items["tracker_host"]["Error"] = len(tracker_error_filter(torrent_ids, ("Error",)))
if not show_zero_hits:
for cat in ['state', 'owner', 'tracker_host']:
if cat in tree_keys:
self._hide_state_items(items[cat])
if "state" in tree_keys and not show_zero_hits:
self._hide_state_items(items["state"])
# Return a dict of tuples:
sorted_items = {field: sorted(items[field].items()) for field in tree_keys}
#return a dict of tuples:
sorted_items = {}
for field in tree_keys:
sorted_items[field] = sorted(items[field].iteritems())
if "state" in tree_keys:
sorted_items["state"].sort(self._sort_state_items)
if 'state' in tree_keys:
sorted_items['state'].sort(key=self._sort_state_item)
return sorted_items
def _init_state_tree(self):
return {"All":len(self.torrents.get_torrent_list()),
"Downloading":0,
"Seeding":0,
"Paused":0,
"Checking":0,
"Queued":0,
"Error":0,
"Active":len(self.filter_state_active(self.torrents.get_torrent_list()))
}
init_state = {}
init_state['All'] = len(self.torrents.get_torrent_list())
for state in TORRENT_STATE:
init_state[state] = 0
init_state['Active'] = len(
self.filter_state_active(self.torrents.get_torrent_list())
)
return init_state
def register_filter(self, id, filter_func, filter_value = None):
self.registered_filters[id] = filter_func
def register_filter(self, filter_id, filter_func, filter_value=None):
self.registered_filters[filter_id] = filter_func
def deregister_filter(self, id):
del self.registered_filters[id]
def deregister_filter(self, filter_id):
del self.registered_filters[filter_id]
def register_tree_field(self, field, init_func = lambda : {}):
def register_tree_field(self, field, init_func=lambda: {}):
self.tree_fields[field] = init_func
def deregister_tree_field(self, field):
@ -239,30 +251,24 @@ class FilterManager(component.Component):
del self.tree_fields[field]
def filter_state_active(self, torrent_ids):
get_status = self.core.get_torrent_status
for torrent_id in list(torrent_ids):
status = get_status(torrent_id, ["download_payload_rate", "upload_payload_rate"])
if status["download_payload_rate"] or status["upload_payload_rate"]:
pass #ok
status = self.torrents[torrent_id].get_status(
['download_payload_rate', 'upload_payload_rate']
)
if status['download_payload_rate'] or status['upload_payload_rate']:
pass
else:
torrent_ids.remove(torrent_id)
return torrent_ids
def _hide_state_items(self, state_items):
"for hide(show)-zero hits"
for (value, count) in state_items.items():
if value != "All" and count == 0:
"""For hide(show)-zero hits"""
for value, count in list(state_items.items()):
if value != 'All' and count == 0:
del state_items[value]
def _sort_state_items(self, x, y):
""
if x[0] in STATE_SORT:
ix = STATE_SORT.index(x[0])
else:
ix = 99
if y[0] in STATE_SORT:
iy = STATE_SORT.index(y[0])
else:
iy = 99
return ix - iy
def _sort_state_item(self, item):
try:
return STATE_SORT.index(item[0])
except ValueError:
return 99

View File

@ -1,141 +0,0 @@
#
# oldstateupgrader.py
#
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#
#
import os
import os.path
import pickle
import cPickle
import shutil
from deluge._libtorrent import lt
from deluge.configmanager import ConfigManager, get_config_dir
import deluge.core.torrentmanager
from deluge.log import LOG as log
#start : http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286203
def makeFakeClass(module, name):
class FakeThing(object):
pass
FakeThing.__name__ = name
FakeThing.__module__ = '(fake)' + module
return FakeThing
class PickleUpgrader(pickle.Unpickler):
def find_class(self, module, cname):
# Pickle tries to load a couple things like copy_reg and
# __builtin__.object even though a pickle file doesn't
# explicitly reference them (afaict): allow them to be loaded
# normally.
if module in ('copy_reg', '__builtin__'):
thing = pickle.Unpickler.find_class(self, module, cname)
return thing
return makeFakeClass(module, cname)
# end: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286203
class OldStateUpgrader:
def __init__(self):
self.config = ConfigManager("core.conf")
self.state05_location = os.path.join(get_config_dir(), "persistent.state")
self.state10_location = os.path.join(get_config_dir(), "state", "torrents.state")
if os.path.exists(self.state05_location) and not os.path.exists(self.state10_location):
# If the 0.5 state file exists and the 1.0 doesn't, then let's upgrade it
self.upgrade05()
def upgrade05(self):
try:
state = PickleUpgrader(open(self.state05_location, "rb")).load()
except Exception, e:
log.debug("Unable to open 0.5 state file: %s", e)
return
# Check to see if we can upgrade this file
if type(state).__name__ == 'list':
log.warning("0.5 state file is too old to upgrade")
return
new_state = deluge.core.torrentmanager.TorrentManagerState()
for ti, uid in state.torrents.items():
torrent_path = os.path.join(get_config_dir(), "torrentfiles", ti.filename)
try:
torrent_info = None
log.debug("Attempting to create torrent_info from %s", torrent_path)
_file = open(torrent_path, "rb")
torrent_info = lt.torrent_info(lt.bdecode(_file.read()))
_file.close()
except (IOError, RuntimeError), e:
log.warning("Unable to open %s: %s", torrent_path, e)
# Copy the torrent file to the new location
import shutil
shutil.copyfile(torrent_path, os.path.join(get_config_dir(), "state", str(torrent_info.info_hash()) + ".torrent"))
# Set the file prioritiy property if not already there
if not hasattr(ti, "priorities"):
ti.priorities = [1] * torrent_info.num_files()
# Create the new TorrentState object
new_torrent = deluge.core.torrentmanager.TorrentState(
torrent_id=str(torrent_info.info_hash()),
filename=ti.filename,
save_path=ti.save_dir,
compact=ti.compact,
paused=ti.user_paused,
total_uploaded=ti.uploaded_memory,
max_upload_speed=ti.upload_rate_limit,
max_download_speed=ti.download_rate_limit,
file_priorities=ti.priorities,
queue=state.queue.index(ti)
)
# Append the object to the state list
new_state.torrents.append(new_torrent)
# Now we need to write out the new state file
try:
log.debug("Saving torrent state file.")
state_file = open(
os.path.join(get_config_dir(), "state", "torrents.state"), "wb")
cPickle.dump(new_state, state_file)
state_file.close()
except IOError, e:
log.warning("Unable to save state file: %s", e)
return
# Rename the persistent.state file
try:
os.rename(self.state05_location, self.state05_location + ".old")
except Exception, e:
log.debug("Unable to rename old persistent.state file! %s", e)

View File

@ -1,62 +1,37 @@
#
# pluginmanager.py
#
# Copyright (C) 2007 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
"""PluginManager for Core"""
import logging
from twisted.internet import reactor
from twisted.internet.task import LoopingCall
from twisted.internet import defer
from deluge.event import PluginEnabledEvent, PluginDisabledEvent
import deluge.pluginmanagerbase
import deluge.component as component
from deluge.log import LOG as log
import deluge.pluginmanagerbase
from deluge.event import PluginDisabledEvent, PluginEnabledEvent
class PluginManager(deluge.pluginmanagerbase.PluginManagerBase,
component.Component):
log = logging.getLogger(__name__)
class PluginManager(deluge.pluginmanagerbase.PluginManagerBase, component.Component):
"""PluginManager handles the loading of plugins and provides plugins with
functions to access parts of the core."""
def __init__(self, core):
component.Component.__init__(self, "CorePluginManager")
component.Component.__init__(self, 'CorePluginManager')
self.status_fields = {}
# Call the PluginManagerBase constructor
deluge.pluginmanagerbase.PluginManagerBase.__init__(
self, "core.conf", "deluge.plugin.core")
self, 'core.conf', 'deluge.plugin.core'
)
def start(self):
# Enable plugins that are enabled in the config
@ -70,28 +45,44 @@ class PluginManager(deluge.pluginmanagerbase.PluginManagerBase,
self.stop()
def update_plugins(self):
for plugin in self.plugins.keys():
if hasattr(self.plugins[plugin], "update"):
for plugin in self.plugins:
if hasattr(self.plugins[plugin], 'update'):
try:
self.plugins[plugin].update()
except Exception, e:
log.exception(e)
except Exception as ex:
log.exception(ex)
def enable_plugin(self, name):
d = defer.succeed(True)
if name not in self.plugins:
super(PluginManager, self).enable_plugin(name)
if name in self.plugins:
component.get("EventManager").emit(PluginEnabledEvent(name))
d = deluge.pluginmanagerbase.PluginManagerBase.enable_plugin(self, name)
def on_enable_plugin(result):
if result is True and name in self.plugins:
component.get('EventManager').emit(PluginEnabledEvent(name))
return result
d.addBoth(on_enable_plugin)
return d
def disable_plugin(self, name):
d = defer.succeed(True)
if name in self.plugins:
super(PluginManager, self).disable_plugin(name)
if name not in self.plugins:
component.get("EventManager").emit(PluginDisabledEvent(name))
d = deluge.pluginmanagerbase.PluginManagerBase.disable_plugin(self, name)
def on_disable_plugin(result):
if name not in self.plugins:
component.get('EventManager').emit(PluginDisabledEvent(name))
return result
d.addBoth(on_disable_plugin)
return d
def get_status(self, torrent_id, fields):
"""Return the value of status fields for the selected torrent_id."""
status = {}
if len(fields) == 0:
fields = list(self.status_fields)
for field in fields:
try:
status[field] = self.status_fields[field](torrent_id)
@ -102,13 +93,13 @@ class PluginManager(deluge.pluginmanagerbase.PluginManagerBase,
def register_status_field(self, field, function):
"""Register a new status field. This can be used in the same way the
client requests other status information from core."""
log.debug("Registering status field %s with PluginManager", field)
log.debug('Registering status field %s with PluginManager', field)
self.status_fields[field] = function
def deregister_status_field(self, field):
"""Deregisters a status field"""
log.debug("Deregistering status field %s with PluginManager", field)
log.debug('Deregistering status field %s with PluginManager', field)
try:
del self.status_fields[field]
except:
log.warning("Unable to deregister status field %s", field)
except Exception:
log.warning('Unable to deregister status field %s', field)

View File

@ -1,523 +1,476 @@
#
# preferencesmanager.py
#
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
# Copyright (C) 2008-2010 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import os.path
import logging
import os
import platform
import random
import threading
import pkg_resources
from twisted.internet import reactor
from urllib.parse import quote_plus
from urllib.request import urlopen
from twisted.internet.task import LoopingCall
from deluge._libtorrent import lt
from deluge.event import *
import deluge.configmanager
import deluge.common
import deluge.component as component
from deluge.log import LOG as log
import deluge.configmanager
from deluge._libtorrent import lt
from deluge.event import ConfigValueChangedEvent
GeoIP = None
try:
from GeoIP import GeoIP
except ImportError:
try:
from pygeoip import GeoIP
except ImportError:
pass
log = logging.getLogger(__name__)
DEFAULT_PREFS = {
"send_info": False,
"info_sent": 0.0,
"daemon_port": 58846,
"allow_remote": False,
"compact_allocation": False,
"download_location": deluge.common.get_default_download_dir(),
"listen_ports": [6881, 6891],
"listen_interface": "",
"copy_torrent_file": False,
"del_copy_torrent_file": False,
"torrentfiles_location": deluge.common.get_default_download_dir(),
"plugins_location": os.path.join(deluge.configmanager.get_config_dir(), "plugins"),
"prioritize_first_last_pieces": False,
"random_port": True,
"dht": True,
"upnp": True,
"natpmp": True,
"utpex": True,
"lsd": True,
"enc_in_policy": 1,
"enc_out_policy": 1,
"enc_level": 2,
"enc_prefer_rc4": True,
"max_connections_global": 200,
"max_upload_speed": -1.0,
"max_download_speed": -1.0,
"max_upload_slots_global": 4,
"max_half_open_connections": (lambda: deluge.common.windows_check() and
(lambda: deluge.common.vista_check() and 4 or 8)() or 50)(),
"max_connections_per_second": 20,
"ignore_limits_on_local_network": True,
"max_connections_per_torrent": -1,
"max_upload_slots_per_torrent": -1,
"max_upload_speed_per_torrent": -1,
"max_download_speed_per_torrent": -1,
"enabled_plugins": [],
"autoadd_location": deluge.common.get_default_download_dir(),
"autoadd_enable": False,
"add_paused": False,
"max_active_seeding": 5,
"max_active_downloading": 3,
"max_active_limit": 8,
"dont_count_slow_torrents": False,
"queue_new_to_top": False,
"stop_seed_at_ratio": False,
"remove_seed_at_ratio": False,
"stop_seed_ratio": 2.00,
"share_ratio_limit": 2.00,
"seed_time_ratio_limit": 7.00,
"seed_time_limit": 180,
"auto_managed": True,
"move_completed": False,
"move_completed_path": deluge.common.get_default_download_dir(),
"new_release_check": True,
"proxies": {
"peer": {
"type": 0,
"hostname": "",
"username": "",
"password": "",
"port": 8080
},
"web_seed": {
"type": 0,
"hostname": "",
"username": "",
"password": "",
"port": 8080
},
"tracker": {
"type": 0,
"hostname": "",
"username": "",
"password": "",
"port": 8080
},
"dht": {
"type": 0,
"hostname": "",
"username": "",
"password": "",
"port": 8080
},
'send_info': False,
'info_sent': 0.0,
'daemon_port': 58846,
'allow_remote': False,
'pre_allocate_storage': False,
'download_location': deluge.common.get_default_download_dir(),
'listen_ports': [6881, 6891],
'listen_interface': '',
'outgoing_interface': '',
'random_port': True,
'listen_random_port': None,
'listen_use_sys_port': False,
'listen_reuse_port': True,
'outgoing_ports': [0, 0],
'random_outgoing_ports': True,
'copy_torrent_file': False,
'del_copy_torrent_file': False,
'torrentfiles_location': deluge.common.get_default_download_dir(),
'plugins_location': os.path.join(deluge.configmanager.get_config_dir(), 'plugins'),
'prioritize_first_last_pieces': False,
'sequential_download': False,
'dht': True,
'upnp': True,
'natpmp': True,
'utpex': True,
'lsd': True,
'enc_in_policy': 1,
'enc_out_policy': 1,
'enc_level': 2,
'max_connections_global': 200,
'max_upload_speed': -1.0,
'max_download_speed': -1.0,
'max_upload_slots_global': 4,
'max_half_open_connections': (
lambda: deluge.common.windows_check()
and (lambda: deluge.common.vista_check() and 4 or 8)()
or 50
)(),
'max_connections_per_second': 20,
'ignore_limits_on_local_network': True,
'max_connections_per_torrent': -1,
'max_upload_slots_per_torrent': -1,
'max_upload_speed_per_torrent': -1,
'max_download_speed_per_torrent': -1,
'enabled_plugins': [],
'add_paused': False,
'max_active_seeding': 5,
'max_active_downloading': 3,
'max_active_limit': 8,
'dont_count_slow_torrents': False,
'queue_new_to_top': False,
'stop_seed_at_ratio': False,
'remove_seed_at_ratio': False,
'stop_seed_ratio': 2.00,
'share_ratio_limit': 2.00,
'seed_time_ratio_limit': 7.00,
'seed_time_limit': 180,
'auto_managed': True,
'move_completed': False,
'move_completed_path': deluge.common.get_default_download_dir(),
'move_completed_paths_list': [],
'download_location_paths_list': [],
'path_chooser_show_chooser_button_on_localhost': True,
'path_chooser_auto_complete_enabled': True,
'path_chooser_accelerator_string': 'Tab',
'path_chooser_max_popup_rows': 20,
'path_chooser_show_hidden_files': False,
'new_release_check': True,
'proxy': {
'type': 0,
'hostname': '',
'username': '',
'password': '',
'port': 8080,
'proxy_hostnames': True,
'proxy_peer_connections': True,
'proxy_tracker_connections': True,
'force_proxy': False,
'anonymous_mode': False,
},
"outgoing_ports": [0, 0],
"random_outgoing_ports": True,
"peer_tos": "0x00",
"rate_limit_ip_overhead": True,
"geoip_db_location": "/usr/share/GeoIP/GeoIP.dat",
"cache_size": 512,
"cache_expiry": 60
'peer_tos': '0x00',
'rate_limit_ip_overhead': True,
'geoip_db_location': '/usr/share/GeoIP/GeoIP.dat',
'cache_size': 512,
'cache_expiry': 60,
'auto_manage_prefer_seeds': False,
'shared': False,
'super_seeding': False,
}
class PreferencesManager(component.Component):
def __init__(self):
component.Component.__init__(self, "PreferencesManager")
component.Component.__init__(self, 'PreferencesManager')
self.config = deluge.configmanager.ConfigManager('core.conf', DEFAULT_PREFS)
if 'proxies' in self.config:
log.warning(
'Updating config file for proxy, using "peer" values to fill new "proxy" setting'
)
self.config['proxy'].update(self.config['proxies']['peer'])
log.warning('New proxy config is: %s', self.config['proxy'])
del self.config['proxies']
if 'i2p_proxy' in self.config and self.config['i2p_proxy']['hostname']:
self.config['proxy'].update(self.config['i2p_proxy'])
self.config['proxy']['type'] = 6
del self.config['i2p_proxy']
if 'anonymous_mode' in self.config:
self.config['proxy']['anonymous_mode'] = self.config['anonymous_mode']
del self.config['anonymous_mode']
if 'proxy' in self.config:
for key in DEFAULT_PREFS['proxy']:
if key not in self.config['proxy']:
self.config['proxy'][key] = DEFAULT_PREFS['proxy'][key]
self.config = deluge.configmanager.ConfigManager("core.conf", DEFAULT_PREFS)
self.core = component.get('Core')
self.new_release_timer = None
def start(self):
self.core = component.get("Core")
self.session = component.get("Core").session
self.settings = component.get("Core").settings
# Register set functions in the Config
self.config.register_set_function("torrentfiles_location",
self._on_set_torrentfiles_location)
self.config.register_set_function("listen_ports",
self._on_set_listen_ports)
self.config.register_set_function("listen_interface",
self._on_set_listen_interface)
self.config.register_set_function("random_port",
self._on_set_random_port)
self.config.register_set_function("outgoing_ports",
self._on_set_outgoing_ports)
self.config.register_set_function("random_outgoing_ports",
self._on_set_random_outgoing_ports)
self.config.register_set_function("peer_tos",
self._on_set_peer_tos)
self.config.register_set_function("dht", self._on_set_dht)
self.config.register_set_function("upnp", self._on_set_upnp)
self.config.register_set_function("natpmp", self._on_set_natpmp)
self.config.register_set_function("utpex", self._on_set_utpex)
self.config.register_set_function("lsd", self._on_set_lsd)
self.config.register_set_function("enc_in_policy",
self._on_set_encryption)
self.config.register_set_function("enc_out_policy",
self._on_set_encryption)
self.config.register_set_function("enc_level",
self._on_set_encryption)
self.config.register_set_function("enc_prefer_rc4",
self._on_set_encryption)
self.config.register_set_function("max_connections_global",
self._on_set_max_connections_global)
self.config.register_set_function("max_upload_speed",
self._on_set_max_upload_speed)
self.config.register_set_function("max_download_speed",
self._on_set_max_download_speed)
self.config.register_set_function("max_upload_slots_global",
self._on_set_max_upload_slots_global)
self.config.register_set_function("max_half_open_connections",
self._on_set_max_half_open_connections)
self.config.register_set_function("max_connections_per_second",
self._on_set_max_connections_per_second)
self.config.register_set_function("ignore_limits_on_local_network",
self._on_ignore_limits_on_local_network)
self.config.register_set_function("share_ratio_limit",
self._on_set_share_ratio_limit)
self.config.register_set_function("seed_time_ratio_limit",
self._on_set_seed_time_ratio_limit)
self.config.register_set_function("seed_time_limit",
self._on_set_seed_time_limit)
self.config.register_set_function("max_active_downloading",
self._on_set_max_active_downloading)
self.config.register_set_function("max_active_seeding",
self._on_set_max_active_seeding)
self.config.register_set_function("max_active_limit",
self._on_set_max_active_limit)
self.config.register_set_function("dont_count_slow_torrents",
self._on_set_dont_count_slow_torrents)
self.config.register_set_function("send_info",
self._on_send_info)
self.config.register_set_function("proxies",
self._on_set_proxies)
self.new_release_timer = None
self.config.register_set_function("new_release_check",
self._on_new_release_check)
self.config.register_set_function("rate_limit_ip_overhead",
self._on_rate_limit_ip_overhead)
self.config.register_set_function("geoip_db_location",
self._on_geoip_db_location)
self.config.register_set_function("cache_size",
self._on_cache_size)
self.config.register_set_function("cache_expiry",
self._on_cache_expiry)
# Set the initial preferences on start-up
for key in DEFAULT_PREFS:
self.do_config_set_func(key, self.config[key])
self.config.register_change_callback(self._on_config_value_change)
def stop(self):
if self.new_release_timer:
if self.new_release_timer and self.new_release_timer.running:
self.new_release_timer.stop()
# Config set functions
def do_config_set_func(self, key, value):
on_set_func = getattr(self, '_on_set_' + key, None)
if on_set_func:
if log.isEnabledFor(logging.DEBUG):
log.debug('Config key: %s set to %s..', key, value)
on_set_func(key, value)
def _on_config_value_change(self, key, value):
component.get("EventManager").emit(ConfigValueChangedEvent(key, value))
if self.get_state() == 'Started':
self.do_config_set_func(key, value)
component.get('EventManager').emit(ConfigValueChangedEvent(key, value))
def _on_set_torrentfiles_location(self, key, value):
if self.config["copy_torrent_file"]:
if self.config['copy_torrent_file']:
try:
os.makedirs(value)
except Exception, e:
log.debug("Unable to make directory: %s", e)
except OSError as ex:
log.debug('Unable to make directory: %s', ex)
def _on_set_listen_ports(self, key, value):
# Only set the listen ports if random_port is not true
if self.config["random_port"] is not True:
log.debug("listen port range set to %s-%s", value[0], value[1])
self.session.listen_on(value[0], value[1], str(self.config["listen_interface"]))
self.__set_listen_on()
def _on_set_listen_interface(self, key, value):
# Call the random_port callback since it'll do what we need
self._on_set_random_port("random_port", self.config["random_port"])
self.__set_listen_on()
def _on_set_outgoing_interface(self, key, value):
"""Set interface name or IP address for outgoing BitTorrent connections."""
value = value.strip() if value else ''
self.core.apply_session_settings({'outgoing_interfaces': value})
def _on_set_random_port(self, key, value):
log.debug("random port value set to %s", value)
# We need to check if the value has been changed to true and false
# and then handle accordingly.
if value:
import random
listen_ports = []
randrange = lambda: random.randrange(49152, 65525)
listen_ports.append(randrange())
listen_ports.append(listen_ports[0]+10)
else:
listen_ports = self.config["listen_ports"]
self.__set_listen_on()
# Set the listen ports
log.debug("listen port range set to %s-%s", listen_ports[0],
listen_ports[1])
self.session.listen_on(listen_ports[0], listen_ports[1], str(self.config["listen_interface"]))
def __set_listen_on(self):
"""Set the ports and interface address to listen for incoming connections on."""
if self.config['random_port']:
if not self.config['listen_random_port']:
self.config['listen_random_port'] = random.randrange(49152, 65525)
listen_ports = [
self.config['listen_random_port']
] * 2 # use single port range
else:
self.config['listen_random_port'] = None
listen_ports = self.config['listen_ports']
if self.config['listen_interface']:
interface = self.config['listen_interface'].strip()
else:
interface = '0.0.0.0'
log.debug(
'Listen Interface: %s, Ports: %s with use_sys_port: %s',
interface,
listen_ports,
self.config['listen_use_sys_port'],
)
interfaces = [
f'{interface}:{port}'
for port in range(listen_ports[0], listen_ports[1] + 1)
]
self.core.apply_session_settings(
{
'listen_system_port_fallback': self.config['listen_use_sys_port'],
'listen_interfaces': ','.join(interfaces),
}
)
def _on_set_outgoing_ports(self, key, value):
if not self.config["random_outgoing_ports"]:
log.debug("outgoing port range set to %s-%s", value[0], value[1])
self.settings.outgoing_ports = value[0], value[1]
self.session.set_settings(self.settings)
self.__set_outgoing_ports()
def _on_set_random_outgoing_ports(self, key, value):
if value:
self.session.outgoing_ports(0, 0)
self.__set_outgoing_ports()
def __set_outgoing_ports(self):
port = (
0
if self.config['random_outgoing_ports']
else self.config['outgoing_ports'][0]
)
if port:
num_ports = (
self.config['outgoing_ports'][1] - self.config['outgoing_ports'][0]
)
num_ports = num_ports if num_ports > 1 else 5
else:
num_ports = 0
log.debug('Outgoing port set to %s with range: %s', port, num_ports)
self.core.apply_session_settings(
{'outgoing_port': port, 'num_outgoing_ports': num_ports}
)
def _on_set_peer_tos(self, key, value):
log.debug("setting peer_tos to: %s", value)
try:
self.settings.peer_tos = chr(int(value, 16))
except ValueError, e:
log.debug("Invalid tos byte: %s", e)
return
self.session.set_settings(self.settings)
self.core.apply_session_setting('peer_tos', int(value, 16))
except ValueError as ex:
log.error('Invalid tos byte: %s', ex)
def _on_set_dht(self, key, value):
log.debug("dht value set to %s", value)
state_file = deluge.configmanager.get_config_dir("dht.state")
if value:
state = None
try:
state = lt.bdecode(open(state_file, "rb").read())
except Exception, e:
log.warning("Unable to read DHT state file: %s", e)
try:
self.session.start_dht(state)
except Exception, e:
log.warning("Restoring old DHT state failed: %s", e)
self.session.start_dht(None)
self.session.add_dht_router("router.bittorrent.com", 6881)
self.session.add_dht_router("router.utorrent.com", 6881)
self.session.add_dht_router("router.bitcomet.com", 6881)
else:
self.core.save_dht_state()
self.session.stop_dht()
lt_bootstraps = self.core.session.get_settings()['dht_bootstrap_nodes']
# Update list of lt bootstraps, using set to remove duplicates.
dht_bootstraps = set(
lt_bootstraps.split(',')
+ [
'router.bittorrent.com:6881',
'router.utorrent.com:6881',
'router.bitcomet.com:6881',
'dht.transmissionbt.com:6881',
'dht.aelitis.com:6881',
]
)
self.core.apply_session_settings(
{'dht_bootstrap_nodes': ','.join(dht_bootstraps), 'enable_dht': value}
)
def _on_set_upnp(self, key, value):
log.debug("upnp value set to %s", value)
if value:
self.session.start_upnp()
else:
self.session.stop_upnp()
self.core.apply_session_setting('enable_upnp', value)
def _on_set_natpmp(self, key, value):
log.debug("natpmp value set to %s", value)
if value:
self.session.start_natpmp()
else:
self.session.stop_natpmp()
self.core.apply_session_setting('enable_natpmp', value)
def _on_set_lsd(self, key, value):
log.debug("lsd value set to %s", value)
if value:
self.session.start_lsd()
else:
self.session.stop_lsd()
self.core.apply_session_setting('enable_lsd', value)
def _on_set_utpex(self, key, value):
log.debug("utpex value set to %s", value)
if value:
self.session.add_extension(lt.create_ut_pex_plugin)
self.core.session.add_extension('ut_pex')
def _on_set_enc_in_policy(self, key, value):
self._on_set_encryption(key, value)
def _on_set_enc_out_policy(self, key, value):
self._on_set_encryption(key, value)
def _on_set_enc_level(self, key, value):
self._on_set_encryption(key, value)
def _on_set_encryption(self, key, value):
log.debug("encryption value %s set to %s..", key, value)
pe_settings = lt.pe_settings()
pe_settings.out_enc_policy = \
lt.enc_policy(self.config["enc_out_policy"])
pe_settings.in_enc_policy = lt.enc_policy(self.config["enc_in_policy"])
pe_settings.allowed_enc_level = lt.enc_level(self.config["enc_level"])
pe_settings.prefer_rc4 = self.config["enc_prefer_rc4"]
self.session.set_pe_settings(pe_settings)
set = self.session.get_pe_settings()
log.debug("encryption settings:\n\t\t\tout_policy: %s\n\t\t\
in_policy: %s\n\t\t\tlevel: %s\n\t\t\tprefer_rc4: %s",
set.out_enc_policy,
set.in_enc_policy,
set.allowed_enc_level,
set.prefer_rc4)
# Convert Deluge enc_level values to libtorrent enc_level values.
pe_enc_level = {
0: lt.enc_level.plaintext,
1: lt.enc_level.rc4,
2: lt.enc_level.both,
}
self.core.apply_session_settings(
{
'out_enc_policy': lt.enc_policy(self.config['enc_out_policy']),
'in_enc_policy': lt.enc_policy(self.config['enc_in_policy']),
'allowed_enc_level': lt.enc_level(
pe_enc_level[self.config['enc_level']]
),
'prefer_rc4': True,
}
)
def _on_set_max_connections_global(self, key, value):
log.debug("max_connections_global set to %s..", value)
self.session.set_max_connections(value)
self.core.apply_session_setting('connections_limit', value)
def _on_set_max_upload_speed(self, key, value):
log.debug("max_upload_speed set to %s..", value)
# We need to convert Kb/s to B/s
if value < 0:
v = -1
else:
v = int(value * 1024)
self.session.set_upload_rate_limit(v)
value = -1 if value < 0 else int(value * 1024)
self.core.apply_session_setting('upload_rate_limit', value)
def _on_set_max_download_speed(self, key, value):
log.debug("max_download_speed set to %s..", value)
# We need to convert Kb/s to B/s
if value < 0:
v = -1
else:
v = int(value * 1024)
self.session.set_download_rate_limit(v)
value = -1 if value < 0 else int(value * 1024)
self.core.apply_session_setting('download_rate_limit', value)
def _on_set_max_upload_slots_global(self, key, value):
log.debug("max_upload_slots_global set to %s..", value)
self.session.set_max_uploads(value)
self.core.apply_session_setting('unchoke_slots_limit', value)
def _on_set_max_half_open_connections(self, key, value):
self.session.set_max_half_open_connections(value)
self.core.apply_session_setting('half_open_limit', value)
def _on_set_max_connections_per_second(self, key, value):
self.settings.connection_speed = value
self.session.set_settings(self.settings)
self.core.apply_session_setting('connection_speed', value)
def _on_ignore_limits_on_local_network(self, key, value):
self.settings.ignore_limits_on_local_network = value
self.session.set_settings(self.settings)
def _on_set_ignore_limits_on_local_network(self, key, value):
self.core.apply_session_setting('ignore_limits_on_local_network', value)
def _on_set_share_ratio_limit(self, key, value):
log.debug("%s set to %s..", key, value)
self.settings.share_ratio_limit = value
self.session.set_settings(self.settings)
# This value is a float percentage in deluge, but libtorrent needs int percentage.
self.core.apply_session_setting('share_ratio_limit', int(value * 100))
def _on_set_seed_time_ratio_limit(self, key, value):
log.debug("%s set to %s..", key, value)
self.settings.seed_time_ratio_limit = value
self.session.set_settings(self.settings)
# This value is a float percentage in deluge, but libtorrent needs int percentage.
self.core.apply_session_setting('seed_time_ratio_limit', int(value * 100))
def _on_set_seed_time_limit(self, key, value):
log.debug("%s set to %s..", key, value)
# This value is stored in minutes in deluge, but libtorrent wants seconds
self.settings.seed_time_limit = int(value * 60)
self.session.set_settings(self.settings)
self.core.apply_session_setting('seed_time_limit', int(value * 60))
def _on_set_max_active_downloading(self, key, value):
log.debug("%s set to %s..", key, value)
log.debug("active_downloads: %s", self.settings.active_downloads)
self.settings.active_downloads = value
self.session.set_settings(self.settings)
self.core.apply_session_setting('active_downloads', value)
def _on_set_max_active_seeding(self, key, value):
log.debug("%s set to %s..", key, value)
log.debug("active_seeds: %s", self.settings.active_seeds)
self.settings.active_seeds = value
self.session.set_settings(self.settings)
self.core.apply_session_setting('active_seeds', value)
def _on_set_max_active_limit(self, key, value):
log.debug("%s set to %s..", key, value)
log.debug("active_limit: %s", self.settings.active_limit)
self.settings.active_limit = value
self.session.set_settings(self.settings)
self.core.apply_session_setting('active_limit', value)
def _on_set_dont_count_slow_torrents(self, key, value):
log.debug("%s set to %s..", key, value)
self.settings.dont_count_slow_torrents = value
self.session.set_settings(self.settings)
self.core.apply_session_setting('dont_count_slow_torrents', value)
def _on_send_info(self, key, value):
log.debug("Sending anonymous stats..")
def _on_set_send_info(self, key, value):
"""sends anonymous stats home"""
class Send_Info_Thread(threading.Thread):
log.debug('Sending anonymous stats..')
class SendInfoThread(threading.Thread):
def __init__(self, config):
self.config = config
threading.Thread.__init__(self)
def run(self):
import time
now = time.time()
# check if we've done this within the last week or never
if (now - self.config["info_sent"]) >= (60 * 60 * 24 * 7):
import deluge.common
from urllib import quote_plus
from urllib2 import urlopen
import platform
if (now - self.config['info_sent']) >= (60 * 60 * 24 * 7):
try:
url = "http://deluge-torrent.org/stats_get.php?processor=" + \
platform.machine() + "&python=" + platform.python_version() \
+ "&deluge=" + deluge.common.get_version() \
+ "&os=" + platform.system() \
+ "&plugins=" + quote_plus(":".join(self.config["enabled_plugins"]))
url = (
'http://deluge-torrent.org/stats_get.php?processor='
+ platform.machine()
+ '&python='
+ platform.python_version()
+ '&deluge='
+ deluge.common.get_version()
+ '&os='
+ platform.system()
+ '&plugins='
+ quote_plus(':'.join(self.config['enabled_plugins']))
)
urlopen(url)
except IOError, e:
log.debug("Network error while trying to send info: %s", e)
except OSError as ex:
log.debug('Network error while trying to send info: %s', ex)
else:
self.config["info_sent"] = now
if value:
Send_Info_Thread(self.config).start()
self.config['info_sent'] = now
def _on_new_release_check(self, key, value):
if value:
log.debug("Checking for new release..")
SendInfoThread(self.config).start()
def _on_set_new_release_check(self, key, value):
if value:
log.debug('Checking for new release..')
threading.Thread(target=self.core.get_new_release).start()
if self.new_release_timer:
if self.new_release_timer and self.new_release_timer.running:
self.new_release_timer.stop()
# Set a timer to check for a new release every 3 days
self.new_release_timer = LoopingCall(
self._on_new_release_check, "new_release_check", True)
self._on_set_new_release_check, 'new_release_check', True
)
self.new_release_timer.start(72 * 60 * 60, False)
else:
if self.new_release_timer:
if self.new_release_timer and self.new_release_timer.running:
self.new_release_timer.stop()
def _on_set_proxies(self, key, value):
for k, v in value.items():
if v["type"]:
proxy_settings = lt.proxy_settings()
proxy_settings.type = lt.proxy_type(v["type"])
proxy_settings.username = str(v["username"])
proxy_settings.password = str(v["password"])
proxy_settings.hostname = str(v["hostname"])
proxy_settings.port = v["port"]
log.debug("setting %s proxy settings", k)
getattr(self.session, "set_%s_proxy" % k)(proxy_settings)
def _on_set_proxy(self, key, value):
# Initialise with type none and blank hostnames.
proxy_settings = {
'proxy_type': lt.proxy_type_t.none,
'i2p_hostname': '',
'proxy_hostname': '',
'proxy_hostnames': value['proxy_hostnames'],
'proxy_peer_connections': value['proxy_peer_connections'],
'proxy_tracker_connections': value['proxy_tracker_connections'],
'force_proxy': value['force_proxy'],
'anonymous_mode': value['anonymous_mode'],
}
def _on_rate_limit_ip_overhead(self, key, value):
log.debug("%s: %s", key, value)
self.settings.rate_limit_ip_overhead = value
self.session.set_settings(self.settings)
if value['type'] == lt.proxy_type_t.i2p_proxy:
proxy_settings.update(
{
'proxy_type': lt.proxy_type_t.i2p_proxy,
'i2p_hostname': value['hostname'],
'i2p_port': value['port'],
}
)
elif value['type'] != lt.proxy_type_t.none:
proxy_settings.update(
{
'proxy_type': value['type'],
'proxy_hostname': value['hostname'],
'proxy_port': value['port'],
'proxy_username': value['username'],
'proxy_password': value['password'],
}
)
def _on_geoip_db_location(self, key, value):
log.debug("%s: %s", key, value)
self.core.apply_session_settings(proxy_settings)
def _on_set_rate_limit_ip_overhead(self, key, value):
self.core.apply_session_setting('rate_limit_ip_overhead', value)
def _on_set_geoip_db_location(self, key, geoipdb_path):
# Load the GeoIP DB for country look-ups if available
geoip_db = ""
if os.path.exists(value):
geoip_db = value
elif os.path.exists(pkg_resources.resource_filename("deluge", os.path.join("data", "GeoIP.dat"))):
geoip_db = pkg_resources.resource_filename("deluge", os.path.join("data", "GeoIP.dat"))
else:
log.warning("Unable to find GeoIP database file!")
if geoip_db:
if os.path.exists(geoipdb_path):
try:
self.session.load_country_db(str(geoip_db))
except Exception, e:
log.error("Unable to load geoip database!")
log.exception(e)
self.core.geoip_instance = GeoIP(geoipdb_path, 0)
except Exception as ex:
log.warning('GeoIP Unavailable: %s', ex)
else:
log.warning('Unable to find GeoIP database file: %s', geoipdb_path)
def _on_cache_size(self, key, value):
log.debug("%s: %s", key, value)
self.settings.cache_size = value
self.session.set_settings(self.settings)
def _on_set_cache_size(self, key, value):
self.core.apply_session_setting('cache_size', value)
def _on_cache_expiry(self, key, value):
log.debug("%s: %s", key, value)
self.settings.cache_expiry = value
self.session.set_settings(self.settings)
def _on_set_cache_expiry(self, key, value):
self.core.apply_session_setting('cache_expiry', value)
def _on_auto_manage_prefer_seeds(self, key, value):
self.core.apply_session_setting('auto_manage_prefer_seeds', value)

View File

@ -1,63 +1,60 @@
#
# rpcserver.py
#
# Copyright (C) 2008,2009 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
"""RPCServer Module"""
import sys
import zlib
import logging
import os
import stat
import sys
import traceback
from twisted.internet.protocol import Factory, Protocol
from twisted.internet import ssl, reactor, defer
from OpenSSL import crypto, SSL
from collections import namedtuple
from types import FunctionType
from typing import Callable, TypeVar, overload
import deluge.rencode as rencode
from deluge.log import LOG as log
from twisted.internet import defer, reactor
from twisted.internet.protocol import Factory, connectionDone
import deluge.component as component
import deluge.configmanager
from deluge.core.authmanager import AUTH_LEVEL_NONE, AUTH_LEVEL_DEFAULT
from deluge.core.authmanager import (
AUTH_LEVEL_ADMIN,
AUTH_LEVEL_DEFAULT,
AUTH_LEVEL_NONE,
)
from deluge.crypto_utils import check_ssl_keys, get_context_factory
from deluge.error import (
DelugeError,
IncompatibleClient,
NotAuthorizedError,
WrappedException,
_ClientSideRecreateError,
)
from deluge.event import ClientDisconnectedEvent
from deluge.transfer import DelugeTransferProtocol
RPC_RESPONSE = 1
RPC_ERROR = 2
RPC_EVENT = 3
log = logging.getLogger(__name__)
TCallable = TypeVar('TCallable', bound=Callable)
@overload
def export(func: TCallable) -> TCallable:
...
@overload
def export(auth_level: int) -> Callable[[TCallable], TCallable]:
...
def export(auth_level=AUTH_LEVEL_DEFAULT):
"""
Decorator function to register an object's method as an RPC. The object
@ -69,17 +66,27 @@ def export(auth_level=AUTH_LEVEL_DEFAULT):
:type auth_level: int
"""
def wrap(func, *args, **kwargs):
func._rpcserver_export = True
func._rpcserver_auth_level = auth_level
doc = func.__doc__
func.__doc__ = "**RPC Exported Function** (*Auth Level: %s*)\n\n" % auth_level
if doc:
func.__doc__ += doc
rpc_text = '**RPC exported method** (*Auth level: %s*)' % auth_level
# Append the RPC text while ensuring correct docstring formatting.
if func.__doc__:
if func.__doc__.endswith(' '):
indent = func.__doc__.split('\n')[-1]
func.__doc__ += f'\n{indent}'
else:
func.__doc__ += '\n\n'
func.__doc__ += rpc_text
else:
func.__doc__ = rpc_text
return func
if type(auth_level) is FunctionType:
if isinstance(auth_level, FunctionType):
func = auth_level
auth_level = AUTH_LEVEL_DEFAULT
return wrap(func)
@ -90,117 +97,92 @@ def export(auth_level=AUTH_LEVEL_DEFAULT):
def format_request(call):
"""
Format the RPCRequest message for debug printing
:param call: the request
:type call: a RPCRequest
:returns: a formatted string for printing
:rtype: str
"""
try:
s = call[1] + "("
s = call[1] + '('
if call[2]:
s += ", ".join([str(x) for x in call[2]])
s += ', '.join([str(x) for x in call[2]])
if call[3]:
if call[2]:
s += ", "
s += ", ".join([key + "=" + str(value) for key, value in call[3].items()])
s += ")"
s += ', '
s += ', '.join([key + '=' + str(value) for key, value in call[3].items()])
s += ')'
except UnicodeEncodeError:
return "UnicodeEncodeError, call: %s" % call
return 'UnicodeEncodeError, call: %s' % call
else:
return s
class DelugeError(Exception):
pass
class NotAuthorizedError(DelugeError):
pass
class ServerContextFactory(object):
def getContext(self):
class DelugeRPCProtocol(DelugeTransferProtocol):
def __init__(self):
super().__init__()
# namedtuple subclass with auth_level, username for the connected session.
self.AuthLevel = namedtuple('SessionAuthlevel', 'auth_level, username')
def message_received(self, request):
"""
Create an SSL context.
This loads the servers cert/private key SSL files for use with the
SSL transport.
"""
ssl_dir = deluge.configmanager.get_config_dir("ssl")
ctx = SSL.Context(SSL.SSLv3_METHOD)
ctx.use_certificate_file(os.path.join(ssl_dir, "daemon.cert"))
ctx.use_privatekey_file(os.path.join(ssl_dir, "daemon.pkey"))
return ctx
class DelugeRPCProtocol(Protocol):
__buffer = None
def dataReceived(self, data):
"""
This method is called whenever data is received from a client. The
This method is called whenever a message is received from a client. The
only message that a client sends to the server is a RPC Request message.
If the RPC Request message is valid, then the method is called in
If the RPC Request message is valid, then the method is called in
:meth:`dispatch`.
:param data: the data from the client. It should be a zlib compressed
rencoded string.
:type data: str
:param request: the request from the client.
:type data: tuple
"""
if self.__buffer:
# We have some data from the last dataReceived() so lets prepend it
data = self.__buffer + data
self.__buffer = None
if not isinstance(request, tuple):
log.debug('Received invalid message: type is not tuple')
return
while data:
dobj = zlib.decompressobj()
try:
request = rencode.loads(dobj.decompress(data))
except Exception, e:
#log.debug("Received possible invalid message (%r): %s", data, e)
# This could be cut-off data, so we'll save this in the buffer
# and try to prepend it on the next dataReceived()
self.__buffer = data
return
else:
data = dobj.unused_data
if len(request) < 1:
log.debug('Received invalid message: there are no items')
return
if type(request) is not tuple:
log.debug("Received invalid message: type is not tuple")
return
for call in request:
if len(call) != 4:
log.debug(
'Received invalid rpc request: number of items ' 'in request is %s',
len(call),
)
continue
# log.debug('RPCRequest: %s', format_request(call))
reactor.callLater(0, self.dispatch, *call)
if len(request) < 1:
log.debug("Received invalid message: there are no items")
return
for call in request:
if len(call) != 4:
log.debug("Received invalid rpc request: number of items in request is %s", len(call))
continue
#log.debug("RPCRequest: %s", format_request(call))
reactor.callLater(0, self.dispatch, *call)
def sendData(self, data):
def sendData(self, data): # NOQA: N802
"""
Sends the data to the client.
:param data: the object that is to be sent to the client. This should
be one of the RPC message types.
:type data: object
"""
self.transport.write(zlib.compress(rencode.dumps(data)))
def connectionMade(self):
"""
try:
self.transfer_message(data)
except Exception as ex:
log.warning('Error occurred when sending message: %s.', ex)
log.exception(ex)
raise
def connectionMade(self): # NOQA: N802
"""
This method is called when a new client connects.
"""
peer = self.transport.getPeer()
log.info("Deluge Client connection made from: %s:%s", peer.host, peer.port)
log.info('Deluge Client connection made from: %s:%s', peer.host, peer.port)
# Set the initial auth level of this session to AUTH_LEVEL_NONE
self.factory.authorized_sessions[self.transport.sessionno] = AUTH_LEVEL_NONE
self.factory.authorized_sessions[self.transport.sessionno] = self.AuthLevel(
AUTH_LEVEL_NONE, ''
)
def connectionLost(self, reason):
def connectionLost(self, reason=connectionDone): # NOQA: N802
"""
This method is called when the client is disconnected.
@ -216,7 +198,14 @@ class DelugeRPCProtocol(Protocol):
if self.transport.sessionno in self.factory.interested_events:
del self.factory.interested_events[self.transport.sessionno]
log.info("Deluge client disconnected: %s", reason.value)
if self.factory.state == 'running':
component.get('EventManager').emit(
ClientDisconnectedEvent(self.factory.session_id)
)
log.info('Deluge client disconnected: %s', reason.value)
def valid_session(self):
return self.transport.sessionno in self.factory.authorized_sessions
def dispatch(self, request_id, method, args, kwargs):
"""
@ -234,38 +223,77 @@ class DelugeRPCProtocol(Protocol):
:type kwargs: dict
"""
def sendError():
def send_error():
"""
Sends an error response with the contents of the exception that was raised.
"""
exceptionType, exceptionValue, exceptionTraceback = sys.exc_info()
exc_type, exc_value, dummy_exc_trace = sys.exc_info()
formated_tb = traceback.format_exc()
try:
self.sendData(
(
RPC_ERROR,
request_id,
exc_type.__name__,
exc_value._args,
exc_value._kwargs,
formated_tb,
)
)
except AttributeError:
# This is not a deluge exception (object has no attribute '_args), let's wrap it
log.warning(
'An exception occurred while sending RPC_ERROR to '
'client. Wrapping it and resending. Error to '
'send(causing exception goes next):\n%s',
formated_tb,
)
try:
raise WrappedException(
str(exc_value), exc_type.__name__, formated_tb
)
except WrappedException:
send_error()
except Exception as ex:
log.error(
'An exception occurred while sending RPC_ERROR to client: %s', ex
)
self.sendData((
RPC_ERROR,
request_id,
(exceptionType.__name__,
exceptionValue.args[0] if len(exceptionValue.args) == 1 else "",
"".join(traceback.format_tb(exceptionTraceback)))
))
if method == "daemon.login":
if method == 'daemon.info':
# This is a special case and used in the initial connection process
self.sendData((RPC_RESPONSE, request_id, deluge.common.get_version()))
return
elif method == 'daemon.login':
# This is a special case and used in the initial connection process
# We need to authenticate the user here
log.debug('RPC dispatch daemon.login')
try:
ret = component.get("AuthManager").authorize(*args, **kwargs)
client_version = kwargs.pop('client_version', None)
if client_version is None:
raise IncompatibleClient(deluge.common.get_version())
ret = component.get('AuthManager').authorize(*args, **kwargs)
if ret:
self.factory.authorized_sessions[self.transport.sessionno] = ret
self.factory.authorized_sessions[
self.transport.sessionno
] = self.AuthLevel(ret, args[0])
self.factory.session_protocols[self.transport.sessionno] = self
except Exception, e:
sendError()
log.exception(e)
except Exception as ex:
send_error()
if not isinstance(ex, _ClientSideRecreateError):
log.exception(ex)
else:
self.sendData((RPC_RESPONSE, request_id, (ret)))
if not ret:
self.transport.loseConnection()
finally:
return
elif method == "daemon.set_event_interest" and self.transport.sessionno in self.factory.authorized_sessions:
return
# Anything below requires a valid session
if not self.valid_session():
return
if method == 'daemon.set_event_interest':
log.debug('RPC dispatch daemon.set_event_interest')
# This special case is to allow clients to set which events they are
# interested in receiving.
# We are expecting a sequence from the client.
@ -273,48 +301,66 @@ class DelugeRPCProtocol(Protocol):
if self.transport.sessionno not in self.factory.interested_events:
self.factory.interested_events[self.transport.sessionno] = []
self.factory.interested_events[self.transport.sessionno].extend(args[0])
except Exception, e:
sendError()
except Exception:
send_error()
else:
self.sendData((RPC_RESPONSE, request_id, (True)))
finally:
return
if method not in self.factory.methods:
try:
# Raise exception to be sent back to client
raise AttributeError('RPC call on invalid function: %s' % method)
except AttributeError:
send_error()
return
if method in self.factory.methods and self.transport.sessionno in self.factory.authorized_sessions:
try:
method_auth_requirement = self.factory.methods[method]._rpcserver_auth_level
auth_level = self.factory.authorized_sessions[self.transport.sessionno]
if auth_level < method_auth_requirement:
# This session is not allowed to call this method
log.debug("Session %s is trying to call a method it is not authorized to call!", self.transport.sessionno)
raise NotAuthorizedError("Auth level too low: %s < %s" % (auth_level, method_auth_requirement))
# Set the session_id in the factory so that methods can know
# which session is calling it.
self.factory.session_id = self.transport.sessionno
ret = self.factory.methods[method](*args, **kwargs)
except Exception, e:
sendError()
# Don't bother printing out DelugeErrors, because they are just for the client
if not isinstance(e, DelugeError):
log.exception("Exception calling RPC request: %s", e)
else:
# Check if the return value is a deferred, since we'll need to
# wait for it to fire before sending the RPC_RESPONSE
if isinstance(ret, defer.Deferred):
def on_success(result):
log.debug('RPC dispatch %s', method)
try:
method_auth_requirement = self.factory.methods[method]._rpcserver_auth_level
auth_level = self.factory.authorized_sessions[
self.transport.sessionno
].auth_level
if auth_level < method_auth_requirement:
# This session is not allowed to call this method
log.debug(
'Session %s is attempting an unauthorized method call!',
self.transport.sessionno,
)
raise NotAuthorizedError(auth_level, method_auth_requirement)
# Set the session_id in the factory so that methods can know
# which session is calling it.
self.factory.session_id = self.transport.sessionno
ret = self.factory.methods[method](*args, **kwargs)
except Exception as ex:
send_error()
# Don't bother printing out DelugeErrors, because they are just
# for the client
if not isinstance(ex, DelugeError):
log.exception('Exception calling RPC request: %s', ex)
else:
# Check if the return value is a deferred, since we'll need to
# wait for it to fire before sending the RPC_RESPONSE
if isinstance(ret, defer.Deferred):
def on_success(result):
try:
self.sendData((RPC_RESPONSE, request_id, result))
return result
except Exception:
send_error()
return result
def on_fail(failure):
try:
failure.raiseException()
except Exception, e:
sendError()
return failure
def on_fail(failure):
try:
failure.raiseException()
except Exception:
send_error()
return failure
ret.addCallbacks(on_success, on_fail)
else:
self.sendData((RPC_RESPONSE, request_id, ret))
ret.addCallbacks(on_success, on_fail)
else:
self.sendData((RPC_RESPONSE, request_id, ret))
class RPCServer(component.Component):
"""
@ -332,13 +378,14 @@ class RPCServer(component.Component):
:type listen: bool
"""
def __init__(self, port=58846, interface="", allow_remote=False, listen=True):
component.Component.__init__(self, "RPCServer")
def __init__(self, port=58846, interface='', allow_remote=False, listen=True):
component.Component.__init__(self, 'RPCServer')
self.factory = Factory()
self.factory.protocol = DelugeRPCProtocol
self.factory.session_id = -1
self.factory.state = 'running'
# Holds the registered methods
self.factory.methods = {}
# Holds the session_ids and auth levels
@ -348,28 +395,33 @@ class RPCServer(component.Component):
# Holds the interested event list for the sessions
self.factory.interested_events = {}
self.listen = listen
if not listen:
return
if allow_remote:
hostname = ""
hostname = ''
else:
hostname = "localhost"
hostname = 'localhost'
if interface:
hostname = interface
log.info("Starting DelugeRPC server %s:%s", hostname, port)
log.info('Starting DelugeRPC server %s:%s', hostname, port)
# Check for SSL keys and generate some if needed
check_ssl_keys()
cert = os.path.join(deluge.configmanager.get_config_dir('ssl'), 'daemon.cert')
pkey = os.path.join(deluge.configmanager.get_config_dir('ssl'), 'daemon.pkey')
try:
reactor.listenSSL(port, self.factory, ServerContextFactory(), interface=hostname)
except Exception, e:
log.info("Daemon already running or port not available..")
log.error(e)
sys.exit(0)
reactor.listenSSL(
port, self.factory, get_context_factory(cert, pkey), interface=hostname
)
except Exception as ex:
log.debug('Daemon already running or port not available.: %s', ex)
raise
def register_object(self, obj, name=None):
"""
@ -385,11 +437,22 @@ class RPCServer(component.Component):
name = obj.__class__.__name__.lower()
for d in dir(obj):
if d[0] == "_":
if d[0] == '_':
continue
if getattr(getattr(obj, d), '_rpcserver_export', False):
log.debug("Registering method: %s", name + "." + d)
self.factory.methods[name + "." + d] = getattr(obj, d)
log.debug('Registering method: %s', name + '.' + d)
self.factory.methods[name + '.' + d] = getattr(obj, d)
def deregister_object(self, obj):
"""
Deregisters an objects exported rpc methods.
:param obj: the object that was previously registered
"""
for key, value in self.factory.methods.items():
if value.__self__ == obj:
del self.factory.methods[key]
def get_object_method(self, name):
"""
@ -412,31 +475,68 @@ class RPCServer(component.Component):
:returns: the exported methods
:rtype: list
"""
return self.factory.methods.keys()
return list(self.factory.methods)
def get_session_id(self):
"""
Returns the session id of the current RPC.
:returns: the session id, this will be -1 if no connections have been made
:rtype: int
"""
return self.factory.session_id
def get_session_user(self):
"""
Returns the username calling the current RPC.
:returns: the username of the user calling the current RPC
:rtype: string
"""
if not self.listen:
return 'localclient'
session_id = self.get_session_id()
if session_id > -1 and session_id in self.factory.authorized_sessions:
return self.factory.authorized_sessions[session_id].username
else:
# No connections made yet
return ''
def get_session_auth_level(self):
"""
Returns the auth level of the user calling the current RPC.
:returns: the auth level
:rtype: int
"""
if not self.listen or not self.is_session_valid(self.get_session_id()):
return AUTH_LEVEL_ADMIN
return self.factory.authorized_sessions[self.get_session_id()].auth_level
def get_rpc_auth_level(self, rpc):
"""
Returns the auth level requirement for an exported rpc.
:returns: the auth level
:rtype: int
"""
return self.factory.methods[rpc]._rpcserver_auth_level
def is_session_valid(self, session_id):
"""
Checks if the session is still valid, eg, if the client is still connected.
:param session_id: the session id
:type session_id: int
:returns: True if the session is valid
:rtype: bool
"""
return session_id in self.factory.authorized_sessions
def emit_event(self, event):
"""
Emits the event to interested clients.
@ -444,61 +544,55 @@ class RPCServer(component.Component):
:param event: the event to emit
:type event: :class:`deluge.event.DelugeEvent`
"""
log.debug("intevents: %s", self.factory.interested_events)
log.debug('intevents: %s', self.factory.interested_events)
# Find sessions interested in this event
for session_id, interest in self.factory.interested_events.iteritems():
for session_id, interest in self.factory.interested_events.items():
if event.name in interest:
log.debug("Emit Event: %s %s", event.name, event.args)
log.debug('Emit Event: %s %s', event.name, event.args)
# This session is interested so send a RPC_EVENT
self.factory.session_protocols[session_id].sendData(
(RPC_EVENT, event.name, event.args)
)
def check_ssl_keys():
"""
Check for SSL cert/key and create them if necessary
"""
ssl_dir = deluge.configmanager.get_config_dir("ssl")
if not os.path.exists(ssl_dir):
# The ssl folder doesn't exist so we need to create it
os.makedirs(ssl_dir)
generate_ssl_keys()
else:
for f in ("daemon.pkey", "daemon.cert"):
if not os.path.exists(os.path.join(ssl_dir, f)):
generate_ssl_keys()
break
def emit_event_for_session_id(self, session_id, event):
"""
Emits the event to specified session_id.
def generate_ssl_keys():
"""
This method generates a new SSL key/cert.
"""
digest = "md5"
# Generate key pair
pkey = crypto.PKey()
pkey.generate_key(crypto.TYPE_RSA, 1024)
:param session_id: the event to emit
:type session_id: int
:param event: the event to emit
:type event: :class:`deluge.event.DelugeEvent`
"""
if not self.is_session_valid(session_id):
log.debug(
'Session ID %s is not valid. Not sending event "%s".',
session_id,
event.name,
)
return
if session_id not in self.factory.interested_events:
log.debug(
'Session ID %s is not interested in any events. Not sending event "%s".',
session_id,
event.name,
)
return
if event.name not in self.factory.interested_events[session_id]:
log.debug(
'Session ID %s is not interested in event "%s". Not sending it.',
session_id,
event.name,
)
return
log.debug(
'Sending event "%s" with args "%s" to session id "%s".',
event.name,
event.args,
session_id,
)
self.factory.session_protocols[session_id].sendData(
(RPC_EVENT, event.name, event.args)
)
# Generate cert request
req = crypto.X509Req()
subj = req.get_subject()
setattr(subj, "CN", "Deluge Daemon")
req.set_pubkey(pkey)
req.sign(pkey, digest)
# Generate certificate
cert = crypto.X509()
cert.set_serial_number(0)
cert.gmtime_adj_notBefore(0)
cert.gmtime_adj_notAfter(60*60*24*365*5) # Five Years
cert.set_issuer(req.get_subject())
cert.set_subject(req.get_subject())
cert.set_pubkey(req.get_pubkey())
cert.sign(pkey, digest)
# Write out files
ssl_dir = deluge.configmanager.get_config_dir("ssl")
open(os.path.join(ssl_dir, "daemon.pkey"), "w").write(crypto.dump_privatekey(crypto.FILETYPE_PEM, pkey))
open(os.path.join(ssl_dir, "daemon.cert"), "w").write(crypto.dump_certificate(crypto.FILETYPE_PEM, cert))
# Make the files only readable by this user
for f in ("daemon.pkey", "daemon.cert"):
os.chmod(os.path.join(ssl_dir, f), stat.S_IREAD | stat.S_IWRITE)
def stop(self):
self.factory.state = 'stopping'

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

136
deluge/crypto_utils.py Normal file
View File

@ -0,0 +1,136 @@
#
# Copyright (C) 2007,2008 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import os
import stat
from OpenSSL import crypto
from OpenSSL.crypto import FILETYPE_PEM
from twisted.internet.ssl import (
AcceptableCiphers,
Certificate,
CertificateOptions,
KeyPair,
TLSVersion,
)
import deluge.configmanager
# A TLS ciphers list.
# Sources for more information on TLS ciphers:
# - https://wiki.mozilla.org/Security/Server_Side_TLS
# - https://www.ssllabs.com/projects/best-practices/index.html
# - https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
#
# This list was inspired by the `urllib3` library
# - https://github.com/urllib3/urllib3/blob/master/urllib3/util/ssl_.py#L79
#
# The general intent is:
# - prefer cipher suites that offer perfect forward secrecy (ECDHE),
# - prefer AES-GCM over ChaCha20 because hardware-accelerated AES is common,
# - disable NULL authentication, MD5 MACs and DSS for security reasons.
TLS_CIPHERS = ':'.join(
[
'ECDH+AESGCM',
'ECDH+CHACHA20',
'AES256-GCM-SHA384',
'AES128-GCM-SHA256',
'!DSS' '!aNULL',
'!eNULL',
'!MD5',
]
)
# This value tells OpenSSL to disable all SSL/TLS renegotiation.
SSL_OP_NO_RENEGOTIATION = 0x40000000
def get_context_factory(cert_path, pkey_path):
"""OpenSSL context factory.
Generates an OpenSSL context factory using Twisted's CertificateOptions class.
This will keep a server cipher order.
Args:
cert_path (string): The path to the certificate file
pkey_path (string): The path to the private key file
Returns:
twisted.internet.ssl.CertificateOptions: An OpenSSL context factory
"""
with open(cert_path) as cert:
certificate = Certificate.loadPEM(cert.read()).original
with open(pkey_path) as pkey:
private_key = KeyPair.load(pkey.read(), FILETYPE_PEM).original
ciphers = AcceptableCiphers.fromOpenSSLCipherString(TLS_CIPHERS)
cert_options = CertificateOptions(
privateKey=private_key,
certificate=certificate,
raiseMinimumTo=TLSVersion.TLSv1_2,
acceptableCiphers=ciphers,
)
ctx = cert_options.getContext()
ctx.use_certificate_chain_file(cert_path)
ctx.set_options(SSL_OP_NO_RENEGOTIATION)
return cert_options
def check_ssl_keys():
"""
Check for SSL cert/key and create them if necessary
"""
ssl_dir = deluge.configmanager.get_config_dir('ssl')
if not os.path.exists(ssl_dir):
# The ssl folder doesn't exist so we need to create it
os.makedirs(ssl_dir)
generate_ssl_keys()
else:
for f in ('daemon.pkey', 'daemon.cert'):
if not os.path.exists(os.path.join(ssl_dir, f)):
generate_ssl_keys()
break
def generate_ssl_keys():
"""
This method generates a new SSL key/cert.
"""
digest = 'sha256'
# Generate key pair
pkey = crypto.PKey()
pkey.generate_key(crypto.TYPE_RSA, 2048)
# Generate cert request
req = crypto.X509Req()
subj = req.get_subject()
setattr(subj, 'CN', 'Deluge Daemon')
req.set_pubkey(pkey)
req.sign(pkey, digest)
# Generate certificate
cert = crypto.X509()
cert.set_serial_number(0)
cert.gmtime_adj_notBefore(0)
cert.gmtime_adj_notAfter(60 * 60 * 24 * 365 * 3) # Three Years
cert.set_issuer(req.get_subject())
cert.set_subject(req.get_subject())
cert.set_pubkey(req.get_pubkey())
cert.sign(pkey, digest)
# Write out files
ssl_dir = deluge.configmanager.get_config_dir('ssl')
with open(os.path.join(ssl_dir, 'daemon.pkey'), 'wb') as _file:
_file.write(crypto.dump_privatekey(crypto.FILETYPE_PEM, pkey))
with open(os.path.join(ssl_dir, 'daemon.cert'), 'wb') as _file:
_file.write(crypto.dump_certificate(crypto.FILETYPE_PEM, cert))
# Make the files only readable by this user
for f in ('daemon.pkey', 'daemon.cert'):
os.chmod(os.path.join(ssl_dir, f), stat.S_IREAD | stat.S_IWRITE)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -1,402 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="48px"
height="48px"
id="svg3440"
sodipodi:version="0.32"
inkscape:version="0.45"
sodipodi:docbase="/home/zach/deluge/trunk"
sodipodi:docname="deluge.svg"
inkscape:export-filename="/home/zach/deluge.png"
inkscape:export-xdpi="480"
inkscape:export-ydpi="480"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
sodipodi:modified="TRUE">
<defs
id="defs3">
<linearGradient
inkscape:collect="always"
id="linearGradient2973">
<stop
style="stop-color:#eeeeec;stop-opacity:1;"
offset="0"
id="stop2975" />
<stop
style="stop-color:#eeeeec;stop-opacity:0;"
offset="1"
id="stop2977" />
</linearGradient>
<linearGradient
id="linearGradient4126">
<stop
style="stop-color:#ffffff;stop-opacity:1.0000000;"
offset="0.0000000"
id="stop4128" />
<stop
style="stop-color:#ffffff;stop-opacity:0.16494845;"
offset="1.0000000"
id="stop4130" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient4114">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop4116" />
<stop
style="stop-color:#000000;stop-opacity:0;"
offset="1"
id="stop4118" />
</linearGradient>
<linearGradient
id="linearGradient3962">
<stop
style="stop-color:#d3e9ff;stop-opacity:1.0000000;"
offset="0.0000000"
id="stop3964" />
<stop
style="stop-color:#d3e9ff;stop-opacity:1.0000000;"
offset="0.15517241"
id="stop4134" />
<stop
style="stop-color:#4074ae;stop-opacity:1.0000000;"
offset="0.75000000"
id="stop4346" />
<stop
style="stop-color:#36486c;stop-opacity:1.0000000;"
offset="1.0000000"
id="stop3966" />
</linearGradient>
<radialGradient
r="13.994944"
fy="33.506763"
fx="-10.089286"
cy="33.506763"
cx="-10.089286"
gradientTransform="matrix(1,0,0,0.791446,-14.01786,-11.28667)"
gradientUnits="userSpaceOnUse"
id="radialGradient4019"
xlink:href="#linearGradient3993"
inkscape:collect="always" />
<radialGradient
r="14.057444"
fy="31.329016"
fx="-10.323107"
cy="31.329016"
cx="-10.323107"
gradientTransform="matrix(1,0,0,0.792374,-19.58761,2.818569)"
gradientUnits="userSpaceOnUse"
id="radialGradient4004"
xlink:href="#linearGradient3993"
inkscape:collect="always" />
<radialGradient
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.792374,0,6.785475)"
r="14.057444"
fy="31.329016"
fx="-10.323107"
cy="31.329016"
cx="-10.323107"
id="radialGradient3999"
xlink:href="#linearGradient3993"
inkscape:collect="always" />
<radialGradient
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.341185,-0.153831,1.08001,2.395374,-15.42222,-25.62103)"
r="13.994946"
fy="24.241488"
fx="61.662098"
cy="24.241488"
cx="61.662098"
id="radialGradient3943"
xlink:href="#linearGradient1312"
inkscape:collect="always" />
<linearGradient
id="linearGradient1312">
<stop
id="stop1314"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop1316"
offset="1"
style="stop-color:#ffffff;stop-opacity:0;" />
</linearGradient>
<linearGradient
id="linearGradient3993">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop3995" />
<stop
style="stop-color:#000000;stop-opacity:0"
offset="1"
id="stop3997" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2973"
id="radialGradient3866"
cx="-22.375"
cy="18.499998"
fx="-22.375"
fy="18.499998"
r="14.33462"
gradientTransform="matrix(1,0,0,1.140022,40.17678,1.347091)"
gradientUnits="userSpaceOnUse" />
<radialGradient
gradientUnits="userSpaceOnUse"
r="12.289036"
fy="63.965388"
fx="15.115514"
cy="63.965388"
cx="15.115514"
gradientTransform="scale(1.643990,0.608276)"
id="radialGradient5000"
xlink:href="#linearGradient4114"
inkscape:collect="always" />
<linearGradient
id="linearGradient4989">
<stop
id="stop4991"
offset="0.0000000"
style="stop-color:#d3e9ff;stop-opacity:1.0000000;" />
<stop
id="stop4993"
offset="0.15517241"
style="stop-color:#d3e9ff;stop-opacity:1.0000000;" />
<stop
id="stop4995"
offset="0.75000000"
style="stop-color:#4074ae;stop-opacity:1.0000000;" />
<stop
id="stop4997"
offset="1.0000000"
style="stop-color:#36486c;stop-opacity:1.0000000;" />
</linearGradient>
<linearGradient
id="linearGradient4977">
<stop
id="stop4979"
offset="0.0000000"
style="stop-color:#ffffff;stop-opacity:1.0000000;" />
<stop
id="stop4981"
offset="1.0000000"
style="stop-color:#ffffff;stop-opacity:0.16494845;" />
</linearGradient>
<linearGradient
id="linearGradient4825"
inkscape:collect="always">
<stop
id="stop4827"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop4829"
offset="1"
style="stop-color:#ffffff;stop-opacity:0;" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4114"
id="radialGradient6090"
gradientUnits="userSpaceOnUse"
gradientTransform="scale(1.64399,0.608276)"
cx="15.115514"
cy="63.965388"
fx="15.115514"
fy="63.965388"
r="12.289036" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4825"
id="radialGradient6098"
gradientUnits="userSpaceOnUse"
cx="12.071323"
cy="12.493138"
fx="12.071323"
fy="12.493138"
r="6.7175145" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2973"
id="radialGradient6103"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.25463,-0.898371,0.979785,0.277703,-18.00903,32.03312)"
cx="17.903898"
cy="40.159222"
fx="17.903898"
fy="40.159222"
r="14.33681" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2973"
id="radialGradient6106"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.583269,-0.431533,0.577146,0.78008,-5.80022,4.004109)"
cx="12.525543"
cy="38.09042"
fx="12.525543"
fy="38.09042"
r="14.33681" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient1312"
id="radialGradient6109"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.768231,1.13675,-0.820972,0.554824,-3.72248,-85.07126)"
cx="65.800331"
cy="27.16758"
fx="65.800331"
fy="27.16758"
r="12.972491" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4989"
id="radialGradient6115"
cx="16.651781"
cy="32.187485"
fx="16.651781"
fy="32.187485"
r="17.089519"
gradientTransform="matrix(1.486175,-1.536108,0.932321,0.902016,-38.10476,31.42646)"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="0.17254902"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="8"
inkscape:cx="36.250498"
inkscape:cy="38.275489"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1266"
inkscape:window-height="944"
inkscape:window-x="124"
inkscape:window-y="52"
inkscape:showpageshadow="false" />
<metadata
id="metadata4">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>Internet Category</dc:title>
<dc:creator>
<cc:Agent>
<dc:title>Jakub Steiner</dc:title>
</cc:Agent>
</dc:creator>
<dc:contributor>
<cc:Agent>
<dc:title>Tuomas Kuosmanen</dc:title>
</cc:Agent>
</dc:contributor>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/2.0/" />
<dc:source>http://jimmac.musichall.cz</dc:source>
<dc:subject>
<rdf:Bag>
<rdf:li>internet</rdf:li>
<rdf:li>tools</rdf:li>
<rdf:li>applications</rdf:li>
<rdf:li>category</rdf:li>
</rdf:Bag>
</dc:subject>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/2.0/">
<cc:permits
rdf:resource="http://web.resource.org/cc/Reproduction" />
<cc:permits
rdf:resource="http://web.resource.org/cc/Distribution" />
<cc:requires
rdf:resource="http://web.resource.org/cc/Notice" />
<cc:requires
rdf:resource="http://web.resource.org/cc/Attribution" />
<cc:permits
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
<cc:requires
rdf:resource="http://web.resource.org/cc/ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
sodipodi:type="arc"
style="fill:url(#radialGradient6090);fill-opacity:1;stroke:none;stroke-opacity:1"
id="path4112"
sodipodi:cx="24.849752"
sodipodi:cy="38.908627"
sodipodi:rx="20.203051"
sodipodi:ry="7.4751287"
d="M 45.052803 38.908627 A 20.203051 7.4751287 0 1 1 4.6467018,38.908627 A 20.203051 7.4751287 0 1 1 45.052803 38.908627 z"
transform="matrix(0.947409,0,0,1.17786,1.244375,-6.853427)"
inkscape:export-xdpi="480"
inkscape:export-ydpi="480" />
<path
style="fill:url(#radialGradient6115);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 23.942923,0.9561338 L 37.330543,18.266721 C 46.998995,29.84687 41.49692,43.923891 26.7742,45.000491 C 6.0597413,45.582655 6.5086231,27.37483 11.255313,18.609381 L 23.942923,0.9561338 z "
id="path2069"
sodipodi:nodetypes="ccccc" />
<path
style="fill:#1b4075;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 35.111358,26.143133 C 28.972772,13.030586 17.560684,17.697957 17.274449,26.949974 C 16.894738,39.223415 34.748874,37.615429 36.715244,41.468778 C 28.821643,47.675479 14.973233,45.226508 10.962289,39.715204 C 6.9574776,34.212326 7.2383598,25.630263 10.784249,19.587632 C 24.158625,0.978654 39.749127,24.383766 35.111358,26.143133 z "
id="path2969"
sodipodi:nodetypes="cscscc" />
<path
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:white;stroke-width:1.1000706;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.36612022"
d="M 23.996861,3.5433428 L 36.057351,19.151045 C 44.769741,29.58253 39.419346,42.414092 26.125181,43.508521 C 7.3917365,44.015286 7.4275065,28.119221 12.17284,20.333442 L 23.996861,3.5433428 z "
id="path2071"
sodipodi:nodetypes="ccccc" />
<path
style="opacity:0.46;fill:url(#radialGradient6109);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 23.940758,0.96491709 L 34.727367,14.909752 C 42.647208,24.392311 40.447304,20.283975 28.362481,21.278846 C 25.083165,11.203805 18.13871,11.859899 13.523802,15.675236 L 23.940758,0.96491709 z "
id="path3945"
sodipodi:nodetypes="ccccc" />
<path
style="fill:url(#radialGradient6106);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 35.159701,26.173667 C 29.021115,13.06112 18.734027,17.978491 18.447792,27.230508 C 18.068081,39.503949 34.797217,37.645963 36.763587,41.499312 C 28.869986,47.706013 15.021576,45.257042 11.010632,39.745738 C 7.0058197,34.24286 7.2867027,25.660797 10.832592,19.618166 C 24.206968,1.0091879 39.79747,24.4143 35.159701,26.173667 z "
id="path3868"
sodipodi:nodetypes="cscscc" />
<path
style="fill:url(#radialGradient6103);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 35.120795,26.14195 C 28.553327,12.814962 15.685968,17.224233 15.399733,26.47625 C 15.020022,38.749691 32.874158,37.141705 34.840528,40.995054 C 26.946927,47.201755 13.098517,44.752784 9.0875727,39.24148 C 5.0827617,33.738602 5.3636437,25.156539 8.9095327,19.113908 C 22.315509,0.47615954 40.03233,23.660113 35.120795,26.14195 z "
id="path4874"
sodipodi:nodetypes="cscscc" />
<path
transform="matrix(-0.829136,1.052307,1.239307,7.58326e-2,26.32898,25.58605)"
inkscape:r_cy="true"
inkscape:r_cx="true"
d="M 18.788838 12.493138 A 6.7175145 6.7175145 0 1 1 5.3538089,12.493138 A 6.7175145 6.7175145 0 1 1 18.788838 12.493138 z"
sodipodi:ry="6.7175145"
sodipodi:rx="6.7175145"
sodipodi:cy="12.493138"
sodipodi:cx="12.071323"
id="path4941"
style="opacity:0.21999996;color:black;fill:url(#radialGradient6098);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
sodipodi:type="arc" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,150 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="744.09448819"
height="1052.3622047"
id="svg4848"
sodipodi:version="0.32"
inkscape:version="0.46"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/active16.png"
inkscape:export-xdpi="1.7055545"
inkscape:export-ydpi="1.7055545"
sodipodi:docname="active.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape">
<defs
id="defs4850">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective4856" />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath5467">
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.69776249;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 792.51261,596.13496 C 1787.1961,462.38583 1788.2786,460.03989 1788.2786,460.03989 L 2050.3447,889.51678 C 1692.1626,1024.6476 1428.8778,1128.1462 1119.6165,1246.9702 L 792.51261,596.13496 z"
id="path5469"
sodipodi:nodetypes="ccccc" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath5471">
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.69776249;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 792.51261,596.13496 C 1787.1961,462.38583 1788.2786,460.03989 1788.2786,460.03989 L 2050.3447,889.51678 C 1692.1626,1024.6476 1428.8778,1128.1462 1119.6165,1246.9702 L 792.51261,596.13496 z"
id="path5473"
sodipodi:nodetypes="ccccc" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath5475">
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.69776249;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 792.51261,596.13496 C 1787.1961,462.38583 1788.2786,460.03989 1788.2786,460.03989 L 2050.3447,889.51678 C 1692.1626,1024.6476 1428.8778,1128.1462 1119.6165,1246.9702 L 792.51261,596.13496 z"
id="path5477"
sodipodi:nodetypes="ccccc" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
gridtolerance="10000"
guidetolerance="10"
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.5"
inkscape:cx="798.86898"
inkscape:cy="436.74575"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1280"
inkscape:window-height="958"
inkscape:window-x="1280"
inkscape:window-y="0" />
<metadata
id="metadata4853">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<g
style="opacity:1"
id="g4871">
<path
inkscape:export-ydpi="1.7060417"
inkscape:export-xdpi="1.7060417"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/seeding16.png"
sodipodi:nodetypes="ccccc"
id="path2069"
d="M 335.10794,116.43168 L 610.53935,447.76408 C 809.45408,669.41324 696.25675,938.85368 393.35753,959.46028 C -32.813273,970.60316 -9.7709676,623.52458 107.82928,464.31364 L 335.10794,116.43168 z"
style="fill:#5599ff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:export-ydpi="1.7060417"
inkscape:export-xdpi="1.7060417"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/seeding16.png"
sodipodi:nodetypes="ccccc"
id="path2071"
d="M 337.67292,165.87552 L 585.22638,464.67366 C 773.96211,684.57988 653.37942,910.02774 383.88559,930.97978 C 4.1291863,940.68143 29.040179,639.21796 125.2355,490.1649 L 337.67292,165.87552 z"
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:21.67123985;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.36612022" />
<path
inkscape:export-ydpi="1.7060417"
inkscape:export-xdpi="1.7060417"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/seeding16.png"
id="rect2634"
d="M 359.0208,369.47132 C 289.64507,437.53055 219.98727,505.41409 150.61154,573.47313 C 187.93874,573.54143 225.35922,573.40503 262.68661,573.47313 C 262.68661,654.06643 262.68661,734.65974 262.68661,815.25304 C 329.00806,815.25304 395.32971,815.25304 461.65134,815.25304 C 461.65134,734.86969 461.65134,654.48632 461.65134,574.10276 C 496.04273,574.16582 530.52013,574.0399 564.91152,574.10276 C 496.30183,505.79126 427.63028,437.78301 359.0208,369.47132 z"
style="fill:#93beff;fill-opacity:1;stroke:#000000;stroke-width:14.10382843;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<path
style="fill:#8dd35f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 1211.4629,48.95108 L 1486.8943,380.28348 C 1685.809,601.93264 1572.6117,871.37308 1269.7125,891.97968 C 843.5417,903.12256 866.584,556.04398 984.1842,396.83304 L 1211.4629,48.95108 z"
id="path4864"
sodipodi:nodetypes="ccccc"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/seeding16.png"
inkscape:export-xdpi="1.7060417"
inkscape:export-ydpi="1.7060417"
clip-path="url(#clipPath5475)"
transform="translate(-876,68)" />
<path
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:21.67123985;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.36612022"
d="M 1214.0279,98.39492 L 1461.5813,397.19306 C 1650.317,617.09928 1529.7344,842.54714 1260.2405,863.49918 C 880.4842,873.20083 905.3951,571.73736 1001.5905,422.6843 L 1214.0279,98.39492 z"
id="path4866"
sodipodi:nodetypes="ccccc"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/seeding16.png"
inkscape:export-xdpi="1.7060417"
inkscape:export-ydpi="1.7060417"
clip-path="url(#clipPath5471)"
transform="translate(-876,68)" />
<path
style="fill:#b7e399;fill-opacity:1;stroke:#000000;stroke-width:14.1288912;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 1235.158,785.66485 C 1165.4485,716.69801 1095.4555,647.90922 1025.7459,578.94258 C 1063.2527,578.87336 1100.8533,579.01159 1138.3603,578.94258 C 1138.3603,497.27453 1138.3603,415.60647 1138.3603,333.93841 C 1205.0008,333.93841 1271.6416,333.93841 1338.2823,333.93841 C 1338.2823,415.39371 1338.2823,496.84903 1338.2823,578.30455 C 1372.8392,578.24065 1407.4825,578.36825 1442.0394,578.30455 C 1373.0995,647.52701 1304.0976,716.44219 1235.158,785.66485 z"
id="path4868"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/seeding16.png"
inkscape:export-xdpi="1.7060417"
inkscape:export-ydpi="1.7060417"
clip-path="url(#clipPath5467)"
transform="matrix(0.9958235,0,0,1.0000914,-871.02338,67.589213)" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 742 B

View File

@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="744.09448819"
height="1052.3622047"
id="svg5684"
sodipodi:version="0.32"
inkscape:version="0.46"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/alert16.png"
inkscape:export-xdpi="1.7055545"
inkscape:export-ydpi="1.7055545"
sodipodi:docname="alert.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape">
<defs
id="defs5686">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective5692" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
gridtolerance="10000"
guidetolerance="10"
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="807.63627"
inkscape:cy="520"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="686"
inkscape:window-height="711"
inkscape:window-x="1395"
inkscape:window-y="223" />
<metadata
id="metadata5689">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891000000001px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 335.10794,116.43168 L 610.53935,447.76408 C 809.45408,669.41324 696.25675,938.85368 393.35753,959.46028 C -32.813273,970.60316 -9.7709676,623.52458 107.82928,464.31364 L 335.10794,116.43168 z"
id="path2069"
sodipodi:nodetypes="ccccc"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/seeding16.png"
inkscape:export-xdpi="1.7060417"
inkscape:export-ydpi="1.7060417" />
<path
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:21.67123984999999919;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.36612022000000000"
d="M 337.67292,165.87552 L 585.22638,464.67366 C 773.96211,684.57988 653.37942,910.02774 383.88559,930.97978 C 4.1291863,940.68143 29.040179,639.21796 125.2355,490.1649 L 337.67292,165.87552 z"
id="path2071"
sodipodi:nodetypes="ccccc"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/seeding16.png"
inkscape:export-xdpi="1.7060417"
inkscape:export-ydpi="1.7060417" />
<text
xml:space="preserve"
style="font-size:1091.49255371px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#ff7878;fill-opacity:1;stroke:#000000;stroke-width:13.65081787;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans"
x="20.453644"
y="1303.4996"
id="text2767"
transform="scale(1.4928735,0.6698491)"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan2769"
x="20.453644"
y="1303.4996"
style="font-size:1091.49255371px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;stroke-width:13.65081787;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;font-family:Bitstream Vera Sans">!</tspan></text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 590 B

View File

@ -1,191 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="744.09448819"
height="1052.3622047"
id="svg3001"
sodipodi:version="0.32"
inkscape:version="0.46"
sodipodi:docname="all.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape">
<defs
id="defs3003">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective3009" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
gridtolerance="10000"
guidetolerance="10"
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="375"
inkscape:cy="520"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="640"
inkscape:window-height="711"
inkscape:window-x="1594"
inkscape:window-y="77" />
<metadata
id="metadata3006">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<g
id="g3011"
transform="matrix(7.4849593,0,0,7.4849593,52.997244,360.31942)"
inkscape:export-filename="/home/andrew/g3060.png"
inkscape:export-xdpi="2.4250078"
inkscape:export-ydpi="2.4250078">
<path
sodipodi:nodetypes="ccccc"
id="path2069"
d="M 23.942923,0.9561338 L 37.330543,18.266721 C 46.998995,29.84687 41.49692,43.923891 26.7742,45.000491 C 6.0597413,45.582655 6.5086231,27.37483 11.255313,18.609381 L 23.942923,0.9561338 z"
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccc"
id="path2071"
d="M 23.996861,3.5433428 L 36.057351,19.151045 C 44.769741,29.58253 39.419346,42.414092 26.125181,43.508521 C 7.3917365,44.015286 7.4275065,28.119221 12.17284,20.333442 L 23.996861,3.5433428 z"
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.1000706;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.36612022" />
<text
sodipodi:linespacing="125%"
transform="scale(1.4928735,0.6698491)"
id="text2767"
y="59.560848"
x="5.0072942"
style="font-size:55.97062302px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#ff7878;fill-opacity:1;stroke:#000000;stroke-width:0.69999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
style="font-size:55.97062302px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;stroke-width:0.69999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;font-family:Bitstream Vera Sans"
y="59.560848"
x="5.0072942"
id="tspan2769"
sodipodi:role="line">!</tspan></text>
</g>
<g
id="g3022"
transform="matrix(7.874057,0,0,7.874057,232.39499,356.39427)"
inkscape:export-filename="/home/andrew/g3060.png"
inkscape:export-xdpi="2.4250078"
inkscape:export-ydpi="2.4250078">
<path
sodipodi:nodetypes="ccccc"
id="path3030"
d="M 23.854535,1.0445221 L 37.242155,18.355109 C 46.910607,29.935258 41.408532,44.012279 26.685812,45.088879 C 5.971353,45.671043 6.4202348,27.463218 11.166925,18.697769 L 23.854535,1.0445221 z"
style="fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccc"
id="path3032"
d="M 23.996861,3.5433428 L 36.057351,19.151045 C 44.769741,29.58253 39.419346,42.414092 26.125181,43.508521 C 7.3917365,44.015286 7.4275065,28.119221 12.17284,20.333442 L 23.996861,3.5433428 z"
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.1000706;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.36612022" />
<g
transform="matrix(0.9616363,0,0,0.855461,0.9207282,3.9296533)"
id="g3590">
<rect
style="fill:#cfcfcf;fill-opacity:1;stroke:#000000;stroke-width:0.69999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4415"
width="7.7589664"
height="14.866735"
x="14.548919"
y="19.754131" />
<rect
style="fill:#cfcfcf;fill-opacity:1;stroke:#000000;stroke-width:0.69999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4417"
width="7.7589664"
height="14.866735"
x="25.692116"
y="19.754131" />
</g>
</g>
<g
id="g3037"
transform="matrix(8.0037561,0,0,8.0037561,-22.312009,464.83023)"
inkscape:export-filename="/home/andrew/g3060.png"
inkscape:export-xdpi="2.4250078"
inkscape:export-ydpi="2.4250078">
<path
sodipodi:nodetypes="ccccc"
id="path3043"
d="M 23.854535,1.0445221 L 37.242155,18.355109 C 46.910607,29.935258 41.408532,44.012279 26.685812,45.088879 C 5.971353,45.671043 6.4202348,27.463218 11.166925,18.697769 L 23.854535,1.0445221 z"
style="fill:#d0b31d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccc"
id="path3045"
d="M 23.996861,3.5433428 L 36.057351,19.151045 C 44.769741,29.58253 39.419346,42.414092 26.125181,43.508521 C 7.3917365,44.015286 7.4275065,28.119221 12.17284,20.333442 L 23.996861,3.5433428 z"
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.1000706;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.36612022" />
<path
id="rect2634"
d="M 24.821384,15.512309 C 22.21433,17.952223 19.604921,20.381297 16.997867,22.821211 C 18.304685,22.818964 19.61477,22.823457 20.921589,22.821211 C 20.921589,25.684801 20.921589,28.548391 20.921589,31.411981 C 19.61477,31.409734 18.304685,31.414228 16.997867,31.411981 C 19.604921,33.851895 22.21433,36.280969 24.821384,38.720883 C 27.457552,36.289986 30.104432,33.865368 32.740602,31.43447 C 31.322226,31.432031 29.900305,31.43691 28.481929,31.43447 C 28.481929,28.555887 28.481929,25.677306 28.481929,22.798722 C 29.900305,22.796282 31.322226,22.80116 32.740602,22.798722 C 30.104432,20.367823 27.457552,17.943206 24.821384,15.512309 z"
style="fill:#e1cf6f;fill-opacity:1;stroke:#000000;stroke-width:0.56882578;stroke-linecap:round;stroke-linejoin:round;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
<g
id="g3048"
transform="matrix(7.6146585,0,0,7.6146585,318.27879,494.48113)"
inkscape:export-filename="/home/andrew/g3060.png"
inkscape:export-xdpi="2.4250078"
inkscape:export-ydpi="2.4250078">
<path
sodipodi:nodetypes="ccccc"
id="path3054"
d="M 23.942923,0.9561338 L 37.330543,18.266721 C 46.998995,29.84687 41.49692,43.923891 26.7742,45.000491 C 6.0597413,45.582655 6.5086231,27.37483 11.255313,18.609381 L 23.942923,0.9561338 z"
style="fill:#5599ff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccc"
id="path3056"
d="M 23.996861,3.5433428 L 36.057351,19.151045 C 44.769741,29.58253 39.419346,42.414092 26.125181,43.508521 C 7.3917365,44.015286 7.4275065,28.119221 12.17284,20.333442 L 23.996861,3.5433428 z"
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.1000706;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.36612022" />
<path
id="path3058"
d="M 24.3125,14.9375 C 20.869248,18.315409 17.412003,21.684591 13.96875,25.0625 C 15.821373,25.065889 17.678627,25.059111 19.53125,25.0625 C 19.53125,29.0625 19.53125,33.0625 19.53125,37.0625 C 22.822917,37.0625 26.114582,37.0625 29.40625,37.0625 C 29.40625,33.072917 29.40625,29.083333 29.40625,25.09375 C 31.113161,25.096872 32.824339,25.090627 34.53125,25.09375 C 31.126025,21.703313 27.717725,18.327937 24.3125,14.9375 z"
style="fill:#93beff;fill-opacity:1;stroke:#000000;stroke-width:0.69999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<g
id="g3060"
transform="matrix(8.2631545,0,0,8.2631545,133.25792,542.4325)"
inkscape:export-xdpi="2.4250078"
inkscape:export-ydpi="2.4250078">
<path
sodipodi:nodetypes="ccccc"
id="path3066"
d="M 23.942923,0.9561338 L 37.330543,18.266721 C 46.998995,29.84687 41.49692,43.923891 26.7742,45.000491 C 6.0597413,45.582655 6.5086231,27.37483 11.255313,18.609381 L 23.942923,0.9561338 z"
style="fill:#8dd35f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccc"
id="path3068"
d="M 23.996861,3.5433428 L 36.057351,19.151045 C 44.769741,29.58253 39.419346,42.414092 26.125181,43.508521 C 7.3917365,44.015286 7.4275065,28.119221 12.17284,20.333442 L 23.996861,3.5433428 z"
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.1000706;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.36612022" />
<path
id="path3070"
d="M 19.34375,17.5625 C 19.34375,21.552083 19.34375,25.541668 19.34375,29.53125 C 17.636839,29.528128 15.925661,29.534372 14.21875,29.53125 C 17.623975,32.921687 21.032275,36.297063 24.4375,39.6875 C 27.880752,36.309591 31.337996,32.94041 34.78125,29.5625 C 32.928627,29.559111 31.071373,29.565889 29.21875,29.5625 C 29.21875,25.5625 29.21875,21.562501 29.21875,17.5625 C 25.927083,17.5625 22.635418,17.562501 19.34375,17.5625 z"
style="fill:#b7e399;fill-opacity:1;stroke:#000000;stroke-width:0.69999999;stroke-linecap:round;stroke-linejoin:round;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 844 B

View File

@ -1,88 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="744.09448819"
height="1052.3622047"
id="svg6930"
sodipodi:version="0.32"
inkscape:version="0.46"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/checking16.png"
inkscape:export-xdpi="1.7060417"
inkscape:export-ydpi="1.7060417"
sodipodi:docname="checking.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape">
<defs
id="defs6932">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective6938" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
gridtolerance="10000"
guidetolerance="10"
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="284.02575"
inkscape:cy="416.27643"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="686"
inkscape:window-height="711"
inkscape:window-x="1387"
inkscape:window-y="128" />
<metadata
id="metadata6935">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891000000001px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 335.10794,116.43168 L 610.53935,447.76408 C 809.45408,669.41324 696.25675,938.85368 393.35753,959.46028 C -32.813273,970.60316 -9.7709676,623.52458 107.82928,464.31364 L 335.10794,116.43168 z"
id="path2069"
sodipodi:nodetypes="ccccc"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/checking16.png"
inkscape:export-xdpi="1.7060417"
inkscape:export-ydpi="1.7060417" />
<path
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:21.67123984999999919;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.36612022000000000"
d="M 337.67292,165.87552 L 585.22638,464.67366 C 773.96211,684.57988 653.37942,910.02774 383.88559,930.97978 C 4.1291863,940.68143 29.040179,639.21796 125.2355,490.1649 L 337.67292,165.87552 z"
id="path2071"
sodipodi:nodetypes="ccccc"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/seeding16.png"
inkscape:export-xdpi="1.7060417"
inkscape:export-ydpi="1.7060417" />
<path
style="fill:#cfcfcf;fill-opacity:1;stroke:#000000;stroke-width:11.50416565;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 170.93275,447.12091 C 174.01359,451.92804 181.6932,659.85017 179.71907,656.9136 C 178.40947,654.12718 411.7223,649.25335 412.30092,648.76646 C 411.08134,648.85003 338.31478,584.63588 338.93986,585.53435 C 410.72174,567.77973 462.65633,588.73801 481.03861,645.01437 C 484.19544,690.33553 466.3409,711.71891 434.77285,736.14895 C 385.89389,754.17146 322.59241,745.84878 312.37017,673.09575 C 312.32389,674.48492 156.52907,675.28833 153.0572,676.51233 C 202.03372,799.5504 269.9646,882.62913 421.73005,870.01325 C 463.0283,867.02946 568.27041,836.89042 606.41655,717.64626 C 627.84208,623.51263 596.80367,549.4096 547.34944,496.26853 C 457.7753,416.4389 296.11292,421.8444 245.11698,507.64417 C 247.55313,508.23771 173.58263,449.35852 170.93275,447.12091 z"
id="path3485"
sodipodi:nodetypes="ccccccccccccc" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -1,402 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="48px"
height="48px"
id="svg3440"
sodipodi:version="0.32"
inkscape:version="0.45"
sodipodi:docbase="/home/zach/deluge/trunk"
sodipodi:docname="deluge.svg"
inkscape:export-filename="/home/zach/deluge.png"
inkscape:export-xdpi="480"
inkscape:export-ydpi="480"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
sodipodi:modified="TRUE">
<defs
id="defs3">
<linearGradient
inkscape:collect="always"
id="linearGradient2973">
<stop
style="stop-color:#eeeeec;stop-opacity:1;"
offset="0"
id="stop2975" />
<stop
style="stop-color:#eeeeec;stop-opacity:0;"
offset="1"
id="stop2977" />
</linearGradient>
<linearGradient
id="linearGradient4126">
<stop
style="stop-color:#ffffff;stop-opacity:1.0000000;"
offset="0.0000000"
id="stop4128" />
<stop
style="stop-color:#ffffff;stop-opacity:0.16494845;"
offset="1.0000000"
id="stop4130" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient4114">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop4116" />
<stop
style="stop-color:#000000;stop-opacity:0;"
offset="1"
id="stop4118" />
</linearGradient>
<linearGradient
id="linearGradient3962">
<stop
style="stop-color:#d3e9ff;stop-opacity:1.0000000;"
offset="0.0000000"
id="stop3964" />
<stop
style="stop-color:#d3e9ff;stop-opacity:1.0000000;"
offset="0.15517241"
id="stop4134" />
<stop
style="stop-color:#4074ae;stop-opacity:1.0000000;"
offset="0.75000000"
id="stop4346" />
<stop
style="stop-color:#36486c;stop-opacity:1.0000000;"
offset="1.0000000"
id="stop3966" />
</linearGradient>
<radialGradient
r="13.994944"
fy="33.506763"
fx="-10.089286"
cy="33.506763"
cx="-10.089286"
gradientTransform="matrix(1,0,0,0.791446,-14.01786,-11.28667)"
gradientUnits="userSpaceOnUse"
id="radialGradient4019"
xlink:href="#linearGradient3993"
inkscape:collect="always" />
<radialGradient
r="14.057444"
fy="31.329016"
fx="-10.323107"
cy="31.329016"
cx="-10.323107"
gradientTransform="matrix(1,0,0,0.792374,-19.58761,2.818569)"
gradientUnits="userSpaceOnUse"
id="radialGradient4004"
xlink:href="#linearGradient3993"
inkscape:collect="always" />
<radialGradient
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.792374,0,6.785475)"
r="14.057444"
fy="31.329016"
fx="-10.323107"
cy="31.329016"
cx="-10.323107"
id="radialGradient3999"
xlink:href="#linearGradient3993"
inkscape:collect="always" />
<radialGradient
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.341185,-0.153831,1.08001,2.395374,-15.42222,-25.62103)"
r="13.994946"
fy="24.241488"
fx="61.662098"
cy="24.241488"
cx="61.662098"
id="radialGradient3943"
xlink:href="#linearGradient1312"
inkscape:collect="always" />
<linearGradient
id="linearGradient1312">
<stop
id="stop1314"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop1316"
offset="1"
style="stop-color:#ffffff;stop-opacity:0;" />
</linearGradient>
<linearGradient
id="linearGradient3993">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop3995" />
<stop
style="stop-color:#000000;stop-opacity:0"
offset="1"
id="stop3997" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2973"
id="radialGradient3866"
cx="-22.375"
cy="18.499998"
fx="-22.375"
fy="18.499998"
r="14.33462"
gradientTransform="matrix(1,0,0,1.140022,40.17678,1.347091)"
gradientUnits="userSpaceOnUse" />
<radialGradient
gradientUnits="userSpaceOnUse"
r="12.289036"
fy="63.965388"
fx="15.115514"
cy="63.965388"
cx="15.115514"
gradientTransform="scale(1.643990,0.608276)"
id="radialGradient5000"
xlink:href="#linearGradient4114"
inkscape:collect="always" />
<linearGradient
id="linearGradient4989">
<stop
id="stop4991"
offset="0.0000000"
style="stop-color:#d3e9ff;stop-opacity:1.0000000;" />
<stop
id="stop4993"
offset="0.15517241"
style="stop-color:#d3e9ff;stop-opacity:1.0000000;" />
<stop
id="stop4995"
offset="0.75000000"
style="stop-color:#4074ae;stop-opacity:1.0000000;" />
<stop
id="stop4997"
offset="1.0000000"
style="stop-color:#36486c;stop-opacity:1.0000000;" />
</linearGradient>
<linearGradient
id="linearGradient4977">
<stop
id="stop4979"
offset="0.0000000"
style="stop-color:#ffffff;stop-opacity:1.0000000;" />
<stop
id="stop4981"
offset="1.0000000"
style="stop-color:#ffffff;stop-opacity:0.16494845;" />
</linearGradient>
<linearGradient
id="linearGradient4825"
inkscape:collect="always">
<stop
id="stop4827"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop4829"
offset="1"
style="stop-color:#ffffff;stop-opacity:0;" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4114"
id="radialGradient6090"
gradientUnits="userSpaceOnUse"
gradientTransform="scale(1.64399,0.608276)"
cx="15.115514"
cy="63.965388"
fx="15.115514"
fy="63.965388"
r="12.289036" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4825"
id="radialGradient6098"
gradientUnits="userSpaceOnUse"
cx="12.071323"
cy="12.493138"
fx="12.071323"
fy="12.493138"
r="6.7175145" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2973"
id="radialGradient6103"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.25463,-0.898371,0.979785,0.277703,-18.00903,32.03312)"
cx="17.903898"
cy="40.159222"
fx="17.903898"
fy="40.159222"
r="14.33681" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2973"
id="radialGradient6106"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.583269,-0.431533,0.577146,0.78008,-5.80022,4.004109)"
cx="12.525543"
cy="38.09042"
fx="12.525543"
fy="38.09042"
r="14.33681" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient1312"
id="radialGradient6109"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.768231,1.13675,-0.820972,0.554824,-3.72248,-85.07126)"
cx="65.800331"
cy="27.16758"
fx="65.800331"
fy="27.16758"
r="12.972491" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4989"
id="radialGradient6115"
cx="16.651781"
cy="32.187485"
fx="16.651781"
fy="32.187485"
r="17.089519"
gradientTransform="matrix(1.486175,-1.536108,0.932321,0.902016,-38.10476,31.42646)"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="0.17254902"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="8"
inkscape:cx="36.250498"
inkscape:cy="38.275489"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1266"
inkscape:window-height="944"
inkscape:window-x="124"
inkscape:window-y="52"
inkscape:showpageshadow="false" />
<metadata
id="metadata4">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>Internet Category</dc:title>
<dc:creator>
<cc:Agent>
<dc:title>Jakub Steiner</dc:title>
</cc:Agent>
</dc:creator>
<dc:contributor>
<cc:Agent>
<dc:title>Tuomas Kuosmanen</dc:title>
</cc:Agent>
</dc:contributor>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/2.0/" />
<dc:source>http://jimmac.musichall.cz</dc:source>
<dc:subject>
<rdf:Bag>
<rdf:li>internet</rdf:li>
<rdf:li>tools</rdf:li>
<rdf:li>applications</rdf:li>
<rdf:li>category</rdf:li>
</rdf:Bag>
</dc:subject>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/2.0/">
<cc:permits
rdf:resource="http://web.resource.org/cc/Reproduction" />
<cc:permits
rdf:resource="http://web.resource.org/cc/Distribution" />
<cc:requires
rdf:resource="http://web.resource.org/cc/Notice" />
<cc:requires
rdf:resource="http://web.resource.org/cc/Attribution" />
<cc:permits
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
<cc:requires
rdf:resource="http://web.resource.org/cc/ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
sodipodi:type="arc"
style="fill:url(#radialGradient6090);fill-opacity:1;stroke:none;stroke-opacity:1"
id="path4112"
sodipodi:cx="24.849752"
sodipodi:cy="38.908627"
sodipodi:rx="20.203051"
sodipodi:ry="7.4751287"
d="M 45.052803 38.908627 A 20.203051 7.4751287 0 1 1 4.6467018,38.908627 A 20.203051 7.4751287 0 1 1 45.052803 38.908627 z"
transform="matrix(0.947409,0,0,1.17786,1.244375,-6.853427)"
inkscape:export-xdpi="480"
inkscape:export-ydpi="480" />
<path
style="fill:url(#radialGradient6115);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 23.942923,0.9561338 L 37.330543,18.266721 C 46.998995,29.84687 41.49692,43.923891 26.7742,45.000491 C 6.0597413,45.582655 6.5086231,27.37483 11.255313,18.609381 L 23.942923,0.9561338 z "
id="path2069"
sodipodi:nodetypes="ccccc" />
<path
style="fill:#1b4075;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 35.111358,26.143133 C 28.972772,13.030586 17.560684,17.697957 17.274449,26.949974 C 16.894738,39.223415 34.748874,37.615429 36.715244,41.468778 C 28.821643,47.675479 14.973233,45.226508 10.962289,39.715204 C 6.9574776,34.212326 7.2383598,25.630263 10.784249,19.587632 C 24.158625,0.978654 39.749127,24.383766 35.111358,26.143133 z "
id="path2969"
sodipodi:nodetypes="cscscc" />
<path
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:white;stroke-width:1.1000706;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.36612022"
d="M 23.996861,3.5433428 L 36.057351,19.151045 C 44.769741,29.58253 39.419346,42.414092 26.125181,43.508521 C 7.3917365,44.015286 7.4275065,28.119221 12.17284,20.333442 L 23.996861,3.5433428 z "
id="path2071"
sodipodi:nodetypes="ccccc" />
<path
style="opacity:0.46;fill:url(#radialGradient6109);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 23.940758,0.96491709 L 34.727367,14.909752 C 42.647208,24.392311 40.447304,20.283975 28.362481,21.278846 C 25.083165,11.203805 18.13871,11.859899 13.523802,15.675236 L 23.940758,0.96491709 z "
id="path3945"
sodipodi:nodetypes="ccccc" />
<path
style="fill:url(#radialGradient6106);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 35.159701,26.173667 C 29.021115,13.06112 18.734027,17.978491 18.447792,27.230508 C 18.068081,39.503949 34.797217,37.645963 36.763587,41.499312 C 28.869986,47.706013 15.021576,45.257042 11.010632,39.745738 C 7.0058197,34.24286 7.2867027,25.660797 10.832592,19.618166 C 24.206968,1.0091879 39.79747,24.4143 35.159701,26.173667 z "
id="path3868"
sodipodi:nodetypes="cscscc" />
<path
style="fill:url(#radialGradient6103);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 35.120795,26.14195 C 28.553327,12.814962 15.685968,17.224233 15.399733,26.47625 C 15.020022,38.749691 32.874158,37.141705 34.840528,40.995054 C 26.946927,47.201755 13.098517,44.752784 9.0875727,39.24148 C 5.0827617,33.738602 5.3636437,25.156539 8.9095327,19.113908 C 22.315509,0.47615954 40.03233,23.660113 35.120795,26.14195 z "
id="path4874"
sodipodi:nodetypes="cscscc" />
<path
transform="matrix(-0.829136,1.052307,1.239307,7.58326e-2,26.32898,25.58605)"
inkscape:r_cy="true"
inkscape:r_cx="true"
d="M 18.788838 12.493138 A 6.7175145 6.7175145 0 1 1 5.3538089,12.493138 A 6.7175145 6.7175145 0 1 1 18.788838 12.493138 z"
sodipodi:ry="6.7175145"
sodipodi:rx="6.7175145"
sodipodi:cy="12.493138"
sodipodi:cx="12.071323"
id="path4941"
style="opacity:0.21999996;color:black;fill:url(#radialGradient6098);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
sodipodi:type="arc" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,433 +0,0 @@
/* XPM */
static char * deluge_xpm[] = {
"32 32 398 2",
" c None",
". c #7B869E",
"+ c #7B869D",
"@ c #A5ADBE",
"# c #A7AFBE",
"$ c #8894A9",
"% c #A4ADBD",
"& c #A7AFBF",
"* c #95A0B4",
"= c #6F7E99",
"- c #A0AABD",
"; c #8594AD",
"> c #8A98B1",
", c #A7B3C6",
"' c #8496AF",
") c #5B6F90",
"! c #8F9EB6",
"~ c #8194AF",
"{ c #7C91AF",
"] c #8096B3",
"^ c #859BB8",
"/ c #A0B1C8",
"( c #728CAD",
"_ c #758BAA",
": c #849AB7",
"< c #6F8AAE",
"[ c #7591B3",
"} c #7995B8",
"| c #7A97B9",
"1 c #86A0C0",
"2 c #93ABC7",
"3 c #6585AE",
"4 c #5A78A0",
"5 c #879FBE",
"6 c #6485AF",
"7 c #698CB5",
"8 c #6E91BA",
"9 c #7295BD",
"0 c #7497BF",
"a c #7296BF",
"b c #89A6C8",
"c c #809FC4",
"d c #436B9C",
"e c #7B99BE",
"f c #5378A6",
"g c #446A9A",
"h c #4B6F9C",
"i c #5577A2",
"j c #6183AE",
"k c #6D92BD",
"l c #7097C3",
"m c #6E96C1",
"n c #8DACCF",
"o c #6C93BF",
"p c #587DA9",
"q c #446592",
"r c #1B4075",
"s c #204478",
"t c #2F5081",
"u c #496791",
"v c #4F6B94",
"w c #5879A4",
"x c #6B93BE",
"y c #6E97C2",
"z c #8EADCF",
"A c #5E89BA",
"B c #3E669A",
"C c #567198",
"D c #24477A",
"E c #315281",
"F c #365685",
"G c #3A5A86",
"H c #405E8A",
"I c #567197",
"J c #577298",
"K c #516E97",
"L c #6187B3",
"M c #7098C4",
"N c #85A7CC",
"O c #5280B6",
"P c #305C92",
"Q c #5A759B",
"R c #2B4D7E",
"S c #3B5A88",
"T c #4C6991",
"U c #597397",
"V c #60799D",
"W c #5C769A",
"X c #587298",
"Y c #637C9E",
"Z c #5D769B",
"` c #526F96",
" . c #5B84B0",
".. c #759BC6",
"+. c #7398C4",
"@. c #325D95",
"#. c #4C6A94",
"$. c #3B5B87",
"%. c #44628C",
"&. c #5B7599",
"*. c #6D84A5",
"=. c #647D9F",
"-. c #6784A8",
";. c #7194BD",
">. c #769EC9",
",. c #709AC4",
"'. c #7293B8",
"). c #6D86A9",
"!. c #526E96",
"~. c #5782B1",
"{. c #7A9EC8",
"]. c #5D8ABC",
"^. c #325485",
"/. c #4F6C94",
"(. c #3D5C88",
"_. c #5E779B",
":. c #7489A8",
"<. c #667FA1",
"[. c #8BA3C1",
"}. c #8BAED4",
"|. c #83A9D3",
"1. c #82A8D2",
"2. c #7FA6D1",
"3. c #7CA4CE",
"4. c #7AA0CC",
"5. c #708EB4",
"6. c #5F789C",
"7. c #4E6C96",
"8. c #5986B9",
"9. c #7FA2CA",
"0. c #4B7CB2",
"a. c #2B5387",
"b. c #567199",
"c. c #305282",
"d. c #506B93",
"e. c #7187A5",
"f. c #6F85A3",
"g. c #8EA4BF",
"h. c #9DBBDC",
"i. c #8EB2D9",
"j. c #8DB1D8",
"k. c #8AAED6",
"l. c #84AAD3",
"m. c #7EA5D0",
"n. c #779FCC",
"o. c #6C8BB0",
"p. c #5E779A",
"q. c #5178A6",
"r. c #5C89BC",
"s. c #7198C4",
"t. c #325486",
"u. c #4C6993",
"v. c #5E789B",
"w. c #778CA8",
"x. c #7389A7",
"y. c #B6CADF",
"z. c #9ABBDF",
"A. c #9BBCE0",
"B. c #9ABCDF",
"C. c #97B9DE",
"D. c #93B6DB",
"E. c #8CB1D8",
"F. c #85ABD4",
"G. c #7CA4CF",
"H. c #749BC9",
"I. c #6783A6",
"J. c #56739C",
"K. c #5283B8",
"L. c #6F96C3",
"M. c #4E7BAE",
"N. c #42618D",
"O. c #3E5C88",
"P. c #667E9F",
"Q. c #7288A7",
"R. c #8EA1BA",
"S. c #B9CFE7",
"T. c #A6C5E6",
"U. c #A7C6E6",
"V. c #A5C4E6",
"W. c #A1C1E3",
"X. c #93B6DC",
"Y. c #8AAFD7",
"Z. c #80A7D1",
"`. c #769FCC",
" + c #6992BF",
".+ c #5D789D",
"++ c #5483B9",
"@+ c #5281B7",
"#+ c #688FBB",
"$+ c #557198",
"%+ c #1E4277",
"&+ c #3F5E88",
"*+ c #687FA0",
"=+ c #6F85A5",
"-+ c #A0B2C8",
";+ c #BFD5ED",
">+ c #B3CFED",
",+ c #B2CFED",
"'+ c #AFCCEB",
")+ c #A9C8E8",
"!+ c #A2C2E4",
"~+ c #99BADF",
"{+ c #78A1CD",
"]+ c #6C97C6",
"^+ c #5D88B7",
"/+ c #4779B2",
"(+ c #7295BE",
"_+ c #3C6699",
":+ c #2B4F83",
"<+ c #59749A",
"[+ c #657D9E",
"}+ c #6C83A3",
"|+ c #A3B4CA",
"1+ c #C7DDF2",
"2+ c #BFD9F4",
"3+ c #BDD7F2",
"4+ c #B8D3F0",
"5+ c #B0CDEC",
"6+ c #9CBDE0",
"7+ c #91B4DA",
"8+ c #79A1CD",
"9+ c #5F8DBF",
"0+ c #4578B1",
"a+ c #6B90BA",
"b+ c #446A9B",
"c+ c #2D5184",
"d+ c #577299",
"e+ c #305181",
"f+ c #5B749A",
"g+ c #6C82A2",
"h+ c #98AAC3",
"i+ c #D2E5F6",
"j+ c #CAE2FA",
"k+ c #C6DEF8",
"l+ c #BED8F3",
"m+ c #B4D0EE",
"n+ c #9EBEE1",
"o+ c #92B5DB",
"p+ c #78A0CD",
"q+ c #6B96C5",
"r+ c #5D8BBE",
"s+ c #5081B7",
"t+ c #4276AF",
"u+ c #6489B4",
"v+ c #4B6E9B",
"w+ c #2C5284",
"x+ c #234679",
"y+ c #4C6990",
"z+ c #6C82A3",
"A+ c #738AA9",
"B+ c #D9E9F9",
"C+ c #D3E9FF",
"D+ c #CCE3FB",
"E+ c #C2DBF5",
"F+ c #B6D2EF",
"G+ c #AAC8E8",
"H+ c #9DBEE1",
"I+ c #90B3DA",
"J+ c #759ECB",
"K+ c #6893C4",
"L+ c #5A89BC",
"M+ c #4D7EB5",
"N+ c #3F73AD",
"O+ c #6386B1",
"P+ c #486A96",
"Q+ c #2A5082",
"R+ c #58739A",
"S+ c #375685",
"T+ c #5F789B",
"U+ c #ADBED3",
"V+ c #D4E9FE",
"W+ c #CFE6FD",
"X+ c #C2DCF6",
"Y+ c #A8C7E7",
"Z+ c #719BC9",
"`+ c #6490C1",
" @ c #5685BA",
".@ c #487AB2",
"+@ c #3F70A8",
"@@ c #6B8BB2",
"#@ c #3F608D",
"$@ c #536F97",
"%@ c #1F4377",
"&@ c #224679",
"*@ c #46638D",
"=@ c #6880A0",
"-@ c #6F86A5",
";@ c #BBCDE0",
">@ c #CEE4FC",
",@ c #C0DAF4",
"'@ c #A5C4E5",
")@ c #96B9DD",
"!@ c #88AED6",
"~@ c #7CA3CE",
"{@ c #719BC8",
"]@ c #6692C2",
"^@ c #5987BA",
"/@ c #4C7CB3",
"(@ c #4672A5",
"_@ c #728DB1",
":@ c #385884",
"<@ c #3C5C89",
"[@ c #385886",
"}@ c #26497B",
"|@ c #4B6790",
"1@ c #6980A1",
"2@ c #768BA9",
"3@ c #9CB1CA",
"4@ c #B9D3EE",
"5@ c #ADCAEA",
"6@ c #9EBFE2",
"7@ c #90B4DA",
"8@ c #87ACD5",
"9@ c #7EA4CE",
"0@ c #749CC8",
"a@ c #6993C1",
"b@ c #5C89BB",
"c@ c #4F7DB1",
"d@ c #5D80AC",
"e@ c #617EA4",
"f@ c #3A547B",
"g@ c #2A4C7E",
"h@ c #1C4176",
"i@ c #27497B",
"j@ c #45628D",
"k@ c #60799C",
"l@ c #7288A6",
"m@ c #7D91AD",
"n@ c #859FBE",
"o@ c #93B4D7",
"p@ c #8FB2D8",
"q@ c #86ABD2",
"r@ c #7EA4CD",
"s@ c #759CC8",
"t@ c #6A94C2",
"u@ c #5C89BA",
"v@ c #547EAE",
"w@ c #7994B6",
"x@ c #44628A",
"y@ c #375786",
"z@ c #476590",
"A@ c #4C6890",
"B@ c #5B7498",
"C@ c #667EA0",
"D@ c #6F86A7",
"E@ c #738CAD",
"F@ c #7592B7",
"G@ c #779AC1",
"H@ c #779DC7",
"I@ c #6993C0",
"J@ c #5B86B6",
"K@ c #7B97BB",
"L@ c #5A769E",
"M@ c #394E6E",
"N@ c #21426C",
"O@ c #45638E",
"P@ c #496691",
"Q@ c #1D4176",
"R@ c #41608B",
"S@ c #4C6891",
"T@ c #506D95",
"U@ c #4E6B94",
"V@ c #4B6A95",
"W@ c #5176A3",
"X@ c #7C99BC",
"Y@ c #6280A8",
"Z@ c #3E567A",
"`@ c #25446F",
" # c #395987",
".# c #214579",
"+# c #294C7E",
"@# c #315383",
"## c #3D5C8A",
"$# c #43618D",
"%# c #5C769C",
"&# c #6D84A6",
"*# c #405E8B",
"=# c #375179",
"-# c #1B304F",
";# c #2E5181",
"># c #415F8C",
",# c #547098",
"'# c #486590",
")# c #43618E",
"!# c #476690",
"~# c #6981A4",
"{# c #677FA3",
"]# c #496690",
"^# c #2E5283",
"/# c #294467",
"(# c #32507C",
"_# c #325684",
":# c #335484",
"<# c #3F5E8B",
"[# c #3E5F8D",
"}# c #345887",
"|# c #305383",
"1# c #2A4466",
" ",
" . + ",
" @ # ",
" $ % & * ",
" = - ; > , ' ",
" ) ! ~ { ] ^ / ( ",
" _ : < [ } | 1 2 3 ",
" 4 5 6 7 8 9 0 a b c ",
" d e f g h i j k l m n o ",
" p q r r s t u v w x y z A ",
" B C r D E F G H I J K L M N O ",
" P Q R S T U V W I X Y Z ` ...+. ",
" @.#.$.%.&.*.=.-.;.>.,.'.).V !.~.{.]. ",
" ^./.(._.:.<.[.}.|.1.2.3.4.5.6.7.8.9.0. ",
" a.b.c.d.e.f.g.h.i.i.j.k.l.m.n.o.p.q.r.s. ",
" t.u.F v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M. ",
" N.c.O.P.Q.R.S.T.U.V.W.A.X.Y.Z.`. +.+++@+#+ ",
" $+%+&+*+=+-+;+>+,+'+)+!+~+i.|.{+]+^+++/+(+_+ ",
" :+<+r G [+}+|+1+2+3+4+5+T.6+7+F.8+]+9+K.0+a+b+ ",
" c+d+r e+f+g+h+i+j+k+l+m+)+n+o+l.p+q+r+s+t+u+v+ ",
" w+Q r x+y+z+A+B+C+D+E+F+G+H+I+|.J+K+L+M+N+O+P+ ",
" Q+R+r r S+T+*+U+V+W+X+F+Y+A.j.2.Z+`+ @.@+@@@#@ ",
" $@%@r &@*@=@-@;@>@,@,+'@)@!@~@{@]@^@/@(@_@:@ ",
" <@[@r r }@|@1@2@3@4@5@6@7@8@9@0@a@b@c@d@e@f@ ",
" g@b.h@r r i@j@k@l@m@n@o@p@q@r@s@t@u@v@w@x@ ",
" y@z@r r r %@y@A@B@C@D@E@F@G@H@I@J@K@L@M@ ",
" N@O@P@Q@r r r s e+R@S@T@` U@V@W@X@Y@Z@ ",
" `@ #Q y@Q@r r .#+#@#[@##$#%#&#*#=# ",
" -#;#>#d+,#'#)#!#u.Q ~#{#]#^#/# ",
" (#_#:# #<#$#[#}#|#1# ",
" ",
" "};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 722 B

View File

@ -1,173 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="744.09448819"
height="1052.3622047"
id="svg2"
sodipodi:version="0.32"
inkscape:version="0.46"
sodipodi:docbase="/home/andrew"
sodipodi:docname="dht.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/dht16.png"
inkscape:export-xdpi="1.9579109"
inkscape:export-ydpi="1.9579109">
<defs
id="defs4">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective10561" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
gridtolerance="10000"
guidetolerance="10"
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.49497475"
inkscape:cx="217.74745"
inkscape:cy="658.24369"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:window-width="1024"
inkscape:window-height="711"
inkscape:window-x="1280"
inkscape:window-y="0"
showgrid="false" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
sodipodi:type="arc"
style="opacity:1;fill:#8dd35f;fill-opacity:1;stroke:#000000;stroke-width:2.48568825;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path3437"
sodipodi:cx="325.71429"
sodipodi:cy="215.21933"
sodipodi:rx="85.714287"
sodipodi:ry="85.714287"
d="M 411.42858,215.21933 A 85.714287,85.714287 0 1 1 240.00001,215.21933 A 85.714287,85.714287 0 1 1 411.42858,215.21933 z"
transform="matrix(1.6800176,0,0,1.6800176,-275.15013,-73.06899)"
inkscape:export-filename="/home/andrew/dht16-2.png"
inkscape:export-xdpi="3.8918922"
inkscape:export-ydpi="3.8918922" />
<path
sodipodi:type="arc"
style="opacity:1;fill:#5599ff;fill-opacity:1;stroke:#000000;stroke-width:2.81711386;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path3439"
sodipodi:cx="325.71429"
sodipodi:cy="215.21933"
sodipodi:rx="85.714287"
sodipodi:ry="85.714287"
d="M 411.42858,215.21933 A 85.714287,85.714287 0 1 1 240.00001,215.21933 A 85.714287,85.714287 0 1 1 411.42858,215.21933 z"
transform="matrix(1.4823682,0,0,1.4823682,82.877111,311.11956)"
inkscape:export-filename="/home/andrew/dht16-2.png"
inkscape:export-xdpi="3.8918922"
inkscape:export-ydpi="3.8918922" />
<path
sodipodi:type="arc"
style="opacity:1;fill:#8dd35f;fill-opacity:1;stroke:#000000;stroke-width:3.2505155;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path3441"
sodipodi:cx="325.71429"
sodipodi:cy="215.21933"
sodipodi:rx="85.714287"
sodipodi:ry="85.714287"
d="M 411.42858,215.21933 A 85.714287,85.714287 0 1 1 240.00001,215.21933 A 85.714287,85.714287 0 1 1 411.42858,215.21933 z"
transform="matrix(1.2847193,0,0,1.2847193,-104.04248,489.18828)"
inkscape:export-filename="/home/andrew/dht16-2.png"
inkscape:export-xdpi="3.8918922"
inkscape:export-ydpi="3.8918922" />
<path
sodipodi:type="arc"
style="opacity:1;fill:#5599ff;fill-opacity:1;stroke:#000000;stroke-width:3.29273035;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path3443"
sodipodi:cx="325.71429"
sodipodi:cy="215.21933"
sodipodi:rx="85.714287"
sodipodi:ry="85.714287"
d="M 411.42858,215.21933 A 85.714287,85.714287 0 1 1 240.00001,215.21933 A 85.714287,85.714287 0 1 1 411.42858,215.21933 z"
transform="matrix(1.2682484,0,0,1.2682484,-282.25061,288.22576)"
inkscape:export-filename="/home/andrew/dht16-2.png"
inkscape:export-xdpi="3.8918922"
inkscape:export-ydpi="3.8918922" />
<path
sodipodi:type="arc"
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:#000000;stroke-width:4.08935796;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path3445"
sodipodi:cx="325.71429"
sodipodi:cy="215.21933"
sodipodi:rx="85.714287"
sodipodi:ry="85.714287"
d="M 411.42858,215.21933 A 85.714287,85.714287 0 1 1 240.00001,215.21933 A 85.714287,85.714287 0 1 1 411.42858,215.21933 z"
transform="matrix(1.0211872,0,0,1.0211872,244.38469,139.31302)"
inkscape:export-filename="/home/andrew/dht16-2.png"
inkscape:export-xdpi="3.8918922"
inkscape:export-ydpi="3.8918922" />
<path
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:10.04848194;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 409.97291,329.4348 L 487.75261,344.44338"
id="path3691"
inkscape:export-filename="/home/andrew/dht16-2.png"
inkscape:export-xdpi="3.8918922"
inkscape:export-ydpi="3.8918922"
sodipodi:nodetypes="cc" />
<path
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:8.96934509;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 423.06163,747.83054 L 464.53048,708.21583"
id="path3693"
inkscape:export-filename="/home/andrew/dht16-2.png"
inkscape:export-xdpi="3.8918922"
inkscape:export-ydpi="3.8918922"
sodipodi:nodetypes="cc" />
<path
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:11.37722969;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 315.62445,431.58184 L 310.19863,651.84005"
id="path3695"
inkscape:export-filename="/home/andrew/dht16-2.png"
inkscape:export-xdpi="3.8918922"
inkscape:export-ydpi="3.8918922"
sodipodi:nodetypes="cc" />
<path
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:10.04848194;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 143.15025,452.25537 L 171.01599,395.38786"
id="path3697"
inkscape:export-filename="/home/andrew/dht16-2.png"
inkscape:export-xdpi="3.8918922"
inkscape:export-ydpi="3.8918922"
sodipodi:nodetypes="cc" />
<path
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:11.37722969;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 360.45007,405.53416 L 474.8177,539.94039"
id="path3699"
inkscape:export-filename="/home/andrew/dht16-2.png"
inkscape:export-xdpi="3.8918922"
inkscape:export-ydpi="3.8918922"
sodipodi:nodetypes="cc" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 B

View File

@ -1,90 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="744.09448819"
height="1052.3622047"
id="svg3535"
sodipodi:version="0.32"
inkscape:version="0.46"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/downloading16.png"
inkscape:export-xdpi="1.7075963"
inkscape:export-ydpi="1.7075963"
sodipodi:docname="downloading.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape">
<defs
id="defs3537">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective3543" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
gridtolerance="10000"
guidetolerance="10"
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.49497475"
inkscape:cx="183.87749"
inkscape:cy="492.74541"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="686"
inkscape:window-height="711"
inkscape:window-x="1941"
inkscape:window-y="99" />
<metadata
id="metadata3540">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:#8dd35f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.07523891000000001px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 337.34641,113.574 L 612.77782,444.9064 C 811.69255,666.55556 698.49522,935.996 395.596,956.6026 C -30.5748,967.74548 -7.5325,620.6669 110.06775,461.45596 L 337.34641,113.574 z"
id="path2069"
sodipodi:nodetypes="ccccc"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/seeding16.png"
inkscape:export-xdpi="1.7060417"
inkscape:export-ydpi="1.7060417" />
<path
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:21.67123985;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.36612022"
d="M 339.91139,163.01784 L 587.46485,461.81598 C 776.20058,681.7222 655.61789,907.17006 386.12406,928.1221 C 6.36766,937.82375 31.27865,636.36028 127.47397,487.30722 L 339.91139,163.01784 z"
id="path2071"
sodipodi:nodetypes="ccccc"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/seeding16.png"
inkscape:export-xdpi="1.7060417"
inkscape:export-ydpi="1.7060417" />
<path
style="fill:#b7e399;fill-opacity:1;stroke:#000000;stroke-width:14.10382843;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 362.09611,847.31541 C 292.72038,779.25618 223.06258,711.37264 153.68685,643.3136 C 191.01405,643.2453 228.43453,643.3817 265.76192,643.3136 C 265.76192,562.7203 265.76192,482.12699 265.76192,401.53369 C 332.08337,401.53369 398.40502,401.53369 464.72665,401.53369 C 464.72665,481.91704 464.72665,562.30041 464.72665,642.68397 C 499.11804,642.62091 533.59544,642.74683 567.98683,642.68397 C 499.37714,710.99547 430.70559,779.00372 362.09611,847.31541 z"
id="rect2634"
inkscape:export-filename="/home/andrew/Projects/deluge/trunk/deluge/data/pixmaps/seeding16.png"
inkscape:export-xdpi="1.7060417"
inkscape:export-ydpi="1.7060417" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

View File

@ -1,2 +0,0 @@
From: http://famfamfam.com/lab/icons/flags/
"These flag icons are available for free use for any purpose with no requirement for attribution."

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 497 B

Some files were not shown because too many files have changed in this diff Show More