def __init__(self, source=None):
        ''' Constructor. If source specified, object will be initialized
        with the contents of source. Otherwise the object will be empty.

        @param  source      source for initialization
                            (file name of HEX file, file object, addr dict or
                             other IntelHex object)
        '''
        # public members
        self.padding = 0x0FF
        # Start Address
        self.start_addr = None

        # private members
        self._buf = {}
        self._offset = 0

        if source is not None:
            if isinstance(source, StrType) or getattr(source, "read", None):
                # load hex file
                self.loadhex(source)
            elif isinstance(source, dict):
                self.fromdict(source)
            elif isinstance(source, IntelHex):
                self.padding = source.padding
                if source.start_addr:
                    self.start_addr = source.start_addr.copy()
                self._buf = source._buf.copy()
            else:
                raise ValueError("source: bad initializer type")
def __init__ ( self , source = None ) : self . padding = 0x0FF self . start_addr = None self . _buf = { } self . _offset = 0 if source is not None : if isinstance ( source , StrType ) or getattr ( source , "read" , None ) : self . loadhex ( source ) elif isinstance ( source , dict ) : self . fromdict ( source ) elif isinstance ( source , IntelHex ) : self . padding = source . padding if source . start_addr : self . start_addr = source . start_addr . copy ( ) self . _buf = source . _buf . copy ( ) else : raise ValueError ( "source: bad initializer type" )
Constructor. If source specified, object will be initialized
        with the contents of source. Otherwise the object will be empty.

        @param  source      source for initialization
                            (file name of HEX file, file object, addr dict or
                             other IntelHex object)