Esempio n. 1
0
    def loadFromPacket(packet):
        obj = EOF()
        proto = Proto(packet, 3)

        obj.sequenceId = proto.get_fixed_int(1)
        proto.get_filler(1)
        obj.statusFlags = proto.get_fixed_int(2)
        obj.warnings = proto.get_fixed_int(2)

        return obj
Esempio n. 2
0
    def loadFromPacket(packet):
        obj = OK()
        proto = Proto(packet, 3)

        obj.sequenceId = proto.get_fixed_int(1)
        proto.get_filler(1)
        obj.affectedRows = proto.get_lenenc_int()
        obj.lastInsertId = proto.get_lenenc_int()
        obj.statusFlags = proto.get_fixed_int(2)
        obj.warnings = proto.get_fixed_int(2)

        return obj
Esempio n. 3
0
File: ok.py Progetto: MPjct/PyMP
    def loadFromPacket(packet):
        obj = OK()
        proto = Proto(packet, 3)

        obj.sequenceId = proto.get_fixed_int(1)
        proto.get_filler(1)
        obj.affectedRows = proto.get_lenenc_int()
        obj.lastInsertId = proto.get_lenenc_int()
        obj.statusFlags = proto.get_fixed_int(2)
        obj.warnings = proto.get_fixed_int(2)

        return obj
Esempio n. 4
0
File: err.py Progetto: MPjct/PyMP
    def loadFromPacket(packet):
        obj = ERR()
        proto = Proto(packet, 3)

        obj.sequenceId = proto.get_fixed_int(1)
        proto.get_filler(1)
        obj.errorCode = proto.get_fixed_int(2)
        proto.get_filler(1)
        obj.sqlState = proto.get_fixed_str(5)
        obj.errorMessage = proto.get_eop_str()

        return obj
Esempio n. 5
0
    def loadFromPacket(packet):
        obj = ERR()
        proto = Proto(packet, 3)

        obj.sequenceId = proto.get_fixed_int(1)
        proto.get_filler(1)
        obj.errorCode = proto.get_fixed_int(2)
        proto.get_filler(1)
        obj.sqlState = proto.get_fixed_str(5)
        obj.errorMessage = proto.get_eop_str()

        return obj
Esempio n. 6
0
    def loadFromPacket(packet):
        obj = Request()
        proto = Proto(packet, 3)

        obj.sequenceId = proto.get_fixed_int(1)
        obj.filename = proto.get_eop_str()

        return obj
Esempio n. 7
0
    def loadFromPacket(packet):
        obj = Response()
        proto = Proto(packet, 3)

        obj.sequenceId = proto.get_fixed_int(1)
        obj.data = proto.packet[proto.offset:]

        return obj
Esempio n. 8
0
    def loadFromPacket(packet):
        obj = Request()
        proto = Proto(packet, 3)

        obj.sequenceId = proto.get_fixed_int(1)
        obj.filename = proto.get_eop_str()

        return obj
Esempio n. 9
0
    def loadFromPacket(packet):
        obj = Response()
        proto = Proto(packet, 3)

        obj.sequenceId = proto.get_fixed_int(1)
        obj.data = proto.packet[proto.offset:]

        return obj
Esempio n. 10
0
    def loadFromPacket(packet):
        obj = Row()
        proto = Proto(packet, 3)

        obj.sequenceId = proto.get_fixed_int(1)

        # TODO: Extract row data here

        return obj
Esempio n. 11
0
File: row.py Progetto: MPjct/PyMP
    def loadFromPacket(packet):
        obj = Row()
        proto = Proto(packet, 3)

        obj.sequenceId = proto.get_fixed_int(1)

        # TODO: Extract row data here

        return obj
Esempio n. 12
0
    def loadFromPacket(packet):
        obj = Column()
        proto = Proto(packet, 3)

        obj.sequenceId = proto.get_fixed_int(1)
        obj.catalog = proto.get_lenenc_str()
        obj.schema = proto.get_lenenc_str()
        obj.table = proto.get_lenenc_str()
        obj.org_table = proto.get_lenenc_str()
        obj.name = proto.get_lenenc_str()
        obj.org_name = proto.get_lenenc_str()
        proto.get_filler(1)
        obj.characterSet = proto.get_fixed_int(2)
        obj.columnLength = proto.get_fixed_int(4)
        obj.type = proto.get_fixed_int(1)
        obj.flags = proto.get_fixed_int(2)
        obj.decimals = proto.get_fixed_int(1)
        proto.get_filler(2)

        return obj
Esempio n. 13
0
    def loadFromPacket(packet):
        """
        >>> colcount = ColCount()
        >>> colcount.sequenceId = 1
        >>> colcount.colCount = 5
        >>> colcount.colCount
        5
        >>> pkt = colcount.toPacket()
        >>> pkt
        bytearray(b'\\x01\\x00\\x00\\x01\\x05')
        >>> colcount2 = ColCount.loadFromPacket(pkt)
        >>> colcount2.colCount
        5
        >>> colcount2.sequenceId
        1
        """
        obj = ColCount()
        proto = Proto(packet, 3)
        obj.sequenceId = proto.get_fixed_int(1)
        obj.colCount = proto.get_lenenc_int()

        return obj
Esempio n. 14
0
    def loadFromPacket(packet):
        """
        >>> colcount = ColCount()
        >>> colcount.sequenceId = 1
        >>> colcount.colCount = 5
        >>> colcount.colCount
        5
        >>> pkt = colcount.toPacket()
        >>> pkt
        bytearray(b'\\x01\\x00\\x00\\x01\\x05')
        >>> colcount2 = ColCount.loadFromPacket(pkt)
        >>> colcount2.colCount
        5
        >>> colcount2.sequenceId
        1
        """
        obj = ColCount()
        proto = Proto(packet, 3)
        obj.sequenceId = proto.get_fixed_int(1)
        obj.colCount = proto.get_lenenc_int()

        return obj