From 807fa609f9449f1f18b40ad98c350eca2211037a Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Thu, 22 Oct 2015 23:14:14 +0100 Subject: [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? --- deluge/log.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'deluge/log.py') 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 -- cgit