Commit Graph

8390 Commits

Author SHA1 Message Date
Calum Lind 939835cef1 Fix warning with label glade files 2017-03-17 16:44:23 +00:00
Calum Lind 9e303b58a0 Refactor common magnet funcs 2017-03-17 10:26:17 +00:00
Calum Lind 112a872bc1 [#2716] [Common] Update magnet funcs for tracker tiers tr.x 2017-03-17 10:26:17 +00:00
Calum Lind 6424333c35 [GTKUI] Refactor adding list of trackers 2017-03-17 10:26:17 +00:00
Calum Lind 267d331fac [#2476] [GTKUI] Fix adding mistyped trackers urls 2017-03-17 10:26:17 +00:00
Calum Lind 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
Calum Lind 7c6c9eae7f [WebUI] Fix error displaying tracker icons 2017-03-16 23:22:58 +00:00
Calum Lind 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
Calum Lind e3abdf9901 Use super class call where possible 2017-03-16 23:20:57 +00:00
Calum Lind af7e83bc76 Replace/remove usage of dict.keys() 2017-03-16 23:20:56 +00:00
Calum Lind 4a274466ac Add python 3 section to tox 2017-03-16 23:20:56 +00:00
Calum Lind 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
Calum Lind 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
Kyle Neideck 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
Calum Lind 35c78eee41 Update to 1.1.2 libtorrent requirement 2017-03-15 09:56:19 +00:00
Calum Lind 5348465e60 Fix 1d1bb2a2a issue by defining init in DelugeRPCProtocol 2017-03-14 19:29:45 +00:00
Calum Lind 1d1bb2a2a7 [#2964] Fix RPC TypeError using namedtuple 2017-03-14 18:02:33 +00:00
Calum Lind 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
Calum Lind 1e696fe6ca Fix type in manpage 2017-03-14 17:21:38 +00:00
Calum Lind 90631cca88 Fix console test 2017-03-14 15:48:20 +00:00
Calum Lind 50c476c41d Update man pages to reflect ui arg changes
- Also fixup help output details
2017-03-14 14:58:59 +00:00
Calum Lind 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
Calum Lind 966678196e [WebUI] Use error logging and add exception message detail 2017-03-01 14:47:42 +00:00
Calum Lind 11e8957dea [WebUI] Only accept application/json content-type requests
- Protects against CSRF (Cross-site request forgery)
2017-03-01 14:47:42 +00:00
Calum Lind 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
Calum Lind fb8dc42acf [Core] Catch None type country in get_peers 2017-02-23 19:16:04 +00:00
Calum Lind 4df88c0df3 [UI] Refactor appdata.xml code and markup translatable text 2017-02-23 19:02:32 +00:00
Matthias Mailänder 3529036f55 [UI] Add an appdata.xml file
For Linux software gallery integration.
2017-02-23 19:01:44 +00:00
Calum Lind f2b77c8635 [WebUI] Linting trailing comma 2017-02-23 16:52:06 +00:00
Calum Lind 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
Matias Wilkman d75afc007d [GTKUI] Parse u:p@host:port pasted into proxy or connection manager 2017-02-23 09:46:39 +00:00
Calum Lind b32c5d8247 [Daemon] Improve logging when another process is using listen port 2017-02-23 09:31:58 +00:00
Calum Lind 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
Calum Lind 52a85cb91c [Console] Fix showing file priorites 2017-02-23 00:30:56 +00:00
Calum Lind 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
Calum Lind 3b1eeb0818 Use Ubuntu Trusty on Travis 2017-02-23 00:21:33 +00:00
Calum Lind 9ad2f50fa4 [Common] Decode byte strings for TorrentInfo 2017-02-23 00:21:33 +00:00
Calum Lind bbd2661acb [WebUI] Fix missing low.png for file priority 2017-02-23 00:21:33 +00:00
Calum Lind b2a2995c0d [GTKUI] Use int not string number for select_path 2017-02-23 00:21:32 +00:00
Calum Lind 5a9784ff4d Fix msgfmt for Python 3 and unicode_literal 2017-02-23 00:21:32 +00:00
Calum Lind ba41110c27 [WebUI] Markup byte strings for twisted request 2017-02-22 12:45:12 +00:00
Calum Lind 608ecae5fd [Console] Use raw string for regex compile 2017-02-22 12:45:12 +00:00
Calum Lind 04b8b14828 [Console] Use io.open to en/decode utf8 files 2017-02-22 12:45:11 +00:00
Calum Lind 4619b31aa3 [Console] Ensure opening torrent files in binary mode 2017-02-22 12:45:11 +00:00
Calum Lind e3b8aaf276 [Tests] Markup byte strings to fix tests 2017-02-22 12:45:11 +00:00
Calum Lind 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
Calum Lind 304ad1e72d [Lint] Add missing copyright header to files 2017-02-22 12:36:33 +00:00
Calum Lind 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
Calum Lind 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
Calum Lind 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