Exemplo n.º 1
0
    def write(self, data):
        """:raise IOError: If not all bytes could be written
        :return: lenght of incoming data"""
        self.sha1.update(data)
        cdata = self.zip.compress(data)
        bytes_written = write(self.fd, cdata)

        if bytes_written != len(cdata):
            raise self.exc

        return len(data)
Exemplo n.º 2
0
    def write(self, data):
        """:raise IOError: If not all bytes could be written
        :return: lenght of incoming data"""
        self.sha1.update(data)
        cdata = self.zip.compress(data)
        bytes_written = write(self.fd, cdata)

        if bytes_written != len(cdata):
            raise self.exc

        return len(data)
Exemplo n.º 3
0
 def close(self):
     remainder = self.zip.flush()
     if write(self.fd, remainder) != len(remainder):
         raise self.exc
     return close(self.fd)
Exemplo n.º 4
0
 def close(self):
     remainder = self.zip.flush()
     if write(self.fd, remainder) != len(remainder):
         raise self.exc
     return close(self.fd)