[elbe-devel] [PATCH 24/28] pylint: debianize: only set attributes in constructor

Torben Hohn torben.hohn at linutronix.de
Wed Aug 22 11:29:18 CEST 2018


pylint complains, that member variables are setup in other functions
than __init__().

initilize all member variables, that are going
to be used, to None in __init__().

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/debianize/barebox.py | 5 +++++
 elbepack/debianize/kernel.py  | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/elbepack/debianize/barebox.py b/elbepack/debianize/barebox.py
index 58a3647e..ff9d70dc 100644
--- a/elbepack/debianize/barebox.py
+++ b/elbepack/debianize/barebox.py
@@ -24,6 +24,11 @@ class BareBox (DebianizeBase):
     def __init__(self):
         DebianizeBase.__init__(self)
 
+        self.defconfig = None
+        self.imgname = None
+        self.cross = None
+        self.k_version = None
+
     def gui(self):
         self.defconfig = self.add_widget_intelligent(
             TitleText, name="defconfig:", value="imx_v7_defconfig")
diff --git a/elbepack/debianize/kernel.py b/elbepack/debianize/kernel.py
index bea834fc..3aeda851 100644
--- a/elbepack/debianize/kernel.py
+++ b/elbepack/debianize/kernel.py
@@ -28,6 +28,12 @@ class Kernel (DebianizeBase):
         self.imgtypes_install = ["install", "zinstall", "uinstall", "install"]
         DebianizeBase.__init__(self)
 
+        self.loadaddr = None
+        self.defconfig = None
+        self.imgtype = None
+        self.cross = None
+        self.k_version = None
+
     def gui(self):
         self.loadaddr = self.add_widget_intelligent(
             TitleText, name="Loadaddress:", value="0x800800")
-- 
2.11.0




More information about the elbe-devel mailing list