[bmap-tools] [PATCH 12/14] Make all classes to be of new style

Artem Bityutskiy dedekind1 at gmail.com
Tue Jan 21 12:34:33 EST 2014


From: Artem Bityutskiy <artem.bityutskiy at intel.com>

Pylint nowadays prints something like this when it sees old-style classes:

C: 41, 0: Old-style class defined. (old-style-class)

Let's fix it globally by making all our classes to be of new style.

Change-Id: If9cd20bc85247a50aac140575b3e7b6d51a9a564
Signed-off-by: Artem Bityutskiy <artem.bityutskiy at intel.com>
---
 bmaptool                | 2 +-
 bmaptools/BmapCopy.py   | 2 +-
 bmaptools/BmapCreate.py | 2 +-
 bmaptools/Filemap.py    | 2 +-
 bmaptools/TransRead.py  | 4 ++--
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/bmaptool b/bmaptool
index 047ddc3..0c6a349 100755
--- a/bmaptool
+++ b/bmaptool
@@ -64,7 +64,7 @@ import shutil
 import io
 from bmaptools import BmapCreate, BmapCopy, BmapHelpers, TransRead
 
-class NamedFile:
+class NamedFile(object):
     """
     This simple class allows us to override the 'name' attribute of a file
     object. The reason is that some classes use the 'name' attribute of the
diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py
index ebce45a..eedeafe 100644
--- a/bmaptools/BmapCopy.py
+++ b/bmaptools/BmapCopy.py
@@ -73,7 +73,7 @@ class Error(Exception):
     """
     pass
 
-class BmapCopy:
+class BmapCopy(object):
     """
     This class implements the bmap-based copying functionality. To copy an
     image with bmap you should create an instance of this class, which requires
diff --git a/bmaptools/BmapCreate.py b/bmaptools/BmapCreate.py
index e562a53..6e9e2f9 100644
--- a/bmaptools/BmapCreate.py
+++ b/bmaptools/BmapCreate.py
@@ -104,7 +104,7 @@ class Error(Exception):
     """
     pass
 
-class BmapCreate:
+class BmapCreate(object):
     """
     This class implements the bmap creation functionality. To generate a bmap
     for an image (which is supposedly a sparse file), you should first create
diff --git a/bmaptools/Filemap.py b/bmaptools/Filemap.py
index fcc2f2c..2c120bf 100644
--- a/bmaptools/Filemap.py
+++ b/bmaptools/Filemap.py
@@ -42,7 +42,7 @@ class Error(Exception):
     pass
 
 
-class _FilemapBase:
+class _FilemapBase(object):
     """
     This is a base class for a couple of other classes in this module. This
     class simply performs the common parts of the initialization process: opens
diff --git a/bmaptools/TransRead.py b/bmaptools/TransRead.py
index b7c575d..c0782ef 100644
--- a/bmaptools/TransRead.py
+++ b/bmaptools/TransRead.py
@@ -81,7 +81,7 @@ class Error(Exception):
     """
     pass
 
-class _CompressedFile:
+class _CompressedFile(object):
     """
     This class implements transparent reading from a compressed file-like
     object and decompressing its contents on-the-fly.
@@ -217,7 +217,7 @@ def _decode_sshpass_exit_code(code):
 
     return result
 
-class TransRead:
+class TransRead(object):
     """
     This class implement the transparent reading functionality. Instances of
     this class are file-like objects which you can read and seek only forward.
-- 
1.8.3.1




More information about the Bmap-tools mailing list