diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-06-16 16:19:29 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-23 11:44:12 +0100 |
commit | 247b7a8c3aee8a1a3e28e196aaad964c4598edb6 (patch) | |
tree | 89a79af7920b2cf2a0280158e80edad63a104959 /scripts/lib/wic/filemap.py | |
parent | dd7e0ae43d84eefb5cc0155656f5d540e01944fb (diff) | |
download | poky-247b7a8c3aee8a1a3e28e196aaad964c4598edb6.tar.gz |
wic: code cleanup
Split long lines.
Removed unused imports.
(From OE-Core rev: 49b704864c7db49e41a0b6bbdb8a2840e7fa232b)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/filemap.py')
-rw-r--r-- | scripts/lib/wic/filemap.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/scripts/lib/wic/filemap.py b/scripts/lib/wic/filemap.py index 6d11355a18..77e32b9add 100644 --- a/scripts/lib/wic/filemap.py +++ b/scripts/lib/wic/filemap.py | |||
@@ -34,13 +34,9 @@ def get_block_size(file_obj): | |||
34 | Returns block size for file object 'file_obj'. Errors are indicated by the | 34 | Returns block size for file object 'file_obj'. Errors are indicated by the |
35 | 'IOError' exception. | 35 | 'IOError' exception. |
36 | """ | 36 | """ |
37 | |||
38 | from fcntl import ioctl | ||
39 | import struct | ||
40 | |||
41 | # Get the block size of the host file-system for the image file by calling | 37 | # Get the block size of the host file-system for the image file by calling |
42 | # the FIGETBSZ ioctl (number 2). | 38 | # the FIGETBSZ ioctl (number 2). |
43 | binary_data = ioctl(file_obj, 2, struct.pack('I', 0)) | 39 | binary_data = fcntl.ioctl(file_obj, 2, struct.pack('I', 0)) |
44 | return struct.unpack('I', binary_data)[0] | 40 | return struct.unpack('I', binary_data)[0] |
45 | 41 | ||
46 | class ErrorNotSupp(Exception): | 42 | class ErrorNotSupp(Exception): |
@@ -228,7 +224,7 @@ class FilemapSeek(_FilemapBase): | |||
228 | try: | 224 | try: |
229 | tmp_obj = tempfile.TemporaryFile("w+", dir=directory) | 225 | tmp_obj = tempfile.TemporaryFile("w+", dir=directory) |
230 | except IOError as err: | 226 | except IOError as err: |
231 | raise ErrorNotSupp("cannot create a temporary in \"%s\": %s" | 227 | raise ErrorNotSupp("cannot create a temporary in \"%s\": %s" \ |
232 | % (directory, err)) | 228 | % (directory, err)) |
233 | 229 | ||
234 | try: | 230 | try: |