summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2015-01-07 22:57:18 +0100
committerJan Pokorný <jpokorny@redhat.com>2015-01-09 10:21:43 +0100
commitcc6575a3e1aba2eb08bba8a7f24ca6323fe81cda (patch)
tree1b1bfaaa393392868e7f3f365b82e12074d56926
parent8c1aa2a86c6eb2019c8f0b48b60878b6a1ab4976 (diff)
downloadclufter-cc6575a3e1aba2eb08bba8a7f24ca6323fe81cda.tar.gz
clufter-cc6575a3e1aba2eb08bba8a7f24ca6323fe81cda.tar.xz
clufter-cc6575a3e1aba2eb08bba8a7f24ca6323fe81cda.zip
Mass change: import logging -> from logging import getLogger
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r--command.py4
-rw-r--r--command_context.py4
-rw-r--r--command_manager.py4
-rw-r--r--filter.py4
-rw-r--r--filter_manager.py4
-rw-r--r--filters/ccs2ccsflat.py4
-rw-r--r--plugin_registry.py4
-rw-r--r--protocol.py5
8 files changed, 16 insertions, 17 deletions
diff --git a/command.py b/command.py
index eb610bb..d017846 100644
--- a/command.py
+++ b/command.py
@@ -5,9 +5,9 @@
"""Base command stuff (TBD)"""
__author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>"
-import logging
from collections import MutableMapping
from itertools import izip_longest
+from logging import getLogger
from sys import stderr
from time import time
@@ -40,7 +40,7 @@ from .utils_prog import FancyOutput, \
longopt_letters_reprio, \
defer_common
-log = logging.getLogger(__name__)
+log = getLogger(__name__)
protodecl = lambda x: len(x) == 2 and isinstance(x[0], Filter)
diff --git a/command_context.py b/command_context.py
index f83a674..1be1d00 100644
--- a/command_context.py
+++ b/command_context.py
@@ -5,14 +5,14 @@
"""Command context, i.e., state distributed along filters chain"""
__author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>"
-import logging
from collections import MutableMapping
+from logging import getLogger
from .error import ClufterError
from .utils import isinstanceexcept
from .utils_prog import TweakedDict
-log = logging.getLogger(__name__)
+log = getLogger(__name__)
class CommandContextError(ClufterError):
diff --git a/command_manager.py b/command_manager.py
index 42daa49..c2689bd 100644
--- a/command_manager.py
+++ b/command_manager.py
@@ -5,7 +5,7 @@
"""Command manager"""
__author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>"
-import logging
+from logging import getLogger
from os.path import abspath, dirname, join
from textwrap import wrap
from sys import modules
@@ -19,7 +19,7 @@ from .utils import filterdict_keep
from .utils_func import apply_intercalate, bifilter
from .utils_prog import make_options, set_logging
-log = logging.getLogger(__name__)
+log = getLogger(__name__)
class CommandManagerError(ClufterError):
diff --git a/filter.py b/filter.py
index 3fad855..27aee56 100644
--- a/filter.py
+++ b/filter.py
@@ -5,8 +5,8 @@
"""Base filter stuff (metaclass, decorator, etc.)"""
__author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>"
-import logging
from copy import deepcopy
+from logging import getLogger
from os import environ, isatty, stat
from os.path import dirname, join
from shlex import split as shlex_split
@@ -47,7 +47,7 @@ except ImportError:
EDITOR = ''
EDITOR = environ.get('EDITOR', EDITOR)
-log = logging.getLogger(__name__)
+log = getLogger(__name__)
DEFAULT_ROOT_DIR = join(dirname(__file__), 'filters')
diff --git a/filter_manager.py b/filter_manager.py
index 5407b7d..23fef4e 100644
--- a/filter_manager.py
+++ b/filter_manager.py
@@ -5,7 +5,7 @@
"""Filter manager"""
__author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>"
-import logging
+from logging import getLogger
from .error import ClufterError
from .filter import filters
@@ -13,7 +13,7 @@ from .format import CompositeFormat
from .format_manager import FormatManager
from .plugin_registry import PluginManager
-log = logging.getLogger(__name__)
+log = getLogger(__name__)
class FilterManagerError(ClufterError):
diff --git a/filters/ccs2ccsflat.py b/filters/ccs2ccsflat.py
index 4083744..322a65a 100644
--- a/filters/ccs2ccsflat.py
+++ b/filters/ccs2ccsflat.py
@@ -5,7 +5,7 @@
"""ccs2ccsflat filter"""
__author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>"
-import logging
+from logging import getLogger
from os.path import split as path_split
from subprocess import PIPE
@@ -17,7 +17,7 @@ try:
except ImportError:
CCS_FLATTEN = 'ccs_flatten'
-log = logging.getLogger(__name__)
+log = getLogger(__name__)
@Filter.deco('ccs', 'ccs-flat')
diff --git a/plugin_registry.py b/plugin_registry.py
index 0da38d7..4f504b0 100644
--- a/plugin_registry.py
+++ b/plugin_registry.py
@@ -5,10 +5,10 @@
"""Easy (at least for usage) plugin framework"""
__author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>"
-import logging
from contextlib import contextmanager
from fnmatch import translate
from imp import PY_SOURCE, find_module, get_suffixes, load_module
+from logging import getLogger
from os import walk
from os.path import abspath, dirname, isabs, isdir, join, splitext
from re import compile as re_compile
@@ -25,7 +25,7 @@ from .utils import args2tuple, \
from .utils_func import apply_intercalate
from .utils_prog import ProtectedDict, cli_decor, getenv_namespaced
-log = logging.getLogger(__name__)
+log = getLogger(__name__)
module_ext = dict((t, s) for s, m, t in get_suffixes())[PY_SOURCE]
here = dirname(abspath(__file__))
diff --git a/protocol.py b/protocol.py
index 46582c4..88bdbed 100644
--- a/protocol.py
+++ b/protocol.py
@@ -5,15 +5,14 @@
"""Base protocol stuff (metaclass, etc.)"""
__author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>"
-import logging
-
from collections import MutableMapping
+from logging import getLogger
from .plugin_registry import PluginRegistry
from .utils import args2sgpl, tuplist
from .utils_prog import cli_undecor
-log = logging.getLogger(__name__)
+log = getLogger(__name__)
protodict = lambda x: isinstance(x, MutableMapping) and 'passin' in x
protodictval = lambda x: args2sgpl(x['passin']) if protodict(x) else x