[elbe-devel] [PATCH 01/13] pylint: fix Attribute <x> defined outside __init__
Manuel Traut
manut at linutronix.de
Wed Aug 29 21:07:22 CEST 2018
avoid the pylint warning by preinitialize class members
with 'None' in __init__
Signed-off-by: Manuel Traut <manut at linutronix.de>
---
elbepack/asyncworker.py | 6 ++++--
elbepack/commands/cd2aptly.py | 2 ++
elbepack/debianize/base.py | 7 +++++++
elbepack/updated.py | 1 +
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/elbepack/asyncworker.py b/elbepack/asyncworker.py
index 7f6173ba..2bb42dae 100644
--- a/elbepack/asyncworker.py
+++ b/elbepack/asyncworker.py
@@ -23,6 +23,7 @@ from elbepack.elbeproject import AptCacheCommitError, AptCacheUpdateError
class AsyncWorkerJob(object):
def __init__(self, project):
self.project = project
+ self.old_status = None
def enqueue(self, queue, db):
queue.put(self)
@@ -381,6 +382,7 @@ class GenUpdateJob(AsyncWorkerJob):
self.name = project.xml.text("/project/name")
self.base_version = base_version
self.current_version = project.xml.text("/project/version")
+ self.base_version_xml = None
AsyncWorkerJob.__init__(self, project)
def enqueue(self, queue, db):
@@ -427,12 +429,12 @@ class SaveVersionJob(AsyncWorkerJob):
def __init__(self, project, description):
AsyncWorkerJob.__init__(self, project)
self.description = description
+ self.name = self.project.xml.text("project/name")
+ self.version = self.project.xml.text("project/version")
def enqueue(self, queue, db):
self.old_status = db.set_busy(self.project.builddir,
["build_done", "has_changes"])
- self.name = self.project.xml.text("project/name")
- self.version = self.project.xml.text("project/version")
# Create the database entry now. This has the advantage that the
# user will see an error message immediately, if he tries to use
diff --git a/elbepack/commands/cd2aptly.py b/elbepack/commands/cd2aptly.py
index e3d84417..f1404751 100644
--- a/elbepack/commands/cd2aptly.py
+++ b/elbepack/commands/cd2aptly.py
@@ -26,6 +26,8 @@ class RepoHost(object):
def __init__ (self, path):
self.path = path
self.httpd = None
+ self.thread = None
+ self.port = None
self.ready = Condition()
def __enter__ (self):
diff --git a/elbepack/debianize/base.py b/elbepack/debianize/base.py
index b9aaf74c..c17a0da9 100644
--- a/elbepack/debianize/base.py
+++ b/elbepack/debianize/base.py
@@ -43,6 +43,13 @@ class DebianizeBase (FormMultiPage):
def __init__(self):
self.deb = {}
self.tmpl_dir = None
+ self.p_name = None
+ self.p_version = None
+ self.p_arch = None
+ self.m_name = None
+ self.m_mail = None
+ self.release = None
+ self.source_format = None
self.archs = ["arm64", "armhf", "armel", "amd64", "i386", "powerpc"]
self.formats = ["native", "git", "quilt"]
diff --git a/elbepack/updated.py b/elbepack/updated.py
index 2c7ea748..49f149b2 100644
--- a/elbepack/updated.py
+++ b/elbepack/updated.py
@@ -156,6 +156,7 @@ class rw_access_file(object):
def __init__(self, filename, status):
self.filename = filename
self.rw = rw_access(filename, status)
+ self.f = None
def __enter__(self):
self.rw.__enter__()
--
2.18.0
More information about the elbe-devel
mailing list