Example #1
0
	def process_files(self,eve):
		counter = 0
		process_fls = []
		if self.files_checked != None:
			for x in self.files_checked:
				if x.get() == 1:
					if self.action_type == 'upld':
						isf_isd = os.path.isfile(self.files[counter][0])
					else:
						isf_isd = False if os.path.splitext(self.files[counter][1])[1] == '' else True
						
					if isf_isd:
						process_fls.append((self.files[counter],counter))
						self.fstatus[counter].set('Please wait........')
				counter += 1
			
			if len(process_fls) > 0:
				process_fls.append(self.C_KEY)
				process_fls.append(self.action_type)
				
				self.root.withdraw()
				# print process_fls
				call_ftp = Callftp(process_fls)
				call_ftp.getFtpSession()
			sys.exit(1)
Example #2
0
def process_files(fls,config_params,action_type):
	process_fls = []
	fm = FileManip(config_params)
	manip_file_path = fm.trim_ftp_path(fls)
	if action_type == 'upld':
		local_ftp_path = fm.convert_filepath_ftp_path(fls,manip_file_path)
	elif action_type == 'dwnld':
		local_ftp_path = fm.convert_filepath_ftp_path(fls,manip_file_path)
		local_ftp_path = (local_ftp_path[1],local_ftp_path[0])
	else:
		sys.exit(1)
		
	process_fls.append((local_ftp_path,0))	
	rd_uuid = str(uuid.uuid4())
	process_fls.append(config_params['FTP_KEY'])
	process_fls.append(action_type)
	
	call_ftp = Callftp(process_fls)
	call_ftp.getFtpSession()
	sys.exit(1)