1140 Commits

Author SHA1 Message Date
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
fb8dc42acf [Core] Catch None type country in get_peers 2017-02-23 19:16:04 +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
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
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
b7162fab36 [#2956] Fix empty file_priorities with magnets 2017-02-21 10:37:09 +00:00
Calum Lind
f6e2dab58a [#2826] Fix create_torrent filedump not encoded 2017-02-21 10:13:30 +00:00
Calum Lind
4a62c5eac2 [Core] Switch move_storage flag to dont_replace 2017-02-21 10:10:57 +00:00
Calum Lind
14d9b6cfcb Temp workaround for critical pickle trackers lt bug 2017-02-20 12:45:44 +00:00
Calum Lind
a7826c4f90 [Core] Use fallback message for empty tracker error status 2017-01-28 15:23:08 +00:00
Calum Lind
8c26c83c4d [#2960] Fix typo in storage moved alert 2017-01-28 14:27:27 +00:00
Calum Lind
4a344e382b [UI] [Core] Update and refactor proxy settings
* Combine I2P into proxy settings.
2017-01-26 12:49:55 +00:00
Calum Lind
706d53ab4a [Core] Move readonly key setting closer to config init 2017-01-26 12:49:38 +00:00
Calum Lind
2321f32f84 [Core] Fix double alert messages 2017-01-26 12:49:36 +00:00
Calum Lind
5d7c1336b9 [Core] Use new lt torrent moving_storage status 2017-01-26 12:49:04 +00:00
Calum Lind
93898d6475 [Core] Use single underscore for private methods 2017-01-26 12:49:02 +00:00
Calum Lind
4caf05c092 [Core] Refactor torrent.set_file_priorities 2017-01-26 12:49:02 +00:00
Calum Lind
6083a3078e [Core] Minor cleanup of preferencesmanager 2017-01-26 12:49:01 +00:00
Calum Lind
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
Calum Lind
3ed7202253 [Core] Remove deprecated lt torrent priority 2017-01-26 12:48:43 +00:00
Calum Lind
089c0be89b [Core] Replace deprecated lt.fingerprint with peer_fingerprint setting 2017-01-25 12:35:33 +00:00
Calum Lind
fc902af10c [Core] Remove all lt 1.1 deprecated code references 2017-01-18 14:19:37 +00:00
Calum Lind
bb44411a50 [Core] Check valid torrent first in alert handlers 2017-01-18 12:33:26 +00:00
Calum Lind
6743b0c813 [Core] Relocate add_torrent_alert to alerts section 2016-11-30 23:21:46 +00:00
Calum Lind
b69ba02652 [Core] Refactor default add torrent flags into a constant 2016-11-30 23:21:45 +00:00
Calum Lind
915f2bf9e7 [Core] Move alert logging to alertmanager 2016-11-30 22:53:18 +00:00
Calum Lind
59b01b363c [Core] Refactor TM register of alert and set funcs 2016-11-30 22:53:18 +00:00
Calum Lind
c5e623ae45 [Core] Refactor of priorities code and test 2016-11-30 22:53:18 +00:00
Calum Lind
3260db416a [Core] Add a quick fix for lt1.1 default priority change 2016-11-28 19:18:48 +00:00
Calum Lind
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
Calum Lind
7283e8b668 [Core] Deprecate prioritize_first_last for prioritize_first_last_pieces 2016-11-22 20:45:58 +00:00
Calum Lind
f3f380553a [Core] Fix KeyError if only file_priorities in options 2016-11-22 20:45:57 +00:00
Calum Lind
4a9d2d2129 [Core] Decorate methods deprecated 2016-11-22 20:45:57 +00:00
Calum Lind
179de3b0ff [#495] Deprecate core.set_torrent_* for core.set_torrent_options 2016-11-22 20:45:57 +00:00
Calum Lind
2657cc3921 [Lint] Quote cleanup 2016-11-17 10:19:59 +00:00
Calum Lind
6bd3c6fa88 [#2922] [Core] Fix using incorrect type for peer_tos in lt 1.1 2016-11-08 20:25:16 +00:00
Calum Lind
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
Calum Lind
bbe9de9463 [Core] Disable apply_settings for enc policy until fix can be found 2016-11-06 00:14:07 +00:00
Calum Lind
2bdbcf9a39 [#2922] Fix interfaces and outgoing ports for lt 1.1 2016-11-05 23:30:01 +00:00
Calum Lind
fd80ed75fe [#2922] Fix proxy settings and torrent status for lt 1.1 2016-11-05 15:49:39 +00:00
Calum Lind
0890cc1a33 [#2922] Fix session.apply_sessings alert_mask 2016-11-05 11:30:31 +00:00
Calum Lind
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
Calum Lind
af6b277d28 [Lint] Add flake8-quotes to tox and fix bad quotes 2016-11-04 00:10:23 +00:00
Calum Lind
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
Calum Lind
d4a8a38586 [Core] Refactor out duplicate prefsmgr log lines 2016-11-03 12:05:55 +00:00
Calum Lind
a87ce825ad [Core] Remove old geoip.dat code and fix log line 2016-11-03 11:37:20 +00:00