diff options
Diffstat (limited to 'cxmanage_api/image.py')
-rw-r--r-- | cxmanage_api/image.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/cxmanage_api/image.py b/cxmanage_api/image.py index 23642c4..8f3011a 100644 --- a/cxmanage_api/image.py +++ b/cxmanage_api/image.py @@ -1,4 +1,7 @@ -# Copyright (c) 2012, Calxeda Inc. +"""Calxeda: image.py""" + + +# Copyright (c) 2012-2013, Calxeda Inc. # # All rights reserved. # @@ -38,7 +41,7 @@ from cxmanage_api.simg import valid_simg, get_simg_contents from cxmanage_api.cx_exceptions import InvalidImageError -class Image: +class Image(object): """An Image consists of: an image type, a filename, and SIMG header info. >>> from cxmanage_api.image import Image @@ -62,6 +65,7 @@ class Image: """ + # pylint: disable=R0913 def __init__(self, filename, image_type, simg=None, daddr=None, skip_crc32=False, version=None): """Default constructor for the Image class.""" @@ -114,8 +118,8 @@ class Image: skip_crc32=self.skip_crc32, align=align, version=self.version) filename = temp_file() - with open(filename, "w") as f: - f.write(simg) + with open(filename, "w") as file_: + file_.write(simg) # Make sure the simg was built correctly if (not valid_simg(open(filename).read())): @@ -152,7 +156,7 @@ class Image: :rtype: boolean """ - if (self.type == "SOC_ELF"): + if (self.type == "SOC_ELF" and not self.simg): try: file_process = subprocess.Popen(["file", self.filename], stdout=subprocess.PIPE) |