Esempio n. 1
0
 def registerProducer(self, producer, streaming):
     if not streaming:
         raise NotImplementedError("Non-streaming producer not supported.")
     # we write the data to a temporary file, since Tahoe can't do
     # streaming upload yet.
     self.f = EncryptedTemporaryFile()
     return None
Esempio n. 2
0
class FileWriter(object):
    def registerProducer(self, producer, streaming):
        if not streaming:
            raise NotImplementedError("Non-streaming producer not supported.")
        # we write the data to a temporary file, since Tahoe can't do
        # streaming upload yet.
        self.f = EncryptedTemporaryFile()
        return None

    def unregisterProducer(self):
        # the upload actually happens in WriteFile.close()
        pass

    def write(self, data):
        self.f.write(data)
Esempio n. 3
0
 def registerProducer(self, producer, streaming):
     if not streaming:
         raise NotImplementedError("Non-streaming producer not supported.")
     # we write the data to a temporary file, since Tahoe can't do
     # streaming upload yet.
     self.f = EncryptedTemporaryFile()
     return None
Esempio n. 4
0
class FileWriter(object):

    def registerProducer(self, producer, streaming):
        if not streaming:
            raise NotImplementedError("Non-streaming producer not supported.")
        # we write the data to a temporary file, since Tahoe can't do
        # streaming upload yet.
        self.f = EncryptedTemporaryFile()
        return None

    def unregisterProducer(self):
        # the upload actually happens in WriteFile.close()
        pass

    def write(self, data):
        self.f.write(data)
Esempio n. 5
0
 def test_encrypted_tempfile(self):
     f = EncryptedTemporaryFile()
     f.write(b"foobar")
     f.close()