[elbe-devel] [PATCH] python3: remove unnecessary object inheritance

Bastian Germann bage at linutronix.de
Tue Dec 15 15:05:52 CET 2020


Am 15.12.20 um 15:03 schrieb Christian Teklenborg:
> Since the Python2 support has been dropped we dont need the object inheritance
> anymore. Python3 does the object inheritance implicitly.
> 
> Signed-off-by: Christian Teklenborg <chris at linutronix.de>

Reviewed-by: Bastian Germann <bage at linutronix.de>

> ---
>   elbepack/aptpkgutils.py          |  4 +---
>   elbepack/asyncworker.py          |  4 +---
>   elbepack/changelogxml.py         |  4 +---
>   elbepack/commands/check-build.py |  4 +---
>   elbepack/commands/test.py        |  4 +---
>   elbepack/db.py                   | 20 +++++---------------
>   elbepack/dbaction.py             |  4 +---
>   elbepack/efilesystem.py          |  4 +---
>   elbepack/egpg.py                 |  4 +---
>   elbepack/elbeproject.py          |  4 +---
>   elbepack/elbexml.py              |  8 ++------
>   elbepack/filesystem.py           |  4 +---
>   elbepack/finetuning.py           |  4 +---
>   elbepack/fstab.py                |  4 +---
>   elbepack/hashes.py               |  4 +---
>   elbepack/hdimg.py                |  8 ++------
>   elbepack/initvmaction.py         |  4 +---
>   elbepack/junit.py                |  8 ++------
>   elbepack/licencexml.py           |  4 +---
>   elbepack/log.py                  |  4 +---
>   elbepack/packers.py              |  4 +---
>   elbepack/pbuilderaction.py       |  4 +---
>   elbepack/projectmanager.py       |  8 ++------
>   elbepack/repomanager.py          |  8 ++------
>   elbepack/rfs.py                  |  4 +---
>   elbepack/rpcaptcache.py          |  4 +---
>   elbepack/soapclient.py           |  8 ++------
>   elbepack/toolchain.py            |  4 +---
>   elbepack/treeutils.py            |  8 ++------
>   elbepack/updated.py              | 12 +++---------
>   elbepack/updated_monitors.py     |  4 +---
>   elbepack/virtapt.py              |  4 +---
>   elbepack/xmldefaults.py          |  4 +---
>   elbepack/xmlpreprocess.py        |  4 +---
>   34 files changed, 47 insertions(+), 141 deletions(-)
> 
> diff --git a/elbepack/aptpkgutils.py b/elbepack/aptpkgutils.py
> index 0d96c0ff..49a02dfb 100644
> --- a/elbepack/aptpkgutils.py
> +++ b/elbepack/aptpkgutils.py
> @@ -139,9 +139,7 @@ def fetch_binary(version, destdir='', progress=None):
>   
>       return os.path.abspath(destfile)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class PackageBase(object):
> +class PackageBase:
>   
>       # pylint: disable=too-many-instance-attributes
>   
> diff --git a/elbepack/asyncworker.py b/elbepack/asyncworker.py
> index 3d72fe88..07ef1a05 100644
> --- a/elbepack/asyncworker.py
> +++ b/elbepack/asyncworker.py
> @@ -22,9 +22,7 @@ from elbepack.shellhelper import do
>   from elbepack.log import elbe_logging, read_maxlevel, reset_level
>   
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class AsyncWorkerJob(object):
> +class AsyncWorkerJob:
>   
>       build_done   = "build_done"
>       build_failed = "build_failed"
> diff --git a/elbepack/changelogxml.py b/elbepack/changelogxml.py
> index 1d80c445..e0400328 100644
> --- a/elbepack/changelogxml.py
> +++ b/elbepack/changelogxml.py
> @@ -9,9 +9,7 @@ from elbepack.treeutils import etree
>   
>   remove_re = re.compile(u'[\x00-\x08\x0B-\x0C\x0E-\x1F\x7F]')
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class changelogs_xml(object):
> +class changelogs_xml:
>       def __init__(self):
>           self.outxml = etree(None)
>           self.pkglist = self.outxml.setroot('pkgchangelogs')
> diff --git a/elbepack/commands/check-build.py b/elbepack/commands/check-build.py
> index ff1e2a9c..606b726e 100644
> --- a/elbepack/commands/check-build.py
> +++ b/elbepack/commands/check-build.py
> @@ -66,9 +66,7 @@ def run_command(argv):
>   class CheckException(Exception):
>       pass
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class CheckBase(object):
> +class CheckBase:
>   
>       tests = dict()
>   
> diff --git a/elbepack/commands/test.py b/elbepack/commands/test.py
> index 2c84e2b3..68cc0574 100644
> --- a/elbepack/commands/test.py
> +++ b/elbepack/commands/test.py
> @@ -39,9 +39,7 @@ class ElbeTestCase(unittest.TestCase):
>       def parameterize(self, param):
>           return self.__class__(methodName=self.methodName, param=param)
>   
> -# TODO:py3 - Remove useless object inheritance
> -# pylint: disable=useless-object-inheritance
> -class ElbeTestSuite(object):
> +class ElbeTestSuite:
>   
>       # This must be a list not a set!!!
>       tests  = []
> diff --git a/elbepack/db.py b/elbepack/db.py
> index 682cfca7..0b8c2d13 100644
> --- a/elbepack/db.py
> +++ b/elbepack/db.py
> @@ -95,9 +95,7 @@ def _update_project_file(s, builddir, name, mime_type, description):
>   
>       return filename
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class ElbeDB(object):
> +class ElbeDB:
>   
>       # pylint: disable=too-many-public-methods
>   
> @@ -1049,9 +1047,7 @@ class User(Base):
>       admin = Column(Boolean)
>       projects = relationship("Project", backref="owner")
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class UserData (object):
> +class UserData:
>       def __init__(self, user):
>           self.id = int(user.id)
>           self.name = str(user.name)
> @@ -1073,9 +1069,7 @@ class Project (Base):
>       versions = relationship("ProjectVersion", backref="project")
>       files = relationship("ProjectFile", backref="project")
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class ProjectData (object):
> +class ProjectData:
>       def __init__(self, project):
>           self.builddir = str(project.builddir)
>           self.name = str(project.name)
> @@ -1097,9 +1091,7 @@ class ProjectVersion (Base):
>       description = Column(String)
>       timestamp = Column(DateTime, default=datetime.utcnow)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class ProjectVersionData (object):
> +class ProjectVersionData:
>       def __init__(self, pv):
>           self.builddir = str(pv.builddir)
>           self.version = str(pv.version)
> @@ -1127,9 +1119,7 @@ class ProjectFile (Base):
>       mime_type = Column(String, nullable=False)
>       description = Column(String)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class ProjectFileData (object):
> +class ProjectFileData:
>       def __init__(self, pf):
>           self.name = str(pf.name)
>           self.builddir = str(pf.builddir)
> diff --git a/elbepack/dbaction.py b/elbepack/dbaction.py
> index e4c46640..b6442974 100644
> --- a/elbepack/dbaction.py
> +++ b/elbepack/dbaction.py
> @@ -12,9 +12,7 @@ from getpass import getpass
>   from shutil import copyfileobj
>   from elbepack.db import ElbeDB, ElbeDBError
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class DbAction(object):
> +class DbAction:
>   
>       actiondict = {}
>   
> diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
> index 18b592a4..62626a61 100644
> --- a/elbepack/efilesystem.py
> +++ b/elbepack/efilesystem.py
> @@ -224,9 +224,7 @@ class ElbeFilesystem(Filesystem):
>           if xml_fname is not None:
>               licence_xml.write(xml_fname)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class Excursion(object):
> +class Excursion:
>   
>       RFS = {}
>   
> diff --git a/elbepack/egpg.py b/elbepack/egpg.py
> index ffd224f2..995ab97f 100644
> --- a/elbepack/egpg.py
> +++ b/elbepack/egpg.py
> @@ -27,10 +27,8 @@ elbe_internal_key_param = """
>   </GnupgKeyParms>
>   """
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
>   # pylint: disable=too-many-instance-attributes
> -class OverallStatus(object):
> +class OverallStatus:
>   
>       def __init__(self):
>           self.invalid = 0
> diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
> index af9f2ff1..6fce66e2 100644
> --- a/elbepack/elbeproject.py
> +++ b/elbepack/elbeproject.py
> @@ -117,9 +117,7 @@ def gen_sdk_scripts(triplet,
>   
>       return sdkname
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class ElbeProject (object):
> +class ElbeProject:
>   
>       # pylint: disable=too-many-instance-attributes
>       # pylint: disable=too-many-public-methods
> diff --git a/elbepack/elbexml.py b/elbepack/elbexml.py
> index 50126753..fb488bb0 100644
> --- a/elbepack/elbexml.py
> +++ b/elbepack/elbexml.py
> @@ -43,9 +43,7 @@ class ValidationError(Exception):
>   class NoInitvmNode(Exception):
>       pass
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class ValidationMode(object):
> +class ValidationMode:
>       NO_CHECK = 1
>       CHECK_BINARIES = 2
>       CHECK_ALL = 0
> @@ -58,9 +56,7 @@ def replace_localmachine(mirror, initvm=True):
>   
>       return mirror.replace("LOCALMACHINE", localmachine)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class ElbeXML(object):
> +class ElbeXML:
>   
>       # pylint: disable=too-many-public-methods
>   
> diff --git a/elbepack/filesystem.py b/elbepack/filesystem.py
> index 54a01a3e..36ecdb14 100644
> --- a/elbepack/filesystem.py
> +++ b/elbepack/filesystem.py
> @@ -49,9 +49,7 @@ def size_to_int(size):
>   
>       return int(s) * unit
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class Filesystem(object):
> +class Filesystem:
>   
>       # pylint: disable=too-many-public-methods
>   
> diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
> index ea76dd54..cfc30331 100644
> --- a/elbepack/finetuning.py
> +++ b/elbepack/finetuning.py
> @@ -29,9 +29,7 @@ from elbepack.shellhelper import chroot, do, get_command_out
>   class FinetuningException(Exception):
>       pass
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class FinetuningAction(object):
> +class FinetuningAction:
>   
>       actiondict = {}
>   
> diff --git a/elbepack/fstab.py b/elbepack/fstab.py
> index f3e0f575..eb9b45e0 100644
> --- a/elbepack/fstab.py
> +++ b/elbepack/fstab.py
> @@ -72,9 +72,7 @@ class mountpoint_dict (dict):
>           return [self[x] for x in mplist]
>   
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class fstabentry(object):
> +class fstabentry:
>   
>       # pylint: disable=too-many-instance-attributes
>   
> diff --git a/elbepack/hashes.py b/elbepack/hashes.py
> index 1e3ea0a7..dc3c5415 100644
> --- a/elbepack/hashes.py
> +++ b/elbepack/hashes.py
> @@ -23,9 +23,7 @@ def validate_sha256(fname, expected_hash):
>                   'file "%s" failed to verify ! got: "%s" expected: "%s"' %
>                   (fname, m.hexdigest(), expected_hash))
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class HashValidator(object):
> +class HashValidator:
>       def __init__(self, base_url):
>           self.hashes = {}
>           self.base_url = base_url
> diff --git a/elbepack/hdimg.py b/elbepack/hdimg.py
> index 965fff85..96facbe9 100644
> --- a/elbepack/hdimg.py
> +++ b/elbepack/hdimg.py
> @@ -143,9 +143,7 @@ def build_image_mtd(mtd, target):
>       return img_files
>   
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class grubinstaller_base(object):
> +class grubinstaller_base:
>       def __init__(self, fw_type=None):
>           self.fs = mountpoint_dict()
>           self.fw_type = fw_type if fw_type else []
> @@ -294,9 +292,7 @@ class grubinstaller97(grubinstaller_base):
>               do("kpartx -d %s" % poopdev, allow_fail=True)
>               do("losetup -d %s" % poopdev, allow_fail=True)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class simple_fstype(object):
> +class simple_fstype:
>       def __init__(self, typ):
>           self.type = typ
>   
> diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
> index 4c086cf9..2e09df27 100644
> --- a/elbepack/initvmaction.py
> +++ b/elbepack/initvmaction.py
> @@ -48,9 +48,7 @@ class InitVMError(Exception):
>       def __init__(self, msg):
>           Exception.__init__(self, msg)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class InitVMAction(object):
> +class InitVMAction:
>       actiondict = {}
>   
>       @classmethod
> diff --git a/elbepack/junit.py b/elbepack/junit.py
> index 7de96c21..005bbf22 100644
> --- a/elbepack/junit.py
> +++ b/elbepack/junit.py
> @@ -10,9 +10,7 @@ import junit_xml as junit
>   class TestException(Exception):
>       pass
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class TestSuite(object):
> +class TestSuite:
>   
>       test_dict = {}
>   
> @@ -52,10 +50,8 @@ class TestSuite(object):
>                                test_cases=test_cases)
>           return ts
>   
> -# TODO:py3 - Remove object inheritance
> -# pylint: disable=useless-object-inheritance
>   @TestSuite.register("BaseTest", register=False)
> -class BaseTest(object):
> +class BaseTest:
>   
>       tag = None
>   
> diff --git a/elbepack/licencexml.py b/elbepack/licencexml.py
> index 8fb2b92d..800665b1 100644
> --- a/elbepack/licencexml.py
> +++ b/elbepack/licencexml.py
> @@ -43,9 +43,7 @@ def get_heuristics_license_list(c):
>   
>       return set(licenses)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class copyright_xml (object):
> +class copyright_xml:
>       def __init__(self):
>           self.outxml = etree(None)
>           self.pkglist = self.outxml.setroot('pkglicenses')
> diff --git a/elbepack/log.py b/elbepack/log.py
> index e81559f4..b97481d7 100644
> --- a/elbepack/log.py
> +++ b/elbepack/log.py
> @@ -219,9 +219,7 @@ def close_logging():
>               h.close()
>       local.handlers = []
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class AsyncLogging(object):
> +class AsyncLogging:
>   
>       def __init__(self, atmost, stream, block):
>           self.lines = []
> diff --git a/elbepack/packers.py b/elbepack/packers.py
> index 3ef6024a..bcf4ccde 100644
> --- a/elbepack/packers.py
> +++ b/elbepack/packers.py
> @@ -6,9 +6,7 @@
>   import os
>   from elbepack.shellhelper import CommandError, do
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class Packer(object):
> +class Packer:
>   
>       def pack_file(self, _builddir, _fname):
>           raise NotImplementedError('abstract method called')
> diff --git a/elbepack/pbuilderaction.py b/elbepack/pbuilderaction.py
> index 29f3f9b7..ea6ac583 100644
> --- a/elbepack/pbuilderaction.py
> +++ b/elbepack/pbuilderaction.py
> @@ -32,9 +32,7 @@ class PBuilderError(Exception):
>       def __init__(self, msg):
>           Exception.__init__(self, msg)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class PBuilderAction(object):
> +class PBuilderAction:
>       actiondict = {}
>   
>       @classmethod
> diff --git a/elbepack/projectmanager.py b/elbepack/projectmanager.py
> index 7f5cf9cf..f28055de 100644
> --- a/elbepack/projectmanager.py
> +++ b/elbepack/projectmanager.py
> @@ -56,17 +56,13 @@ class InvalidState(ProjectManagerError):
>       def __init__(self, message):
>           ProjectManagerError.__init__(self, message)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class OpenProjectFile(object):
> +class OpenProjectFile:
>       def __init__(self, pfd, mode='r'):
>           self.path = path.join(pfd.builddir, pfd.name)
>           self.mime_type = pfd.mime_type
>           self.fobj = open(self.path, mode)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class ProjectManager(object):
> +class ProjectManager:
>   
>       # pylint: disable=too-many-public-methods
>   
> diff --git a/elbepack/repomanager.py b/elbepack/repomanager.py
> index 9586af4d..672ed1e6 100644
> --- a/elbepack/repomanager.py
> +++ b/elbepack/repomanager.py
> @@ -18,9 +18,7 @@ from elbepack.pkgutils import get_dsc_size
>   from elbepack.egpg import generate_elbe_internal_key, export_key, unlock_key
>   from elbepack.shellhelper import CommandError, do
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class RepoAttributes(object):
> +class RepoAttributes:
>       def __init__(self, codename, arch, components,
>                    mirror='http://ftp.de.debian.org/debian'):
>           self.codename = codename
> @@ -49,9 +47,7 @@ class RepoAttributes(object):
>   
>           return [RepoAttributes(self.codename, ret_arch, ret_comp, self.mirror)]
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class RepoBase(object):
> +class RepoBase:
>   
>       # pylint: disable=too-many-instance-attributes
>   
> diff --git a/elbepack/rfs.py b/elbepack/rfs.py
> index b7975796..2f433637 100644
> --- a/elbepack/rfs.py
> +++ b/elbepack/rfs.py
> @@ -60,9 +60,7 @@ class DebootstrapException (Exception):
>       def __init__(self):
>           Exception.__init__(self, "Debootstrap Failed")
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class BuildEnv (object):
> +class BuildEnv:
>       def __init__(self, xml, path, build_sources=False, clean=False, arch="default", hostsysroot=False):
>   
>           # pylint: disable=too-many-arguments
> diff --git a/elbepack/rpcaptcache.py b/elbepack/rpcaptcache.py
> index d7b21ee8..4d3e9f0d 100644
> --- a/elbepack/rpcaptcache.py
> +++ b/elbepack/rpcaptcache.py
> @@ -59,9 +59,7 @@ class MyMan(BaseManager):
>           super(MyMan, self).start(MyMan.redirect_outputs, [r, w])
>           async_logging(r, w, soap, log)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class InChRootObject(object):
> +class InChRootObject:
>       def __init__(self, rfs):
>           self.rfs = rfs
>           self.rfs.enter_chroot()
> diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
> index 81ef8fe0..7d66ffd2 100644
> --- a/elbepack/soapclient.py
> +++ b/elbepack/soapclient.py
> @@ -43,9 +43,7 @@ def set_suds_debug(debug):
>           logging.getLogger('suds.umx.typed').setLevel(logging.ERROR)
>           logging.getLogger('suds.client').setLevel(logging.CRITICAL)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class ElbeSoapClient(object):
> +class ElbeSoapClient:
>       def __init__(self, host, port, user, passwd, retries=10, debug=False):
>   
>           # pylint: disable=too-many-arguments
> @@ -118,9 +116,7 @@ class ElbeSoapClient(object):
>               fp.write(binascii.a2b_base64(ret))
>               part = part + 1
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class ClientAction(object):
> +class ClientAction:
>       actiondict = {}
>   
>       @classmethod
> diff --git a/elbepack/toolchain.py b/elbepack/toolchain.py
> index c4a8ec92..fd242863 100644
> --- a/elbepack/toolchain.py
> +++ b/elbepack/toolchain.py
> @@ -11,9 +11,7 @@ import os
>   
>   arch2triple = {"armhf": "arm-linux-gnueabihf", "armel": "arm-linux-gnueabi"}
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class Toolchain(object):
> +class Toolchain:
>       libc_path = "${triple}/libc"
>       gcc_libpath = "${triple}/lib"
>       pkg_libs = {}
> diff --git a/elbepack/treeutils.py b/elbepack/treeutils.py
> index 7e4550a1..9b9dcaa0 100644
> --- a/elbepack/treeutils.py
> +++ b/elbepack/treeutils.py
> @@ -11,9 +11,7 @@ from lxml.etree import XMLParser, parse
>   
>   # ElementTree helpers
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class eiter(object):
> +class eiter:
>       def __init__(self, it):
>           self.it = it
>   
> @@ -30,9 +28,7 @@ class eiter(object):
>   
>           return elem(n)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class ebase(object):
> +class ebase:
>       def __init__(self, et):
>           self.et = et
>   
> diff --git a/elbepack/updated.py b/elbepack/updated.py
> index f9117153..6ec2e5c6 100644
> --- a/elbepack/updated.py
> +++ b/elbepack/updated.py
> @@ -37,9 +37,7 @@ from elbepack.egpg import unsign_file
>   from elbepack.treeutils import etree
>   from elbepack.shellhelper import CommandError, system
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class UpdateStatus(object):
> +class UpdateStatus:
>   
>       # pylint: disable=too-many-instance-attributes
>   
> @@ -149,9 +147,7 @@ class UpdateService (ServiceBase):
>           self.app.status.monitor = Client(wsdl_url, timeout=cfg['soaptimeout'])
>           self.app.status.log("connection established")
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class rw_access_file(object):
> +class rw_access_file:
>       def __init__(self, filename, status):
>           self.filename = filename
>           self.rw = rw_access(filename, status)
> @@ -167,9 +163,7 @@ class rw_access_file(object):
>               self.f.close()
>           self.rw.__exit__(typ, value, traceback)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class rw_access(object):
> +class rw_access:
>       def __init__(self, directory, status):
>           self.status = status
>           self.directory = directory
> diff --git a/elbepack/updated_monitors.py b/elbepack/updated_monitors.py
> index 8424aaa4..2cd42581 100644
> --- a/elbepack/updated_monitors.py
> +++ b/elbepack/updated_monitors.py
> @@ -11,9 +11,7 @@ import pyudev
>   
>   from elbepack.updated import is_update_file, handle_update_file
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class UpdateMonitor(object):
> +class UpdateMonitor:
>       def __init__(self, status):
>           self.status = status
>   
> diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
> index 5acb60cb..aeb2ee14 100644
> --- a/elbepack/virtapt.py
> +++ b/elbepack/virtapt.py
> @@ -68,9 +68,7 @@ def lookup_uri(v, d, target_pkg):
>   
>       return target_pkg, uri, hashval
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class VirtApt(object):
> +class VirtApt:
>       def __init__(self, xml):
>   
>           # pylint: disable=too-many-statements
> diff --git a/elbepack/xmldefaults.py b/elbepack/xmldefaults.py
> index d642c7e3..2e4f1d4e 100644
> --- a/elbepack/xmldefaults.py
> +++ b/elbepack/xmldefaults.py
> @@ -198,9 +198,7 @@ def get_random_mac():
>   
>       return ':'.join(s)
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class ElbeDefaults(object):
> +class ElbeDefaults:
>   
>       def __init__(self, build_type):
>   
> diff --git a/elbepack/xmlpreprocess.py b/elbepack/xmlpreprocess.py
> index a6f5276f..b991c6ea 100644
> --- a/elbepack/xmlpreprocess.py
> +++ b/elbepack/xmlpreprocess.py
> @@ -329,9 +329,7 @@ def xmlpreprocess(fname, output, variants=None, proxy=None):
>       raise XMLPreprocessError("\n".join(error_log_to_strings(schema.error_log)))
>   
>   
> -# TODO:py3 Remove object inheritance
> -# pylint: disable=useless-object-inheritance
> -class PreprocessWrapper(object):
> +class PreprocessWrapper:
>       def __init__(self, xmlfile, opt):
>           self.xmlfile = xmlfile
>           self.outxml = None
> 


More information about the elbe-devel mailing list