Skip to content

Commit

Permalink
linting: Remove pylint hint for logger
Browse files Browse the repository at this point in the history
  • Loading branch information
torzdf committed Apr 3, 2024
1 parent 97a8421 commit a9d87ae
Show file tree
Hide file tree
Showing 70 changed files with 70 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ max-returns=6
max-statements=50

# Minimum number of public methods for a class (see R0903).
min-public-methods=2
min-public-methods=1


[CLASSES]
Expand Down
2 changes: 1 addition & 1 deletion lib/align/aligned_face.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import cv2
import numpy as np

logger = logging.getLogger(__name__) # pylint:disable=invalid-name
logger = logging.getLogger(__name__)
CenteringType = T.Literal["face", "head", "legacy"]

_MEAN_FACE = np.array([[0.010086, 0.106454], [0.085135, 0.038915], [0.191003, 0.018748],
Expand Down
2 changes: 1 addition & 1 deletion lib/align/alignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from collections.abc import Generator
from .aligned_face import CenteringType

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)
_VERSION = 2.3
# VERSION TRACKING
# 1.0 - Never really existed. Basically any alignments file prior to version 2.0
Expand Down
2 changes: 1 addition & 1 deletion lib/align/detected_face.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from collections.abc import Callable
from .aligned_face import CenteringType

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


class DetectedFace():
Expand Down
2 changes: 1 addition & 1 deletion lib/cli/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
FilesFullPaths, MultiOption, Radio, SaveFileFullPaths, Slider)
from .launcher import ScriptExecutor

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)
_GPUS = GPUStats().cli_devices

# LOCALES
Expand Down
2 changes: 1 addition & 1 deletion lib/cli/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import argparse
from collections.abc import Callable

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


class ScriptExecutor(): # pylint:disable=too-few-public-methods
Expand Down
2 changes: 1 addition & 1 deletion lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
OrderedDictSectionType = OrderedDict[str, "ConfigSection"]
OrderedDictItemType = OrderedDict[str, "ConfigItem"]

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)
ConfigValueType = bool | int | float | list[str] | str | None


Expand Down
2 changes: 1 addition & 1 deletion lib/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from plugins.convert.mask.mask_blend import Mask as MaskAdjust
from plugins.convert.scaling._base import Adjustment as ScalingAdjust

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from lib.config import FaceswapConfig

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


class Config(FaceswapConfig):
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/analysis/event_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
if T.TYPE_CHECKING:
from collections.abc import Generator, Iterator

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/analysis/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from .event_reader import TensorBoardLogs

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


class GlobalSession():
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .custom_widgets import Tooltip
from .utils import get_images, get_config

logger = logging.getLogger(__name__) # pylint:disable=invalid-name
logger = logging.getLogger(__name__)

# LOCALES
_LANG = gettext.translation("gui.tooltips", localedir="locales", fallback=True)
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/control_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .custom_widgets import ContextMenu, MultiOption, ToggledFrame, Tooltip
from .utils import FileHandler, get_config, get_images

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)

# LOCALES
_LANG = gettext.translation("gui.tooltips", localedir="locales", fallback=True)
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/custom_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from .utils import get_config

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


class ContextMenu(tk.Menu): # pylint: disable=too-many-ancestors
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from .display_command import GraphDisplay, PreviewExtract, PreviewTrain
from .utils import get_config

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)

# LOCALES
_LANG = gettext.translation("gui.tooltips", localedir="locales", fallback=True)
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/display_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from .analysis import Session
from .utils import FileHandler, get_config, get_images, LongRunningTask

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)

# LOCALES
_LANG = gettext.translation("gui.tooltips", localedir="locales", fallback=True)
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/display_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .control_helper import set_slider_rounding
from .utils import FileHandler, get_config, get_images, preview_trigger

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)

# LOCALES
_LANG = gettext.translation("gui.tooltips", localedir="locales", fallback=True)
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/display_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .custom_widgets import Tooltip
from .utils import get_images

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)

# LOCALES
_LANG = gettext.translation("gui.tooltips", localedir="locales", fallback=True)
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
if T.TYPE_CHECKING:
from scripts.gui import FaceswapGui

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)

# LOCALES
_LANG = gettext.translation("gui.menu", localedir="locales", fallback=True)
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .utils import get_images
from .control_helper import ControlPanelOption

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


class CliOptions():
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/popup_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
if T.TYPE_CHECKING:
from lib.config import FaceswapConfig

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)

# LOCALES
_LANG = gettext.translation("gui.tooltips", localedir="locales", fallback=True)
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/popup_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .analysis import Calculations, Session
from .utils import FileHandler, get_images, LongRunningTask

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)

# LOCALES
_LANG = gettext.translation("gui.tooltips", localedir="locales", fallback=True)
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from lib.serializer import get_serializer

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


class _GuiSession(): # pylint:disable=too-few-public-methods
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from lib.utils import FaceswapError


logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


class Style(): # pylint:disable=too-few-public-methods
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from lib.gui.command import CommandNotebook
from lib.gui.command import ToolsNotebook

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)

PATHCACHE = os.path.join(os.path.realpath(os.path.dirname(sys.argv[0])), "lib", "gui", ".cache")
_CONFIG: Config | None = None
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/utils/file_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from tkinter import filedialog
import typing as T

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)
_FILETYPE = T.Literal["default", "alignments", "config_project", "config_task",
"config_all", "csv", "image", "ini", "state", "log", "video"]
_HANDLETYPE = T.Literal["open", "save", "filename", "filename_multi", "save_filename",
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/utils/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
if T.TYPE_CHECKING:
from collections.abc import Sequence

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)
_IMAGES: "Images" | None = None
_PREVIEW_TRIGGER: "PreviewTrigger" | None = None
TRAININGPREVIEW = ".gui_training_preview.png"
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from lib.multithreading import _ErrorType


logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


class LongRunningTask(Thread):
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
if os.name == "nt":
import win32console # pylint: disable=import-error

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


class ProcessWrapper():
Expand Down
2 changes: 1 addition & 1 deletion lib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
if T.TYPE_CHECKING:
from lib.align.alignments import PNGHeaderDict

logger = logging.getLogger(__name__) # pylint:disable=invalid-name
logger = logging.getLogger(__name__)

# ################### #
# <<< IMAGE UTILS >>> #
Expand Down
2 changes: 1 addition & 1 deletion lib/model/backup_restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from lib.serializer import get_serializer
from lib.utils import get_folder

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


class Backup():
Expand Down
2 changes: 1 addition & 1 deletion lib/model/initializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
K = keras.backend


logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


def compute_fans(shape, data_format='channels_last'):
Expand Down
2 changes: 1 addition & 1 deletion lib/model/nn_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from tensorflow import Tensor


logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


_CONFIG: dict = {}
Expand Down
2 changes: 1 addition & 1 deletion lib/model/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if T.TYPE_CHECKING:
from collections.abc import Callable

logger = logging.getLogger(__name__) # pylint:disable=invalid-name
logger = logging.getLogger(__name__)


class KSession():
Expand Down
2 changes: 1 addition & 1 deletion lib/multithreading.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
if T.TYPE_CHECKING:
from collections.abc import Callable, Generator

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)
_ErrorType: T.TypeAlias = tuple[type[BaseException],
BaseException,
TracebackType] | tuple[T.Any, T.Any, T.Any] | None
Expand Down
2 changes: 1 addition & 1 deletion lib/queue_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from queue import Queue, Empty as QueueEmpty # pylint: disable=unused-import; # noqa
from time import sleep

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


class EventQueue(Queue):
Expand Down
2 changes: 1 addition & 1 deletion lib/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
except ImportError:
_HAS_YAML = False

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


class Serializer():
Expand Down
2 changes: 1 addition & 1 deletion lib/training/augmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
if T.TYPE_CHECKING:
from lib.config import ConfigValueType

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion lib/vgg_face.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from lib.utils import GetModel

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


class VGGFace():
Expand Down
2 changes: 1 addition & 1 deletion plugins/convert/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from lib.config import FaceswapConfig

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


class Config(FaceswapConfig):
Expand Down
2 changes: 1 addition & 1 deletion plugins/convert/color/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from plugins.convert._config import Config

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


def get_config(plugin_name, configfile=None):
Expand Down
2 changes: 1 addition & 1 deletion plugins/convert/scaling/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from plugins.convert._config import Config

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


def get_config(plugin_name, configfile=None):
Expand Down
2 changes: 1 addition & 1 deletion plugins/convert/writer/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from plugins.convert._config import Config

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)


def get_config(plugin_name: str, configfile: str | None = None) -> dict:
Expand Down
2 changes: 1 addition & 1 deletion plugins/extract/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from plugins.extract.mask._base import Masker
from plugins.extract.recognition._base import Identity

logger = logging.getLogger(__name__) # pylint:disable=invalid-name
logger = logging.getLogger(__name__)
_INSTANCES = -1 # Tracking for multiple instances of pipeline


Expand Down

0 comments on commit a9d87ae

Please sign in to comment.