mirror of
https://git.yoctoproject.org/poky
synced 2026-03-06 15:29:40 +01:00
wic: code cleanup: wildcard imports
Here is what PEP8(Style Guide for Python Code) says about this: Wildcard imports (from <module> import *) should be avoided, as they make it unclear which names are present in the namespace, confusing both readers and many automated tools. (From OE-Core rev: 13416c1941f5dc8abcdb0073f2104a89eae2d6f1) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
1d0c3387e8
commit
f2a0a98523
@@ -42,7 +42,7 @@ from wic.utils import cmdln, misc, errors
|
||||
from wic.conf import configmgr
|
||||
from wic.plugin import pluginmgr
|
||||
from wic.__version__ import VERSION
|
||||
from wic.utils.oe.misc import *
|
||||
from wic.utils.oe import misc
|
||||
|
||||
|
||||
def verify_build_env():
|
||||
@@ -65,19 +65,19 @@ def find_artifacts(image_name):
|
||||
Gather the build artifacts for the current image (the image_name
|
||||
e.g. core-image-minimal) for the current MACHINE set in local.conf
|
||||
"""
|
||||
bitbake_env_lines = get_bitbake_env_lines()
|
||||
bitbake_env_lines = misc.get_bitbake_env_lines()
|
||||
|
||||
rootfs_dir = kernel_dir = bootimg_dir = native_sysroot = ""
|
||||
|
||||
for line in bitbake_env_lines.split('\n'):
|
||||
if (get_line_val(line, "IMAGE_ROOTFS")):
|
||||
rootfs_dir = get_line_val(line, "IMAGE_ROOTFS")
|
||||
if (misc.get_line_val(line, "IMAGE_ROOTFS")):
|
||||
rootfs_dir = misc.get_line_val(line, "IMAGE_ROOTFS")
|
||||
continue
|
||||
if (get_line_val(line, "DEPLOY_DIR_IMAGE")):
|
||||
kernel_dir = get_line_val(line, "DEPLOY_DIR_IMAGE")
|
||||
if (misc.get_line_val(line, "DEPLOY_DIR_IMAGE")):
|
||||
kernel_dir = misc.get_line_val(line, "DEPLOY_DIR_IMAGE")
|
||||
continue
|
||||
if (get_line_val(line, "STAGING_DIR_NATIVE")):
|
||||
native_sysroot = get_line_val(line, "STAGING_DIR_NATIVE")
|
||||
if (misc.get_line_val(line, "STAGING_DIR_NATIVE")):
|
||||
native_sysroot = misc.get_line_val(line, "STAGING_DIR_NATIVE")
|
||||
continue
|
||||
|
||||
return (rootfs_dir, kernel_dir, bootimg_dir, native_sysroot)
|
||||
@@ -87,7 +87,7 @@ CANNED_IMAGE_DIR = "lib/image/canned-wks" # relative to scripts
|
||||
SCRIPTS_CANNED_IMAGE_DIR = "scripts/" + CANNED_IMAGE_DIR
|
||||
|
||||
def build_canned_image_list(dl):
|
||||
layers_path = get_bitbake_var("BBLAYERS")
|
||||
layers_path = misc.get_bitbake_var("BBLAYERS")
|
||||
canned_wks_layer_dirs = []
|
||||
|
||||
if layers_path is not None:
|
||||
|
||||
@@ -32,7 +32,6 @@ from wic.utils import fs_related, runner, misc
|
||||
from wic.utils.partitionedfs import Image
|
||||
from wic.utils.errors import CreatorError, ImageError
|
||||
from wic.imager.baseimager import BaseImageCreator
|
||||
from wic.utils.oe.misc import *
|
||||
from wic.plugin import pluginmgr
|
||||
|
||||
disk_methods = {
|
||||
|
||||
@@ -20,7 +20,7 @@ import os, sys
|
||||
from wic import msger
|
||||
from wic import pluginbase
|
||||
from wic.utils import errors
|
||||
from wic.utils.oe.misc import *
|
||||
from wic.utils.oe.misc import get_bitbake_var
|
||||
|
||||
__ALL__ = ['PluginMgr', 'pluginmgr']
|
||||
|
||||
|
||||
@@ -29,13 +29,9 @@ import shutil
|
||||
|
||||
from wic.utils.errors import ImageError
|
||||
from wic import kickstart, msger
|
||||
from wic.utils import misc, fs_related, errors, runner, cmdln
|
||||
from wic.conf import configmgr
|
||||
from wic.plugin import pluginmgr
|
||||
import wic.imager.direct as direct
|
||||
from wic.pluginbase import SourcePlugin
|
||||
from wic.utils.oe.misc import *
|
||||
from wic.imager.direct import DirectImageCreator
|
||||
from wic.utils.oe.misc import exec_cmd, exec_native_cmd, get_bitbake_var, \
|
||||
BOOTDD_EXTRA_SPACE
|
||||
|
||||
class BootimgEFIPlugin(SourcePlugin):
|
||||
name = 'bootimg-efi'
|
||||
|
||||
@@ -28,7 +28,7 @@ import re
|
||||
|
||||
from wic import msger
|
||||
from wic.pluginbase import SourcePlugin
|
||||
from wic.utils.oe.misc import *
|
||||
from wic.utils.oe.misc import exec_cmd, get_bitbake_var
|
||||
from glob import glob
|
||||
|
||||
class BootimgPartitionPlugin(SourcePlugin):
|
||||
|
||||
@@ -28,13 +28,10 @@ import os
|
||||
|
||||
from wic.utils.errors import ImageError
|
||||
from wic import kickstart, msger
|
||||
from wic.utils import misc, fs_related, errors, runner, cmdln
|
||||
from wic.conf import configmgr
|
||||
from wic.plugin import pluginmgr
|
||||
import wic.imager.direct as direct
|
||||
from wic.utils import runner
|
||||
from wic.pluginbase import SourcePlugin
|
||||
from wic.utils.oe.misc import *
|
||||
from wic.imager.direct import DirectImageCreator
|
||||
from wic.utils.oe.misc import exec_cmd, exec_native_cmd, \
|
||||
get_bitbake_var, BOOTDD_EXTRA_SPACE
|
||||
|
||||
class BootimgPcbiosPlugin(SourcePlugin):
|
||||
name = 'bootimg-pcbios'
|
||||
|
||||
@@ -19,7 +19,7 @@ import os
|
||||
|
||||
from wic import msger
|
||||
from wic.pluginbase import SourcePlugin
|
||||
from wic.utils.oe.misc import *
|
||||
from wic.utils.oe.misc import get_bitbake_var
|
||||
|
||||
class FSImagePlugin(SourcePlugin):
|
||||
name = 'fsimage'
|
||||
|
||||
@@ -19,7 +19,7 @@ import os
|
||||
|
||||
from wic import msger
|
||||
from wic.pluginbase import SourcePlugin
|
||||
from wic.utils.oe.misc import *
|
||||
from wic.utils.oe.misc import exec_cmd, get_bitbake_var
|
||||
|
||||
class RawCopyPlugin(SourcePlugin):
|
||||
name = 'rawcopy'
|
||||
|
||||
@@ -27,14 +27,9 @@
|
||||
|
||||
import os
|
||||
|
||||
from wic import kickstart, msger
|
||||
from wic.utils import misc, fs_related, errors, runner, cmdln
|
||||
from wic.conf import configmgr
|
||||
from wic.plugin import pluginmgr
|
||||
import wic.imager.direct as direct
|
||||
from wic import msger
|
||||
from wic.pluginbase import SourcePlugin
|
||||
from wic.utils.oe.misc import *
|
||||
from wic.imager.direct import DirectImageCreator
|
||||
from wic.utils.oe.misc import find_bitbake_env_lines, find_artifact
|
||||
|
||||
class RootfsPlugin(SourcePlugin):
|
||||
name = 'rootfs'
|
||||
|
||||
@@ -20,10 +20,7 @@ from __future__ import with_statement
|
||||
import os
|
||||
import errno
|
||||
|
||||
from wic import msger
|
||||
from wic.utils import runner
|
||||
from wic.utils.errors import *
|
||||
from wic.utils.oe.misc import *
|
||||
from wic.utils.oe.misc import exec_cmd
|
||||
|
||||
def makedirs(dirname):
|
||||
"""A version of os.makedirs() that doesn't throw an
|
||||
|
||||
@@ -19,10 +19,8 @@
|
||||
# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
from wic import msger
|
||||
from wic.utils import runner
|
||||
from wic.utils.errors import ImageError
|
||||
from wic.utils.fs_related import *
|
||||
from wic.utils.oe.misc import *
|
||||
from wic.utils.oe.misc import exec_cmd, exec_native_cmd
|
||||
|
||||
# Overhead of the MBR partitioning scheme (just one sector)
|
||||
MBR_OVERHEAD = 1
|
||||
|
||||
Reference in New Issue
Block a user