bl2/ext/mcuboot/scripts/imgtool_lib/image.py
def load(cls, path, included_header=False, **kwargs):
        """Load an image from a given file"""
        with open(path, 'rb') as f:
            payload = f.read()
        obj = cls(**kwargs)
        obj.payload = payload

        # Add the image header if needed.
        if not included_header and obj.header_size > 0:
            obj.payload = (b'\000' * obj.header_size) + obj.payload

        obj.check()
        return obj
Load an image from a given file
Load an image from a given file
Load an image from a given file
def load(cls, path, included_header=False, **kwargs):
        with open(path, 'rb') as f:
            payload = f.read()
        obj = cls(**kwargs)
        obj.payload = payload
        if not included_header and obj.header_size > 0:
            obj.payload = (b'\000' * obj.header_size) + obj.payload
        obj.check()
        return obj
def load ( cls , path , included_header = False , ** kwargs ) : with open ( path , 'rb' ) as f : payload = f . read ( ) obj = cls ( ** kwargs ) obj . payload = payload if not included_header and obj . header_size > 0 : obj . payload = ( b'\000' * obj . header_size ) + obj . payload obj . check ( ) return obj
Load an image from a given file
Load an image from a given file
"""Load an image from a given file""" # Add the image header if needed.
cls
path
included_header