summaryrefslogtreecommitdiffstats
path: root/deluge/transfer.py
Commit message (Collapse)AuthorAge
* Upgrade codebase with pyupgrade (>=py3.6)DjLegolas2021-12-29
| | | | | | | | 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
* Remove all Python 2 supportdeluge-2.1.0.dev0DjLegolas2021-12-28
| | | | | | | | | * 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
* [Lint] Fix spelling mistakesCalum Lind2021-09-21
| | | | | | | 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.
* [Docs] Updates and fixes to build on Python 3Calum Lind2019-05-21
| | | | | | | | | | | - 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.
* Modify the transfer protocol in a couple ways.Andrew Resch2018-11-12
| | | | | 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.
* [Dependency] Remove bundled rencodeCalum Lind2018-11-02
|
* [Lint] Use Black to auto-format codeCalum Lind2018-10-03
| | | | | | | | | | | | | | | | | 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.
* [Py2to3] Fix log.warn deprecation warningCalum Lind2018-09-14
|
* [Py3] Fix tranfer header first byte checkCalum Lind2018-06-27
| | | | | The index of a byte in Python 3 will return an integer so use slice for compatibility with 2/3
* [Core] Markup byte-strings to fix httpdownloader and core testsCalum Lind2017-02-22
| | | | | | | * 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).
* [Py2to3] Force unicode_literals and fix related issuesCalum Lind2017-02-22
| | | | | | | | | | | | | | | | | | * 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.
* [Lint] Refactor flake8 noqa's and add msg numbersCalum Lind2016-11-04
| | | | | | From pep8-naming: * N802: function name should be lowercase * N803: argument name should be lowercase
* [Lint] Convert all python double quotes to single quotesCalum Lind2016-11-03
| | | | | | | | | | | | | | | | | | * 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>`
* [Core] Add ClientDisconnectedEventbendikro2015-12-04
|
* [Lint] Code cleanup for PyLint run by prospector toolCalum Lind2015-10-30
| | | | | | | | * 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.
* [Lint] Cleanup code to pass PyLint Warning categoryCalum Lind2015-10-30
| | | | | | | | | | | | | | | | 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?
* Flake8 pass of entire codebaseCalum Lind2014-09-19
| | | | * Use the inline '# NOQA' to supress N802 lower-case warnings
* Flake8 core and common filesCalum Lind2014-09-03
| | | | | | * 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
* Sort/prettify imports with isortCalum Lind2014-09-03
|
* [Python-Modernize] lib2to3.fixes.fix_exceptCalum Lind2014-09-03
| | | | | * Use 'ex' instead of 'e' to conform with pylint * Minimal Flake8 on some files
* Fix #2338 : Spelling mistake with occurredCalum Lind2013-06-09
|
* Fix and update testsCalum Lind2013-05-01
|
* Add decode_utf8 argument to rencode.loads, which decodes all strings from utf8.Chase Sterling2012-11-26
| | | | Update rpc protocol to load all strings as unicode.
* Added a protocol for the network traffic between client and daemon.bendikro2012-07-02
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.