(self)
Generates lines of ASCII-encoded hexadecimal strings.

        The .p8 for the gfx section writes data bytes with the nibbles
        (4-bits) swapped to represent pixel order.

        Yields:
          One line of a hex string.
Generates lines of ASCII-encoded hexadecimal strings.
Generates lines of ASCII - encoded hexadecimal strings .
def to_lines(self):
        """Generates lines of ASCII-encoded hexadecimal strings.

        The .p8 for the gfx section writes data bytes with the nibbles
        (4-bits) swapped to represent pixel order.

        Yields:
          One line of a hex string.
        """
        for start_i in range(0, len(self._data), self.HEX_LINE_LENGTH_BYTES):
            end_i = start_i + self.HEX_LINE_LENGTH_BYTES
            newdata = []
            for b in self._data[start_i:end_i]:
                newdata.append((b & 0x0f) << 4 | (b & 0xf0) >> 4)

            yield (
              bytes(util.bytes_to_hex(bytes(newdata)), encoding='ascii') +
              b'\n')
def to_lines ( self ) : for start_i in range ( 0 , len ( self . _data ) , self . HEX_LINE_LENGTH_BYTES ) : end_i = start_i + self . HEX_LINE_LENGTH_BYTES newdata = [ ] for b in self . _data [ start_i : end_i ] : newdata . append ( ( b & 0x0f ) << 4 | ( b & 0xf0 ) >> 4 ) yield ( bytes ( util . bytes_to_hex ( bytes ( newdata ) ) , encoding = 'ascii' ) + b'\n' )