def output(self): rmfs = RemoteFileSystem(FTP_HOST, username=FTP_USER, password=FTP_PASS) files = None if rmfs.exists(FTP_IN_PATH): lst = rmfs.listdir(FTP_IN_PATH) files = fnmatch.filter([basename(l) for l in lst], self.bins_fname_tmp) else: NoBinsToParseTaxPayments('Could not find directory with bins') if not files: raise NoBinsToParseTaxPayments('Could not find any file with bins') # bins_fpath = join(FTP_IN_PATH, last_file_with_bins(files)) bins_fpath = FTP_IN_PATH + '/' + last_file_with_bins(files) return RemoteTarget(bins_fpath, FTP_HOST, username=FTP_USER, password=FTP_PASS)
def output(self): rmfs = RemoteFileSystem(FTP_HOST, username=FTP_USER, password=FTP_PASS) files = None if rmfs.exists(FTP_IN_PATH): lst = rmfs.listdir(FTP_IN_PATH) files = fnmatch.filter([basename(l) for l in lst], self.fname_pattern) else: NoDataflowExportFile('Could not find directory with bins') if not files: raise NoDataflowExportFile('Could not find any file with bins') bins_fpath = FTP_IN_PATH + '/' + current_file_to_process(files) return RemoteTarget(bins_fpath, FTP_HOST, username=FTP_USER, password=FTP_PASS)