| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
The index of a byte in Python 3 will return an integer so use slice for
compatibility with 2/3
|
|
|
|
|
|
|
| |
* 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).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
From pep8-naming:
* N802: function name should be lowercase
* N803: argument name should be lowercase
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>`
|
| |
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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?
|
|
|
|
| |
* Use the inline '# NOQA' to supress N802 lower-case warnings
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
| |
* Use 'ex' instead of 'e' to conform with pylint
* Minimal Flake8 on some files
|
| |
|
| |
|
|
|
|
| |
Update rpc protocol to load all strings as unicode.
|
|
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.
|