##// 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 class SendByFTP(Operation):
299 class SendByFTP(Operation):
300 def __init__(self):
300 def __init__(self):
301 self.status = 1
301 self.status = 1
302 self.counter = 0
302
303
303 def error_print(self, ValueError):
304 def error_print(self, ValueError):
304 print ValueError, 'Error FTP'
305 print ValueError, 'Error FTP'
@@ -337,12 +338,17 class SendByFTP(Operation):
337 if len(self.filenameList) == 0:
338 if len(self.filenameList) == 0:
338 self.status = 0
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 self.counter += 1
343
344 if self.counter >= period:
344 self.connect(server, username, password, remotefolder)
345 self.filterByExt(ext, localfolder)
345
346
346 self.put()
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