Esempio n. 1
0
	def getFile (self, remoteFile, localFile):
		'''
		Copy the remote file remoteFile into localFile
		Return True if no error. Otherwise, returns Exception
		'''
		logging.info ("Copy the remote file {0} to {1}".format(remoteFile,localFile))
		data = self.readFile (remoteFile)
		if isinstance(data,Exception): 
			return data
		else:
			putDataToFile(data, localFile)
			return True
Esempio n. 2
0
	def getFileViaOpenRowSet(self, remoteFile, localFile):
		'''
		Copy the remote file remofile to localFile via OpenRowSet
		'''
		logging.info ('Copy the remote file {0} to {1} via Openrowset'.format(remoteFile, localFile))
		data = self.readFileViaOpenRowSet(remoteFile)
		if isinstance(data,Exception):
			logging.info("Impossible to read the file {0} with OpenRowSet: {1}".format(remoteFile, data))
			return data
		else :
			putDataToFile(data, localFile)
			logging.info ('The local file {0} has been created'.format(localFile))
			return True