##// END OF EJS Templates
setting a period to send by FTP
Daniel Valdez -
r489:a860ec855d7e
parent child
Show More
@@ -299,6 +299,7 class FTP():
299 299 class SendByFTP(Operation):
300 300 def __init__(self):
301 301 self.status = 1
302 self.counter = 0
302 303
303 304 def error_print(self, ValueError):
304 305 print ValueError, 'Error FTP'
@@ -337,12 +338,17 class SendByFTP(Operation):
337 338 if len(self.filenameList) == 0:
338 339 self.status = 0
339 340
340 def run(self, dataOut, ext, localfolder, remotefolder, server, username, password):
341 def run(self, dataOut, ext, localfolder, remotefolder, server, username, password, period=1):
341 342
342 self.filterByExt(ext, localfolder)
343
344 self.connect(server, username, password, remotefolder)
345
346 self.put()
343 self.counter += 1
344 if self.counter >= period:
345 self.filterByExt(ext, localfolder)
346
347 self.connect(server, username, password, remotefolder)
348
349 self.put()
350
351 self.close()
352
353 self.counter = 0
347 354
348 self.close()
General Comments 0
You need to be logged in to leave comments. Login now