@staticmethod
    def _createData(typeNumber, errorCorrectLevel, dataArray):

        rsBlocks = RSBlock.getRSBlocks(typeNumber, errorCorrectLevel)

        buffer = BitBuffer()

        for data in dataArray:
            buffer.put(data.getMode(), 4)
            buffer.put(data.getLength(), data.getLengthInBits(typeNumber) )
            data.write(buffer)

        totalDataCount = sum(rsBlock.getDataCount()
                              for rsBlock in rsBlocks)

        if totalDataCount * 8 > buffer.getLengthInBits():
            raise Exception('code length overflow. (%s>%s)' %
                    (buffer.getLengthInBits(), totalDataCount * 8) )

        # end code
        if buffer.getLengthInBits() + 4 <= totalDataCount * 8:
            buffer.put(0, 4)

        # padding
        while buffer.getLengthInBits() % 8 != 0:
            buffer.put(False)

        # padding
        while True:
            if buffer.getLengthInBits() >= totalDataCount * 8:
                break
            buffer.put(QRCode.PAD0, 8)
            if buffer.getLengthInBits() >= totalDataCount * 8:
                break
            buffer.put(QRCode.PAD1, 8)

        return QRCode._createBytes(buffer, rsBlocks)
dataset/ETHPy150Open mozillazg/ShortURL/shorturl/libs/qrcode.py/QRCode._createData/swapped operands of `>`