Split long lines.
Removed unused imports.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Returns block size for file object 'file_obj'. Errors are indicated by the
'IOError' exception.
"""
-
- from fcntl import ioctl
- import struct
-
# Get the block size of the host file-system for the image file by calling
# the FIGETBSZ ioctl (number 2).
- binary_data = ioctl(file_obj, 2, struct.pack('I', 0))
+ binary_data = fcntl.ioctl(file_obj, 2, struct.pack('I', 0))
return struct.unpack('I', binary_data)[0]
class ErrorNotSupp(Exception):
try:
tmp_obj = tempfile.TemporaryFile("w+", dir=directory)
except IOError as err:
- raise ErrorNotSupp("cannot create a temporary in \"%s\": %s"
+ raise ErrorNotSupp("cannot create a temporary in \"%s\": %s" \
% (directory, err))
try:
"was not found (see details above).\n\n" % prog
recipe = NATIVE_RECIPES.get(prog)
if recipe:
- msg += "Please make sure wic-tools have %s-native in its DEPENDS, bake it with 'bitbake wic-tools' "\
- "and try again.\n" % recipe
+ msg += "Please make sure wic-tools have %s-native in its DEPENDS, "\
+ "build it with 'bitbake wic-tools' and try again.\n" % recipe
else:
msg += "Wic failed to find a recipe to build native %s. Please "\
"file a bug against wic.\n" % prog
import logging
import os
-import tempfile
from wic import WicError
from wic.misc import exec_cmd, exec_native_cmd, get_bitbake_var
'prepares' the partition to be incorporated into the image.
"""
logger.debug("SourcePlugin: do_prepare_partition: part: %s", part)
-
from wic import WicError
from wic.pluginbase import SourcePlugin
-from wic.misc import get_bitbake_var, exec_cmd
+from wic.misc import get_bitbake_var
logger = logging.getLogger('wic')