예제 #1
0
파일: eof.py 프로젝트: pseudomorph/PyMP
    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
예제 #2
0
파일: ok.py 프로젝트: pseudomorph/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
예제 #3
0
파일: ok.py 프로젝트: 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
예제 #4
0
파일: err.py 프로젝트: 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
예제 #5
0
파일: err.py 프로젝트: pseudomorph/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
예제 #6
0
파일: request.py 프로젝트: MPjct/PyMP
    def loadFromPacket(packet):
        obj = Request()
        proto = Proto(packet, 3)

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

        return obj
예제 #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
예제 #8
0
파일: request.py 프로젝트: pseudomorph/PyMP
    def loadFromPacket(packet):
        obj = Request()
        proto = Proto(packet, 3)

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

        return obj
예제 #9
0
파일: response.py 프로젝트: MPjct/PyMP
    def loadFromPacket(packet):
        obj = Response()
        proto = Proto(packet, 3)

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

        return obj
예제 #10
0
파일: row.py 프로젝트: pseudomorph/PyMP
    def loadFromPacket(packet):
        obj = Row()
        proto = Proto(packet, 3)

        obj.sequenceId = proto.get_fixed_int(1)

        # TODO: Extract row data here

        return obj
예제 #11
0
파일: row.py 프로젝트: 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
예제 #12
0
파일: column.py 프로젝트: pseudomorph/PyMP
    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
예제 #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
예제 #14
0
파일: colcount.py 프로젝트: MPjct/PyMP
    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