(self, start, end)
return py_code
makes python array from data
makes python array from data
makes python array from data
def make_py_array(self, start, end):
        """ makes python array from data
        """
        py_code = '# generated by dwarf\nraw_data = [\n\t'

        for i in range(start, end):
            if (i - start) and ((i - start) % 12 == 0):
                py_code = py_code[0:-1]  # remove last space
                py_code += '\n\t'  # next line

            if self._hex_style == 'upper':
                py_code += '0x{0:02X}, '.format(self.data[i])
            else:
                py_code += '0x{0:02x}, '.format(self.data[i])

        # remove last ', '
        py_code = py_code[0:-2]
        py_code += '\n]'

        return py_code
def make_py_array ( self , start , end ) : py_code = '# generated by dwarf\nraw_data = [\n\t' for i in range ( start , end ) : if ( i - start ) and ( ( i - start ) % 12 == 0 ) : py_code = py_code [ 0 : - 1 ] # remove last space py_code += '\n\t' # next line if self . _hex_style == 'upper' : py_code += '0x{0:02X}, ' . format ( self . data [ i ] ) else : py_code += '0x{0:02x}, ' . format ( self . data [ i ] ) # remove last ', ' py_code = py_code [ 0 : - 2 ] py_code += '\n]' return py_code