51 Commits

Author SHA1 Message Date
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
Andrew Resch
d579efa041 [Lint] Fix various pylint warnings and fixup code
* Use print function
 * Fix except as statements
 * Remove old twisted 8 code
 * Remove empty docstring
 * Refactor try statement to only contain the relevant import and
   disable pylint import msgs.
 * Use flake8 noqa and pylint comment and drop pyflakes workarounds.
2016-10-26 09:58:43 +01:00
Calum Lind
9dd3b1617d [#2889] Fixes for 'Too many files open' error
* Ensure all file descriptors are closed. Using the with statement ensures
   closure.
 * The main problem was with thousands of unclosed file desciptors from
   tracker_icons mkstemp.
 * Use a prefix 'deluge_ticon.' to identify created tracker_icon tmp files.
2016-10-18 18:40:25 +01:00
bendikro
fc6672adda Fix #2789: Test for google tracker icon redirect is failing 2016-04-07 22:11:25 +01:00
Calum Lind
807fa609f9 [Lint] Cleanup code to pass PyLint Warning category
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?
2015-10-30 18:39:47 +00:00
Calum Lind
32bc20d8ce Fix pep8 across codebase
* Further whitespace fixes by autopep8
 * Using pep8 v1.6.2 (not currently used by pyflakes)
 * Update config for pep8 and flake8 in tox.ini
   * A separate pep8 entry for running autopep8. The ignores prevent
     blank lines being added after docstrings.
   * .tox and E133 are ignored in flake8 by default.
2015-10-21 00:06:27 +01:00
Calum Lind
83262afda1 Flake8 codebase
Fixes error E265 and E714 that have been added to newest version of pep8
2014-09-22 12:46:18 +01:00
Calum Lind
5167e93d12 Flake8 core and common files
* 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
2014-09-03 23:48:34 +01:00
Calum Lind
b5dcfc6f9e Sort/prettify imports with isort 2014-09-03 18:27:32 +01:00
Calum Lind
fc7a136c70 [Python-Modernize] lib2to3.fixes.fix_numliterals 2014-09-03 17:22:39 +01:00
Calum Lind
7cdedbea1f [Python-Modernize] libmodernize.fixes.fix_raise 2014-09-03 17:22:39 +01:00
Calum Lind
38bc5d07f0 [Python-Modernize] lib2to3.fixes.fix_ws_comma
* Fixer that changes 'a ,b' into 'a, b'.
2014-09-03 17:22:38 +01:00
Calum Lind
1e6c811768 [Python-Modernize] lib2to3.fixes.fix_except
* Use 'ex' instead of 'e' to conform with pylint
 * Minimal Flake8 on some files
2014-09-03 17:22:38 +01:00
Calum Lind
9290cc1f7a Fix building the code documentation with sphinx
Updated Sphinx conf and tested with Sphinx 1.2.1
Moved webui gen_gettext script
Fixed docstring warning in code
Renamed console update-tracker to update_tracker
2014-02-20 17:38:51 +00:00
bendikro
8ecc0e11a7 Fix for #1885 and add simple caching to the data funcs for the torrentview
* Fix for #1885 (Wrong tracker icon in torrent list)
* Moved the data functions from torrentview/listview into
  torrentview_data_funcs.py
* Added caching the current value of the cell renderer for the data functions
* Reordered if-tests in deluge.common.fsize
* Disable data funcs when column is hidden
2013-12-23 16:21:24 +00:00
Calum Lind
9d48d04f0f Fix #2338 : Spelling mistake with occurred 2013-06-09 02:30:26 +01:00
bendikro
463ac0c07e Optimized torrentview.cell_data_trackericon
cell_data_trackericon would load the tracker icon with
gtk.gdk.pixbuf_new_from_file_at_size each time it's requested.
These regular requests acumulating to thousands calls to
pixbuf_new_from_file_at_size with a big torrent list.

Now, read the tracker icon from disk once, and cache it.
2013-02-17 18:41:35 +00:00
Calum Lind
763af17e71 Add tracker host details to debug logging 2013-02-17 16:04:22 +00:00
John Garland
129c09c5a7 Don't use deprecated twisted imports (fixes #2164)
Aliases have been removed in twisted 12.2.0.
2012-09-16 17:19:46 +10:00
Pedro Algarvio
3b00a7de59 Swhiched the old style logging, ie, a single logger for all logging output to several loggers. This brings the ability to tweak the logging levels for each of the loggers, ie, we can have the "deluge" logger be at the ERROR level while having "deluge.core" at the DEBUG level, meaning we will only see log message for all of the deluge loggers above the ERROR level while still having all messages above the DEBUG level for the "deluge.core" logger and it's children. This kind of tweak can be achieved by adding a file named "logging.conf" to deluge's config dir and this is explained on the deluge.log.tweak_logging_levels function.
Passing `-r` to the cli's while also passing `-l` will make the logfile rotate when reaching 5Mb in size. Three backups will be kept at all times.
All deluge's code is now using this new style logging along with the git hosted plugins. For other plugins not hosted by deluge, which still imports `LOG` as the logger, a deprecation warning will be shown explaining the required changes needed to use the new style logging. New plugins created by the `create_plugin` script will use the new logging facilities.
2010-12-06 11:20:22 +00:00
John Garland
22a1448372 Only use an icon if it passes some sanity checks 2010-07-17 17:11:19 +10:00
John Garland
d800273891 Handle os.remove failing on windows 2010-06-08 03:19:30 +10:00
John Garland
7f60867ae9 Update docstrings to use names from previous commit 2010-05-09 17:05:22 +10:00
John Garland
71d8836118 Use better names for TrackerIcons' args 2010-05-09 17:01:15 +10:00
John Garland
97d6f8ce80 Return the noIcon for empty strings as well 2010-05-09 16:43:22 +10:00
John Garland
ca7f009e74 Raise IconsError instead of IndexError (fixes infinite looping) 2010-05-09 16:31:32 +10:00
John Garland
e8788bde08 Make host_to_url support redirection and add another test 2010-05-08 16:25:16 +10:00
John Garland
815a71fe8b Try favicon.ico if there's a HTMLParseError 2010-05-08 15:50:04 +10:00
John Garland
53a9c217e7 Fix tracker_icons not handling relative redirects 2010-05-05 04:05:52 +10:00
John Garland
d6c8b13041 Handle trackers with incorrect / missing icon mimetypes 2010-05-05 03:19:54 +10:00
John Garland
d28cf93686 Rename mimetype helper methods and rewrite to use a common dict 2010-05-05 02:31:05 +10:00
Damien Churchill
e4ef17975c stop parsing the html page once the parser has left the <head> of the page 2010-05-03 21:28:25 +01:00
Damien Churchill
53930e0898 handle non-supported images/files in the icons folder 2010-05-03 20:38:57 +01:00
John Garland
88929d4821 Rewrite tracker_icons.py (#995) 2010-05-04 04:37:19 +10:00
Damien Churchill
e0f2c2473e fix error, use os.makedirs instead of os.mkdir, effectively mkdir -p 2010-04-17 22:13:17 +01:00
Andrew Resch
4be615b084 Fix #1218 improper use of callLater 2010-04-08 15:00:07 -07:00
Andrew Resch
0ddb1526a1 Add 'plain' as a possible ico type 2009-09-09 05:12:41 +00:00
Andrew Resch
72d3b0a549 Fix exception when tracker column is not enabled 2009-06-09 21:44:24 +00:00
Andrew Resch
d67477f6e2 Add OpenSSL exception to all GPL headers 2009-05-18 21:51:49 +00:00
Andrew Resch
c754fc7c74 Remove dep on gobject and replace with twisted.reactor.callLater 2009-05-12 16:57:35 +00:00
Andrew Resch
7b72d79d32 Made TrackerIcons a component to prevent trying to get an icon multiple
times
Fixed showing the wrong tracker icon in the TorrentView when the icon 
could not be retrieved from the tracker
2009-04-28 02:35:08 +00:00
Andrew Resch
2542745c16 Add tracker icon to Tracker column 2009-04-18 17:46:14 +00:00
Andrew Resch
d542666f20 Fix some deprecation warnings and imports 2009-02-20 14:32:28 +00:00
Andrew Resch
8f68fc9e07 Add support for more tracker icons 2009-01-16 03:31:21 +00:00
Andrew Resch
ebc24e35dd Fix #729 tracker icons not being saved in the correct location 2009-01-16 03:18:43 +00:00
Andrew Resch
24ad257fdd Fix tracker icons config dir 2008-12-08 07:38:17 +00:00
Andrew Resch
0ffc306d83 Fix tracker_icons to use the correct config directory, not the default
one
2008-12-05 21:49:54 +00:00
Andrew Resch
c6ddaeaac7 Remove OpenSSL exception from license headers 2008-11-23 04:58:01 +00:00
Andrew Resch
695e6a8c6e Fix alignment of tracker icons when tracker does not have an icon 2008-11-08 15:49:32 +00:00
Andrew Resch
eb9578c41d Attempt to get tracker icon from html source
Use blank icon for trackers that do not have a favicon available (to 
make things aligned)
Force 16x16 for tracker icons
2008-10-27 04:49:06 +00:00