Commit Graph

8599 Commits

Author SHA1 Message Date
Calum Lind 5964bcf897 [Tests|Py3] Fix prefetch metdata test 2018-10-10 14:41:10 +01:00
Calum Lind 3ed4a6e834 [WebUI] Fixes for login auth on Python 3
Remove obsolete password check code.
2018-10-10 14:41:10 +01:00
Calum Lind 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
Calum Lind 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
Calum Lind 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
Calum Lind 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
Calum Lind 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
DjLegolas 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
Kirill Romanov 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
Calum Lind 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
Calum Lind 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
Calum Lind 6cf13d112b [Tests] Remove debug traceback 2018-10-05 13:23:45 +01:00
Calum Lind 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
Calum Lind 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
Calum Lind 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
Calum Lind 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
Calum Lind 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
Calum Lind 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
Calum Lind 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
Calum Lind bcca07443c [Common] Fix config missing value assignment 2018-09-30 14:58:11 +01:00
Calum Lind 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
Calum Lind 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
Calum Lind 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
Calum Lind 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
Calum Lind 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
Calum Lind 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
Calum Lind 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
Calum Lind 5a2990ff90 [Core] Handle already prefetching magnet metadata 2018-09-26 14:18:52 +01:00
Calum Lind 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
Calum Lind 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
Calum Lind 57ea5ef5da [GTK] Set default file priority to 4 in add dialog 2018-09-26 14:18:52 +01:00
Calum Lind 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
Calum Lind 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
Calum Lind 8a59216061 [#2398|GTKUI] Fetch magnet files details in Add Dialog 2018-09-26 11:08:30 +01:00
Calum Lind 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
Calum Lind 63b7f6d382 [Tests] Add pytest-twisted to tox deps 2018-09-14 16:06:06 +01:00
Calum Lind 5c4cbf58c5 [Tests] Fix UnicodeWarning for gzipped file comparison 2018-09-14 16:06:06 +01:00
Calum Lind 5959a24d4c [Lint] Flake8 cleanup 2018-09-14 16:06:06 +01:00
Calum Lind d4023e7dde [Py2to3] More fixes for web ui 2018-09-14 16:06:06 +01:00
Calum Lind 0fd3c25684 [Py2to3] Fixes to display Web UI 2018-09-14 16:06:06 +01:00
Calum Lind 4125e35ebd [Py2to3] Fix test_tranfer strings should be bytes 2018-09-14 16:06:06 +01:00
Calum Lind 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
Calum Lind d5133f789a [Py2to3] Fix opening torrent files in byte mode 2018-09-14 16:06:06 +01:00
Calum Lind 1cce6a297c [Py2to3] Further maketorrent fixes 2018-09-14 16:06:06 +01:00
Calum Lind ad20ec62f2 [Py2to3] Fix TorrentInfo metainfo dict key lookups 2018-09-14 16:06:06 +01:00
Calum Lind af2bed8a0f [Py2to3] Fix tests for maketorrent and metafile 2018-09-14 16:06:06 +01:00
Calum Lind b93e868048 [Py2to3] Fix ui_entry default indicator 2018-09-14 16:06:06 +01:00
Calum Lind 8d90ae5ffb [Console] Fix cmdline output and tests 2018-09-14 16:06:06 +01:00
Calum Lind ae4449642c [Py2to3] Fix log.warn deprecation warning 2018-09-14 16:06:06 +01:00
Calum Lind bc2f4a30eb [Py2to3] Fix putChild requires bytes 2018-09-14 16:06:06 +01:00