diff options
author | Calum Lind <calumlind+deluge@gmail.com> | 2015-10-22 23:14:14 +0100 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2015-10-30 18:39:47 +0000 |
commit | 807fa609f9449f1f18b40ad98c350eca2211037a (patch) | |
tree | f88d68646cb20fd02f8809fbb2877d5717c69459 /deluge/log.py | |
parent | ad3cba929ee175a5990e617461bc3a638e557a97 (diff) | |
download | deluge-807fa609f9449f1f18b40ad98c350eca2211037a.tar.gz deluge-807fa609f9449f1f18b40ad98c350eca2211037a.tar.bz2 deluge-807fa609f9449f1f18b40ad98c350eca2211037a.zip |
[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?
Diffstat (limited to 'deluge/log.py')
-rw-r--r-- | deluge/log.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/deluge/log.py b/deluge/log.py index 68d56ba3c..8a2ce2aea 100644 --- a/deluge/log.py +++ b/deluge/log.py @@ -12,6 +12,7 @@ import inspect import logging +import logging.handlers import os from twisted.internet import defer @@ -94,7 +95,6 @@ class Logging(LoggingLoggerClass): return rv levels = { - "none": logging.NOTSET, "info": logging.INFO, "warn": logging.WARNING, "warning": logging.WARNING, @@ -114,7 +114,6 @@ def setup_logger(level="error", filename=None, filemode="w"): :param level: str, the level to log :param filename: str, the file to log to """ - import logging if logging.getLoggerClass() is not Logging: logging.setLoggerClass(Logging) @@ -126,7 +125,6 @@ def setup_logger(level="error", filename=None, filemode="w"): root_logger = logging.getLogger() if filename and filemode == "a": - import logging.handlers handler = logging.handlers.RotatingFileHandler( filename, filemode, maxBytes=50 * 1024 * 1024, # 50 Mb @@ -135,7 +133,6 @@ def setup_logger(level="error", filename=None, filemode="w"): delay=0 ) elif filename and filemode == "w": - import logging.handlers handler = getattr( logging.handlers, "WatchedFileHandler", logging.FileHandler)( filename, filemode, "utf-8", delay=0 |