Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: autofix useless object inheritance pylint rule #6050

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dracut/driver_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def find_isos(mnt):
return [mnt+'/'+f for f in os.listdir(mnt) if f.lower().endswith('.iso')]


class Driver(object):
class Driver:
"""Represents a single driver (rpm), as listed by dd_list"""
def __init__(self, source="", name="", flags="", description="", repo=""):
self.source = source
Expand Down Expand Up @@ -590,7 +590,7 @@ def finish(user_request, topdir="/tmp"):
# --- DEVICE LISTING HELPERS FOR THE MENU -----------------------------------


class DeviceInfo(object):
class DeviceInfo:
def __init__(self, **kwargs):
self.device = kwargs.get("DEVNAME", '')
self.uuid = kwargs.get("UUID", '')
Expand Down Expand Up @@ -638,7 +638,7 @@ def get_deviceinfo():
# --- INTERACTIVE MENU JUNK ------------------------------------------------


class TextMenu(object):
class TextMenu:
def __init__(self, items, title=None, formatter=None, headeritem=None,
refresher=None, multi=False, page_height=20):
self.items = items
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/anaconda.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
log = get_module_logger(__name__)


class Anaconda(object):
class Anaconda:
def __init__(self):
self._display_mode = None
self._interactive_mode = True
Expand Down
6 changes: 3 additions & 3 deletions pyanaconda/anaconda_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
program_log_lock = Lock()


class _AnacondaLogFixer(object):
class _AnacondaLogFixer:
""" A mixin for logging.StreamHandler that does not lock during format.

Add this mixin before the Handler type in the inheritance order.
Expand All @@ -74,7 +74,7 @@ def stream(self, stream):
# Wrap the stream write in a lock acquisition
# Use an object proxy in order to work with types that may not allow
# the write property to be set.
class WriteProxy(object):
class WriteProxy:

def write(self, *args, **kwargs):
handler.acquire() # pylint: disable=no-member
Expand Down Expand Up @@ -149,7 +149,7 @@ def filter(self, record):
return True


class AnacondaLog(object):
class AnacondaLog:
SYSLOG_CFGFILE = "/etc/rsyslog.conf"

def __init__(self, write_to_journal=False):
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/argument_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def name_path_pairs(image_specs):
yield name, path


class HelpTextParser(object):
class HelpTextParser:
"""Class to parse help text from file and make it available to option
parser.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/core/configuration/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _set_option(self, option_name, value):
set_option(self._parser, self._section_name, option_name, value)


class Configuration(object):
class Configuration:
"""A base class for representation of a configuration handler."""

def __init__(self):
Expand Down
4 changes: 2 additions & 2 deletions pyanaconda/core/configuration/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
__all__ = ["ProfileLoader"]


class ProfileData(object):
class ProfileData:
"""A class that represents a profile."""

def __init__(self):
Expand Down Expand Up @@ -100,7 +100,7 @@ def _read_profile_detection_section(self, parser):
self.variant_id = get_option(parser, section_name, "variant_id")


class ProfileLoader(object):
class ProfileLoader:
"""A class for loading information about profiles from configuration files."""

def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/core/kickstart/specification.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
]


class KickstartSpecification(object):
class KickstartSpecification:
"""Specification of kickstart data.

This specification can be used to get the corresponding
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/core/payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class ProxyStringError(Exception):


# TODO: Add tests
class ProxyString(object):
class ProxyString:
""" Handle a proxy url."""
def __init__(self, url=None, protocol="http://", host=None, port="3128",
username=None, password=None):
Expand Down
4 changes: 2 additions & 2 deletions pyanaconda/core/process_watchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
__all__ = ["PidWatcher", "WatchProcesses"]


class PidWatcher(object):
class PidWatcher:
"""Watch for process and call callback when the process ends."""

def __init__(self):
Expand All @@ -53,7 +53,7 @@ def cancel(self):
self._id = 0


class WatchProcesses(object):
class WatchProcesses:
"""Static class for watching external processes."""

# Dictionary of processes to watch in the form {pid: [name, GLib event source id], ...}
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/core/signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from weakref import WeakKeyDictionary


class Signal(object):
class Signal:
def __init__(self):
# The original implementation used WeakSet to store functions,
# but that causes lambdas without any other reference to be
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/core/startup/dbus_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
__all__ = ["AnacondaDBusLauncher"]


class AnacondaDBusLauncher(object):
class AnacondaDBusLauncher:
"""Class for launching the Anaconda DBus modules."""

DBUS_LAUNCH_BIN = "dbus-daemon"
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/core/threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
_WORKER_THREAD_PREFIX = "AnaWorkerThread"


class ThreadManager(object):
class ThreadManager:
"""A singleton class for managing threads and processes.

Notes:
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/core/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from pyanaconda.core.glib import timeout_add, timeout_add_seconds, source_remove


class Timer(object):
class Timer:
"""Object to schedule functions and methods to the GLib event loop.

Everything scheduled by Timer is ran on the main thread!
Expand Down
4 changes: 2 additions & 2 deletions pyanaconda/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def execReadlines(command, argv, stdin=None, root='/', env_prune=None, filter_st
This returns an iterator with the lines from the command until it has finished
"""

class ExecLineReader(object):
class ExecLineReader:
"""Iterator class for returning lines from a process and cleaning
up the process when the output is no longer needed.
"""
Expand Down Expand Up @@ -799,7 +799,7 @@ def get_anaconda_version_string(build_time_version=False):
return "unknown"


class LazyObject(object):
class LazyObject:
"""The lazy object."""

def __init__(self, getter):
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ExitError(RuntimeError):
# TOP-LEVEL ERROR HANDLING OBJECT
###

class ErrorHandler(object):
class ErrorHandler:
"""This object makes up one part of anaconda's error handling system. This
part is the UI-agnostic error callback. Throughout anaconda, various
error conditions can occur in places that need to pop up a dialog, but
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


# A lot of effort, but it only allows a limited set of flags to be referenced
class Flags(object):
class Flags:
def __setattr__(self, attr, val):
# pylint: disable=no-member
if attr not in self.__dict__ and not self._in_init:
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/gnome_remote_desktop.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def shutdown_server():
log.error("Shutdown of the GNOME Remote Desktop session failed with exception:\n%s", e)


class GRDServer(object):
class GRDServer:

def __init__(self, anaconda, root="/", ip=None,
rdp_username="", rdp_password=""):
Expand Down
12 changes: 6 additions & 6 deletions pyanaconda/input_checking.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_policy(policy_name) -> PasswordPolicy:
return PasswordPolicy.from_defaults(policy_name)


class PwqualitySettingsCache(object):
class PwqualitySettingsCache:
"""Cache for libpwquality settings used for password validation.

Libpwquality settings instantiation is probably not exactly cheap
Expand All @@ -75,7 +75,7 @@ def get_settings_by_minlen(self, minlen):
pwquality_settings_cache = PwqualitySettingsCache()


class PasswordCheckRequest(object):
class PasswordCheckRequest:
"""A wrapper for a password check request.

This in general means the password to be checked as well as its validation criteria
Expand Down Expand Up @@ -200,7 +200,7 @@ def secret_type(self, new_type):
self._secret_type = new_type


class CheckResult(object):
class CheckResult:
"""Result of an input check."""

def __init__(self):
Expand Down Expand Up @@ -312,7 +312,7 @@ def length_ok(self, value):
self.length_ok_changed.emit(value)


class InputCheck(object):
class InputCheck:
"""Input checking base class."""

def __init__(self):
Expand Down Expand Up @@ -571,7 +571,7 @@ def run(self, check_request):
self.result.success = False


class InputField(object):
class InputField:
"""An input field containing data to be checked.

The input field can have an initial value that can be
Expand Down Expand Up @@ -602,7 +602,7 @@ def content(self, new_content):
self._initial_change_signal_fired = True


class PasswordChecker(object):
class PasswordChecker:
"""Run multiple password and input checks in a given order and report the results.

All added checks (in insertion order) will be run and results returned as error message
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/installation_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
log = get_module_logger(__name__)


class BaseTask(object):
class BaseTask:
"""A base class for Task and TaskQueue.

It holds shared methods, properties and signals.
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def add_controller(controller_name, controller_categories):
return controller


class Controller(object):
class Controller:
"""A singleton that track initialization of Anaconda modules."""
def __init__(self):
self._lock = RLock()
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/modules/boss/install_manager/install_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
log = get_module_logger(__name__)


class InstallManager(object):
class InstallManager:
"""Manager of the system installation."""

def __init__(self):
Expand Down
4 changes: 2 additions & 2 deletions pyanaconda/modules/boss/kickstart_manager/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from enum import Enum


class KickstartElement(object):
class KickstartElement:
"""Stores element parsed from kickstart with reference to file.

Element can be a command, a section or an addon. Addon is not considered
Expand Down Expand Up @@ -140,7 +140,7 @@ def _get_content(self, args, lines):
return content


class KickstartElements(object):
class KickstartElements:
"""Container for storing and filtering KickstartElement objects

Preserves order of added elements.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
__all__ = ['KickstartManager']


class KickstartManager(object):
class KickstartManager:
"""Distributes kickstart to modules and collects it back."""

def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/modules/boss/module_manager/module_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
log = get_module_logger(__name__)


class ModuleManager(object):
class ModuleManager:
"""A class for managing kickstart modules."""

def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/modules/localization/localed.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
log = get_module_logger(__name__)


class LocaledWrapper(object):
class LocaledWrapper:
"""Class wrapping systemd-localed daemon functionality."""

def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/modules/network/device_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
]


class DeviceConfigurations(object):
class DeviceConfigurations:
"""Stores the state of persistent configuration of network devices.

Contains only configuration of devices supported by Anaconda.
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/modules/payloads/payload/dnf/dnf_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class InvalidSelectionError(DNFManagerError):
"""The software selection couldn't be resolved."""


class DNFManager(object):
class DNFManager:
"""The abstraction of the DNF base."""

def __init__(self):
Expand Down
4 changes: 2 additions & 2 deletions pyanaconda/modules/payloads/payload/dnf/tree_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class InvalidTreeInfoError(TreeInfoMetadataError):
pass


class TreeInfoMetadata(object):
class TreeInfoMetadata:
"""The representation of a .treeinfo file.

The structure of the installation root can be similar to this:
Expand Down Expand Up @@ -382,7 +382,7 @@ def get_root_repository(self):
return None


class TreeInfoRepoMetadata(object):
class TreeInfoRepoMetadata:
"""Metadata repo object contains metadata about repository."""

def __init__(self, repo_name, tree_info, root_url):
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/modules/payloads/payload/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
__all__ = ["PayloadFactory"]


class PayloadFactory(object):
class PayloadFactory:
"""Factory to create payloads."""

@staticmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
log = get_module_logger(__name__)


class DownloadProgress(object):
class DownloadProgress:
"""Provide methods for image download progress reporting."""

def __init__(self, url, total_size, callback):
Expand Down
Loading
Loading