(self, start, end)
return js_code
makes js array from data
makes js array from data
makes js array from data
def make_js_array(self, start, end):
        """ makes js array from data
        """
        js_code = '// generated by dwarf\nvar rawData = [\n\t'

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

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

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

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