"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Tardis/Messages.py" between
Tardis-1.1.5.tar.gz and Tardis-1.2.1.tar.gz

About: Tardis is a system for making encrypted, incremental backups of filesystems.

Messages.py  (Tardis-1.1.5):Messages.py  (Tardis-1.2.1)
skipping to change at line 71 skipping to change at line 71
msg.extend(chunk) msg.extend(chunk)
if self.__stats != None: if self.__stats != None:
self.__stats['bytesRecvd'] += len(msg) self.__stats['bytesRecvd'] += len(msg)
return msg return msg
def sendBytes(self, bytes): def sendBytes(self, bytes):
if self.__stats != None: if self.__stats != None:
self.__stats['bytesSent'] += len(bytes) self.__stats['bytesSent'] += len(bytes)
self.__socket.sendall(bytes) self.__socket.sendall(bytes)
def closeSocket(self):
if self.__socket:
self.__socket.close()
self.__socket = None
class zlibCompressor: class zlibCompressor:
def __init__(self): def __init__(self):
self.compressor = zlib.compressobj() self.compressor = zlib.compressobj()
self.decompressor = zlib.decompressobj() self.decompressor = zlib.decompressobj()
def compress(self, message): def compress(self, message):
message = self.compressor.compress(message) message = self.compressor.compress(message)
message += self.compressor.flush(zlib.Z_SYNC_FLUSH) message += self.compressor.flush(zlib.Z_SYNC_FLUSH)
return message return message
skipping to change at line 217 skipping to change at line 222
return message return message
def encode(self, data): def encode(self, data):
return data return data
def decode(self, data): def decode(self, data):
return data return data
def getEncoding(self): def getEncoding(self):
return "bin" return "bin"
class ObjectMessages():
def __init__(self, inQueue, outQueue, stats=None, compress=True, timeout=Non
e):
self.inQueue = inQueue
self.outQueue= outQueue
self.timeout = timeout
def sendMessage(self, message, compress=False, raw=False):
self.outQueue.put(message)
def recvMessage(self, raw=False):
ret = self.inQueue.get(timeout=self.timeout)
if isinstance(ret, BaseException):
raise ret
return ret
def encode(self, data):
return data
def decode(self, data):
return data
def getEncoding(self):
return "bin"
def closeSocket(self):
pass
 End of changes. 2 change blocks. 
0 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)