Esempio n. 1
0
 def send_file(self, filePath, address):
     # send to server (aka on my laptop)
     #transmitOne(filePath,'137.54.51.83',self.send_port)
     #transmitOne(filePath,port=self.send_port,address='localhost')
     #transmitOne(filePath, 'localhost',self.send_port)
     port = self.send_port
     if "MOV;" in filePath:
         moveMessage.sendFile(filePath, address, port)
     else:
         controller = type('test',(object,),{'cancel':False, 'total_sent':0,'completed':Deferred()})
         f = FileIOClientFactory(filePath, controller)
         reactor.connectTCP(address, port, f)
         return controller.completed
Esempio n. 2
0
 def send_file(self, filePath, address):
     # send to server (aka on my laptop)
     # transmitOne(filePath,'137.54.51.83',self.send_port)
     # transmitOne(filePath,port=self.send_port,address='localhost')
     # transmitOne(filePath, 'localhost',self.send_port)
     port = self.send_port
     if "MOV;" in filePath:
         moveMessage.sendFile(filePath, address, port)
     else:
         if ".enc" not in filePath:
             fileCrypto.encrypt_file("somekey", filePath)
             filePath = filePath + ".enc"
         controller = type("test", (object,), {"cancel": False, "total_sent": 0, "completed": Deferred()})
         f = FileIOClientFactory(filePath, controller)
         reactor.connectTCP(address, port, f)
         os.remove(filePath)
         return controller.completed
Esempio n. 3
0
 def transmitDelete(self, source):
     moveMessage.sendFile(source,self.address,self.port)
     print 'Dialing on port',self.port,'..'
     reactor.run(installSignalHandlers=0)