[elbe-devel] [PATCH 2/4] remove unused imports
Manuel Traut
manut at linutronix.de
Tue Jun 20 21:22:12 CEST 2017
Signed-off-by: Manuel Traut <manut at linutronix.de>
---
elbepack/asyncworker.py | 2 +-
elbepack/commands/add.py | 1 -
elbepack/commands/buildsysroot.py | 1 -
elbepack/commands/daemon.py | 1 -
elbepack/commands/db.py | 3 ---
elbepack/commands/genlicence.py | 3 ---
elbepack/commands/hdimg.py | 2 --
elbepack/commands/init.py | 2 --
elbepack/commands/parselicence.py | 6 ------
elbepack/commands/pbuilder.py | 1 -
elbepack/commands/pin_versions.py | 1 -
elbepack/commands/prjrepo.py | 3 ---
elbepack/commands/remove_sign.py | 1 -
elbepack/commands/show.py | 1 -
elbepack/commands/sign.py | 1 -
elbepack/commands/toolchainextract.py | 7 ++-----
elbepack/commands/xsdtoasciidoc.py | 1 -
elbepack/daemons/soap/authentication.py | 2 +-
elbepack/daemons/soap/esoap.py | 7 +------
elbepack/db.py | 4 ++--
elbepack/dbaction.py | 1 -
elbepack/debianize/barebox.py | 3 +--
elbepack/debianize/debianize.py | 15 +--------------
elbepack/debianize/kernel.py | 1 -
elbepack/debianize/uboot.py | 8 +-------
elbepack/debpkg.py | 1 -
elbepack/efilesystem.py | 3 ---
elbepack/filesystem.py | 1 -
elbepack/finetuning.py | 2 --
elbepack/gpg.py | 1 -
elbepack/initvmaction.py | 2 +-
elbepack/licencexml.py | 4 +---
elbepack/pbuilderaction.py | 7 +------
elbepack/pkgarchive.py | 2 +-
elbepack/pkgutils.py | 1 -
elbepack/projectmanager.py | 4 ++--
elbepack/rfs.py | 5 -----
elbepack/rpcaptcache.py | 1 -
elbepack/templates.py | 2 --
elbepack/validate.py | 2 --
elbepack/xmlpreprocess.py | 2 --
41 files changed, 16 insertions(+), 102 deletions(-)
diff --git a/elbepack/asyncworker.py b/elbepack/asyncworker.py
index e0d650f5..58e967fd 100644
--- a/elbepack/asyncworker.py
+++ b/elbepack/asyncworker.py
@@ -25,7 +25,7 @@ from contextlib import contextmanager
from urllib import quote
import traceback
-from elbepack.db import ElbeDBError, get_versioned_filename
+from elbepack.db import get_versioned_filename
from elbepack.dump import dump_fullpkgs
from elbepack.updatepkg import gen_update_pkg
from elbepack.pkgarchive import gen_binpkg_archive, checkout_binpkg_archive
diff --git a/elbepack/commands/add.py b/elbepack/commands/add.py
index 54fbdee0..2b1e344c 100644
--- a/elbepack/commands/add.py
+++ b/elbepack/commands/add.py
@@ -19,7 +19,6 @@
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
import sys
-import os
from elbepack.elbexml import ElbeXML
from optparse import OptionParser
diff --git a/elbepack/commands/buildsysroot.py b/elbepack/commands/buildsysroot.py
index 19fa9fac..80f3782f 100644
--- a/elbepack/commands/buildsysroot.py
+++ b/elbepack/commands/buildsysroot.py
@@ -19,7 +19,6 @@
from optparse import OptionParser
import sys
-import os
from elbepack.elbeproject import ElbeProject
from elbepack.elbexml import ValidationError
diff --git a/elbepack/commands/daemon.py b/elbepack/commands/daemon.py
index 2f59c453..b670d06d 100644
--- a/elbepack/commands/daemon.py
+++ b/elbepack/commands/daemon.py
@@ -24,7 +24,6 @@ from pkgutil import iter_modules
import elbepack.daemons
import sys
-import os
def get_daemonlist():
return [ x for _, x, _ in iter_modules(elbepack.daemons.__path__) ]
diff --git a/elbepack/commands/db.py b/elbepack/commands/db.py
index 6c17f0f0..d6396b6d 100644
--- a/elbepack/commands/db.py
+++ b/elbepack/commands/db.py
@@ -21,9 +21,6 @@
from elbepack.dbaction import DbAction
-from sqlalchemy import create_engine
-from sqlalchemy.orm import sessionmaker
-
def run_command (argv):
if not len(argv):
diff --git a/elbepack/commands/genlicence.py b/elbepack/commands/genlicence.py
index e7de735d..234000f7 100644
--- a/elbepack/commands/genlicence.py
+++ b/elbepack/commands/genlicence.py
@@ -18,14 +18,11 @@
from optparse import OptionParser
-import datetime
import sys
import os
import io
from elbepack.asciidoclog import StdoutLog
-from elbepack.elbexml import ElbeXML, ValidationError
-
from elbepack.filesystem import Filesystem
def run_command( argv ):
diff --git a/elbepack/commands/hdimg.py b/elbepack/commands/hdimg.py
index 811b163b..05be1138 100644
--- a/elbepack/commands/hdimg.py
+++ b/elbepack/commands/hdimg.py
@@ -18,14 +18,12 @@
# You should have received a copy of the GNU General Public License
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
-import os
import sys
from optparse import OptionParser
from elbepack.elbeproject import ElbeProject
from elbepack.elbexml import ValidationError
-from elbepack.asciidoclog import ASCIIDocLog
def run_command( argv ):
diff --git a/elbepack/commands/init.py b/elbepack/commands/init.py
index 88a8e71c..a1923b11 100644
--- a/elbepack/commands/init.py
+++ b/elbepack/commands/init.py
@@ -22,8 +22,6 @@ import os
import sys
import shutil
-
-import elbepack
from elbepack.treeutils import etree
from elbepack.validate import validate_xml
from elbepack.pkgutils import copy_kinitrd, NoKinitrdException
diff --git a/elbepack/commands/parselicence.py b/elbepack/commands/parselicence.py
index 5d1b4c98..b2ff5038 100644
--- a/elbepack/commands/parselicence.py
+++ b/elbepack/commands/parselicence.py
@@ -26,16 +26,10 @@ import string
from tempfile import NamedTemporaryFile
-from elbepack.asciidoclog import StdoutLog
-from elbepack.elbexml import ElbeXML, ValidationError
from elbepack.treeutils import etree
from elbepack.version import elbe_version
-
-from elbepack.filesystem import Filesystem
from elbepack.shellhelper import system_out
-
-
class license_dep5_to_spdx (dict):
def __init__ (self, xml_fname=None):
self.perpackage_mapping = {}
diff --git a/elbepack/commands/pbuilder.py b/elbepack/commands/pbuilder.py
index d5850e90..2f8b94ab 100755
--- a/elbepack/commands/pbuilder.py
+++ b/elbepack/commands/pbuilder.py
@@ -19,7 +19,6 @@
from __future__ import print_function
import sys
-import os
from optparse import OptionParser
from elbepack.pbuilderaction import PBuilderAction, PBuilderError
diff --git a/elbepack/commands/pin_versions.py b/elbepack/commands/pin_versions.py
index 3e079b68..2b4b83b6 100644
--- a/elbepack/commands/pin_versions.py
+++ b/elbepack/commands/pin_versions.py
@@ -19,7 +19,6 @@
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
import sys
-import os
from elbepack.treeutils import etree
from optparse import OptionParser
diff --git a/elbepack/commands/prjrepo.py b/elbepack/commands/prjrepo.py
index eb8497fe..f91a2672 100755
--- a/elbepack/commands/prjrepo.py
+++ b/elbepack/commands/prjrepo.py
@@ -32,9 +32,6 @@ from elbepack.soapclient import RepoAction, ElbeSoapClient
from elbepack.version import elbe_version
from elbepack.config import cfg
-from elbepack.elbexml import ValidationMode
-
-
def run_command(argv):
oparser = OptionParser(usage="usage: elbe prjrepo [options] <command>")
diff --git a/elbepack/commands/remove_sign.py b/elbepack/commands/remove_sign.py
index 96106689..b2b58eee 100644
--- a/elbepack/commands/remove_sign.py
+++ b/elbepack/commands/remove_sign.py
@@ -20,7 +20,6 @@
# with has to have ultimate trust level, otherwise you'll only get
# VALID (Untrusted)!
-import sys
from elbepack.gpg import unsign_file
def run_command( argv ):
diff --git a/elbepack/commands/show.py b/elbepack/commands/show.py
index 51a275e1..1a02155b 100644
--- a/elbepack/commands/show.py
+++ b/elbepack/commands/show.py
@@ -20,7 +20,6 @@
import sys
-import elbepack
from elbepack.treeutils import etree
from elbepack.validate import validate_xml
diff --git a/elbepack/commands/sign.py b/elbepack/commands/sign.py
index c0b90fa8..b87c9849 100644
--- a/elbepack/commands/sign.py
+++ b/elbepack/commands/sign.py
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU General Public License
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
-import sys
from elbepack.gpg import sign_file
def run_command( argv ):
diff --git a/elbepack/commands/toolchainextract.py b/elbepack/commands/toolchainextract.py
index 69c2175e..bbf4e163 100644
--- a/elbepack/commands/toolchainextract.py
+++ b/elbepack/commands/toolchainextract.py
@@ -17,19 +17,16 @@
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
from optparse import OptionParser
-import sys
-import os
-import string
-
from tempfile import mkdtemp
+import os
+
from elbepack.xmldefaults import ElbeDefaults
from elbepack.repomanager import ToolchainRepo
from elbepack.debpkg import build_binary_deb
from elbepack.toolchain import get_toolchain
from elbepack.asciidoclog import StdoutLog
-
def run_command( argv ):
oparser = OptionParser(usage="usage: %prog toolchainextract [options]")
oparser.add_option( "-p", "--path", dest="path",
diff --git a/elbepack/commands/xsdtoasciidoc.py b/elbepack/commands/xsdtoasciidoc.py
index 6c51d00c..c64e11c4 100644
--- a/elbepack/commands/xsdtoasciidoc.py
+++ b/elbepack/commands/xsdtoasciidoc.py
@@ -18,7 +18,6 @@
# You should have received a copy of the GNU General Public License
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
-import os
import sys
from elbepack.treeutils import etree
diff --git a/elbepack/daemons/soap/authentication.py b/elbepack/daemons/soap/authentication.py
index acfd9dba..9cb14440 100644
--- a/elbepack/daemons/soap/authentication.py
+++ b/elbepack/daemons/soap/authentication.py
@@ -18,7 +18,7 @@
-from faults import SoapElbeDBError, SoapElbeAuthenticationFailed, SoapElbeNotLoggedIn, SoapElbeNotAuthorized
+from faults import SoapElbeNotLoggedIn, SoapElbeNotAuthorized
from functools import wraps
def authenticated_uid(func):
diff --git a/elbepack/daemons/soap/esoap.py b/elbepack/daemons/soap/esoap.py
index 2e45cf0d..0bdcdf11 100644
--- a/elbepack/daemons/soap/esoap.py
+++ b/elbepack/daemons/soap/esoap.py
@@ -30,19 +30,14 @@ from elbepack.version import elbe_version
from faults import soap_faults
-from elbepack.db import Project, User
from elbepack.elbexml import ValidationMode
from datatypes import SoapProject, SoapFile
from authentication import authenticated_admin, authenticated_uid
-from subprocess import Popen, PIPE
-
from spyne.service import ServiceBase
from spyne.decorator import rpc
from spyne.model.primitive import String, Boolean, Integer
-from spyne.model.complex import Array, Iterable
-
-from threading import local
+from spyne.model.complex import Array
class ESoap (ServiceBase):
diff --git a/elbepack/db.py b/elbepack/db.py
index ec6d3212..26d44056 100644
--- a/elbepack/db.py
+++ b/elbepack/db.py
@@ -35,13 +35,13 @@ from sqlalchemy import (Column, ForeignKey)
from sqlalchemy import (Integer, String, Boolean, Sequence, DateTime)
from sqlalchemy import create_engine
-from sqlalchemy.orm import sessionmaker, scoped_session, object_mapper
+from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.orm import relationship
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import OperationalError
from elbepack.elbeproject import ElbeProject
-from elbepack.elbexml import (ElbeXML, ValidationError, ValidationMode)
+from elbepack.elbexml import (ElbeXML, ValidationMode)
from elbepack.dosunix import dos2unix
Base = declarative_base ()
diff --git a/elbepack/dbaction.py b/elbepack/dbaction.py
index 45c3ec84..fe147007 100644
--- a/elbepack/dbaction.py
+++ b/elbepack/dbaction.py
@@ -18,7 +18,6 @@
# You should have received a copy of the GNU General Public License
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
-import os
import sys
from optparse import OptionParser
diff --git a/elbepack/debianize/barebox.py b/elbepack/debianize/barebox.py
index fc329300..46fdeed1 100644
--- a/elbepack/debianize/barebox.py
+++ b/elbepack/debianize/barebox.py
@@ -19,9 +19,8 @@
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
import os
-import sys
-from npyscreen import TitleText, TitleSelectOne
+from npyscreen import TitleText
from shutil import copyfile
diff --git a/elbepack/debianize/debianize.py b/elbepack/debianize/debianize.py
index a86d19e7..1180e9d8 100644
--- a/elbepack/debianize/debianize.py
+++ b/elbepack/debianize/debianize.py
@@ -18,20 +18,7 @@
# You should have received a copy of the GNU General Public License
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
-import os
-import sys
-
-from npyscreen import NPSAppManaged, FormMultiPage
-from npyscreen import TitleText, TitleSelectOne, ButtonPress
-
-from shutil import copyfile
-
-from elbepack.debianize.kernel import Kernel
-from elbepack.debianize.uboot import UBoot
-from elbepack.debianize.barebox import BareBox
-
-from elbepack.debianize.base import DebianizeBase
-
+from npyscreen import NPSAppManaged
class Debianize (NPSAppManaged):
def __init__ (self, debianizer):
diff --git a/elbepack/debianize/kernel.py b/elbepack/debianize/kernel.py
index 549e6d16..527c47ed 100644
--- a/elbepack/debianize/kernel.py
+++ b/elbepack/debianize/kernel.py
@@ -19,7 +19,6 @@
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
import os
-import sys
from npyscreen import TitleText, TitleSelectOne
diff --git a/elbepack/debianize/uboot.py b/elbepack/debianize/uboot.py
index 04676205..bd188651 100644
--- a/elbepack/debianize/uboot.py
+++ b/elbepack/debianize/uboot.py
@@ -18,15 +18,9 @@
# You should have received a copy of the GNU General Public License
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
-import os
import sys
-from npyscreen import TitleText, TitleSelectOne
-
-from shutil import copyfile
-
-from elbepack.directories import mako_template_dir
-from elbepack.debianize.base import DebianizeBase, template
+from elbepack.debianize.base import DebianizeBase
# this is just a template to show how debianizing another component should work
diff --git a/elbepack/debpkg.py b/elbepack/debpkg.py
index a7128a2d..ba15b18f 100644
--- a/elbepack/debpkg.py
+++ b/elbepack/debpkg.py
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU General Public License
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
-import sys
import os
import string
diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
index 0c1061b1..be7d7e25 100644
--- a/elbepack/efilesystem.py
+++ b/elbepack/efilesystem.py
@@ -24,9 +24,6 @@ import subprocess
import io
import stat
-from glob import glob
-from tempfile import mkdtemp
-
from elbepack.asciidoclog import CommandError
from elbepack.filesystem import Filesystem
from elbepack.version import elbe_version
diff --git a/elbepack/filesystem.py b/elbepack/filesystem.py
index 1bc34889..fb76756b 100644
--- a/elbepack/filesystem.py
+++ b/elbepack/filesystem.py
@@ -19,7 +19,6 @@
import os
import shutil
-import io
from glob import glob
from tempfile import mkdtemp
diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
index de19f7ef..cdf1fd7b 100644
--- a/elbepack/finetuning.py
+++ b/elbepack/finetuning.py
@@ -23,8 +23,6 @@ from apt.package import FetchError
from shutil import rmtree
from io import BytesIO
-from elbepack.aptpkgutils import XMLPackage
-from elbepack.efilesystem import ChRootFilesystem
from elbepack.repomanager import UpdateRepo
from elbepack.rpcaptcache import get_rpcaptcache
from elbepack.shellhelper import CommandError
diff --git a/elbepack/gpg.py b/elbepack/gpg.py
index b339be91..89b9077f 100644
--- a/elbepack/gpg.py
+++ b/elbepack/gpg.py
@@ -20,7 +20,6 @@
import gpgme
import os
-import sys
from elbepack.filesystem import hostfs
diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
index ed062b57..65a10490 100644
--- a/elbepack/initvmaction.py
+++ b/elbepack/initvmaction.py
@@ -24,7 +24,7 @@ import elbepack
from elbepack.treeutils import etree
from elbepack.directories import elbe_exe
from elbepack.shellhelper import CommandError, system, command_out_stderr
-from elbepack.filesystem import wdfs, TmpdirFilesystem, Filesystem
+from elbepack.filesystem import wdfs, TmpdirFilesystem
from elbepack.elbexml import ElbeXML, ValidationError, ValidationMode
from tempfile import NamedTemporaryFile
diff --git a/elbepack/licencexml.py b/elbepack/licencexml.py
index d206e50b..a40dffcd 100644
--- a/elbepack/licencexml.py
+++ b/elbepack/licencexml.py
@@ -19,10 +19,8 @@
from elbepack.treeutils import etree
-from debian.copyright import Copyright, NotMachineReadableError, LicenseParagraph
+from debian.copyright import Copyright, LicenseParagraph
-import os
-import sys
import io
import re
diff --git a/elbepack/pbuilderaction.py b/elbepack/pbuilderaction.py
index 3c2d8e1f..b81049f2 100644
--- a/elbepack/pbuilderaction.py
+++ b/elbepack/pbuilderaction.py
@@ -20,17 +20,12 @@
from __future__ import print_function
-import elbepack
-from elbepack.treeutils import etree
from elbepack.directories import elbe_exe
from elbepack.shellhelper import CommandError, system, command_out_stderr
-from elbepack.filesystem import wdfs, TmpdirFilesystem, Filesystem
-from elbepack.elbexml import ElbeXML, ValidationError
+from elbepack.filesystem import wdfs, TmpdirFilesystem
import sys
-
import os
-import datetime
cmd_exists = lambda x: any(os.access(os.path.join(path, x), os.X_OK) for path in os.environ["PATH"].split(os.pathsep))
diff --git a/elbepack/pkgarchive.py b/elbepack/pkgarchive.py
index 0b9e1eb8..b8a79ff9 100644
--- a/elbepack/pkgarchive.py
+++ b/elbepack/pkgarchive.py
@@ -20,7 +20,7 @@
import errno
from os import path, remove
-from shutil import rmtree, copyfile, copytree, move
+from shutil import rmtree, copytree, move
from apt.package import FetchError
from elbepack.repomanager import RepoBase, RepoAttributes
diff --git a/elbepack/pkgutils.py b/elbepack/pkgutils.py
index c4e90cdd..b8e82a68 100644
--- a/elbepack/pkgutils.py
+++ b/elbepack/pkgutils.py
@@ -35,7 +35,6 @@ except ImportError:
print " elbe-bootstrap packages on the mirror(s) elbe selects the first package it"
print " has found. There is no guarantee that the latest package is used."
print " To ensure this, the python-apt package needs to be installed."
- import urllib2
virtapt_imported = False
diff --git a/elbepack/projectmanager.py b/elbepack/projectmanager.py
index 90cab8c0..87390a00 100644
--- a/elbepack/projectmanager.py
+++ b/elbepack/projectmanager.py
@@ -27,9 +27,9 @@ from threading import Lock
from uuid import uuid4
from shutil import rmtree
-from elbepack.db import ElbeDB, ElbeDBError, get_versioned_filename
+from elbepack.db import ElbeDB, get_versioned_filename
from elbepack.asyncworker import AsyncWorker, BuildJob, APTUpdateJob
-from elbepack.asyncworker import APTCommitJob, GenUpdateJob, GenUpdateJob
+from elbepack.asyncworker import APTCommitJob, GenUpdateJob
from elbepack.asyncworker import SaveVersionJob, CheckoutVersionJob
from elbepack.asyncworker import APTUpdUpgrJob, BuildSysrootJob
from elbepack.asyncworker import PdebuildJob, CreatePbuilderJob
diff --git a/elbepack/rfs.py b/elbepack/rfs.py
index 5b373a6d..67181b65 100644
--- a/elbepack/rfs.py
+++ b/elbepack/rfs.py
@@ -16,15 +16,10 @@
# You should have received a copy of the GNU General Public License
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
-import apt_pkg
import os
-import sys
import urlparse
import urllib2
-import elbepack
-
-from elbepack.aptprogress import ElbeAcquireProgress, ElbeInstallProgress
from elbepack.efilesystem import BuildImgFs
from elbepack.templates import write_pack_template, get_preseed, preseed_to_text
from elbepack.shellhelper import CommandError
diff --git a/elbepack/rpcaptcache.py b/elbepack/rpcaptcache.py
index c44c90a2..a5be48fb 100644
--- a/elbepack/rpcaptcache.py
+++ b/elbepack/rpcaptcache.py
@@ -21,7 +21,6 @@ from apt_pkg import config, version_compare
from apt import Cache
from multiprocessing.managers import BaseManager
from elbepack.aptprogress import ElbeAcquireProgress, ElbeInstallProgress, ElbeOpProgress
-from elbepack.asciidoclog import ASCIIDocLog
from elbepack.aptpkgutils import getalldeps, APTPackage
import os
diff --git a/elbepack/templates.py b/elbepack/templates.py
index 4eafe56b..9808ad1c 100644
--- a/elbepack/templates.py
+++ b/elbepack/templates.py
@@ -16,9 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
-import elbepack
import os
-import string
from elbepack.treeutils import etree
from elbepack.directories import mako_template_dir, default_preseed_fname
diff --git a/elbepack/validate.py b/elbepack/validate.py
index cb7c4eb0..7574cb91 100644
--- a/elbepack/validate.py
+++ b/elbepack/validate.py
@@ -16,9 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
-import os
import sys
-import elbepack
from lxml import etree
from lxml.etree import XMLParser,parse
diff --git a/elbepack/xmlpreprocess.py b/elbepack/xmlpreprocess.py
index 29525108..050d3e1b 100644
--- a/elbepack/xmlpreprocess.py
+++ b/elbepack/xmlpreprocess.py
@@ -16,9 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with ELBE. If not, see <http://www.gnu.org/licenses/>.
-import os
import sys
-import elbepack
from lxml import etree
from lxml.etree import XMLParser,parse
--
2.11.0
More information about the elbe-devel
mailing list