Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(16)  |  Call(14)  |  Derive(0)  |  Import(2)

        def toByteString(bigInt):
    resultBytes = []
    if bigInt == -1 or bigInt == 0:
        resultBytes.append(chr(bigInt & 0xFF))
        return ''.join(resultBytes)

    while bigInt != 0 and bigInt != -1:
        resultBytes.append(chr(bigInt & 0xFF))
        bigInt >>= 8
 
    resultBytes.reverse();
    result = ''.join(resultBytes)
    
    return result
        


src/p/y/pynuodb-2.1/pynuodb/encodedsession.py   pynuodb(Download)
__all__  = [ 'EncodedSession' ]
 
from crypt import toByteString, fromByteString, toSignedByteString, fromSignedByteString
from session import Session, SessionException
 
        else:
            if isMessageId:
                valueStr = toByteString(value)
            else:
                valueStr = toSignedByteString(value)
            packed = chr(protocol.UTF8LEN0 + length) + value
        else:
            lengthStr = toByteString(length)
            packed = chr(protocol.UTF8COUNT1 - 1 + len(lengthStr)) + lengthStr + value
        self.__output += packed
            packed = chr(protocol.OPAQUELEN0 + length) + data
        else:
            lengthStr = toByteString(length)
            packed = chr(protocol.OPAQUECOUNT1 - 1 + len(lengthStr)) + lengthStr + data
        self.__output += packed
    def putMsSinceMidnight(self, value):
        """Appends the MsSinceMidnight value to the message."""
        valueStr = toByteString(value)
        packed = chr(protocol.TIMELEN0 + len(valueStr)) + valueStr
        self.__output += packed

src/n/u/nuodb-python-HEAD/pynuodb/encodedsession.py   nuodb-python(Download)
__all__  = [ 'EncodedSession' ]
 
from crypt import toByteString, fromByteString, toSignedByteString, fromSignedByteString
from session import Session, SessionException
 
        else:
            if isMessageId:
                valueStr = toByteString(value)
            else:
                valueStr = toSignedByteString(value)
            packed = chr(protocol.UTF8LEN0 + length) + value
        else:
            lengthStr = toByteString(length)
            packed = chr(protocol.UTF8COUNT1 - 1 + len(lengthStr)) + lengthStr + value
        self.__output += packed
            packed = chr(protocol.OPAQUELEN0 + length) + data
        else:
            lengthStr = toByteString(length)
            packed = chr(protocol.OPAQUECOUNT1 - 1 + len(lengthStr)) + lengthStr + data
        self.__output += packed
    def putMsSinceMidnight(self, value):
        """Appends the MsSinceMidnight value to the message."""
        valueStr = toByteString(value)
        packed = chr(protocol.TIMELEN0 + len(valueStr)) + valueStr
        self.__output += packed