def _get_file_list(self, working_dir, file_regex=re.compile(r'.*'), ftp=None):
        """
        Get file list from ftp server filtered by taxon
        :return: Tuple of (Generator object with Tuple(
            file name, info object), ftp object)
        """

        if ftp is None:
            ftp = ftplib.FTP(BGEE_FTP)
            ftp.login("anonymous", "info@monarchinitiative.org")

        working_dir = "{}{}".format(self.version, working_dir)
        LOG.info('Looking for remote files in %s', working_dir)

        ftp.cwd(working_dir)
        remote_files = ftp.nlst()

        # LOG.info('All remote files \n%s', '\n'.join(remote_files))
        files_to_download = [
            dnload for dnload in remote_files if re.match(file_regex, dnload) and
            re.findall(r'^\d+', dnload)[0] in self.tax_ids]
        # LOG.info('Choosing remote files \n%s', '\n'.join(list(files_to_download)))

        return files_to_download, ftp
def _get_file_list ( self , working_dir , file_regex = re . compile ( r'.*' ) , ftp = None ) : if ftp is None : ftp = ftplib . FTP ( BGEE_FTP ) ftp . login ( "anonymous" , "info@monarchinitiative.org" ) working_dir = "{}{}" . format ( self . version , working_dir ) LOG . info ( 'Looking for remote files in %s' , working_dir ) ftp . cwd ( working_dir ) remote_files = ftp . nlst ( ) files_to_download = [ dnload for dnload in remote_files if re . match ( file_regex , dnload ) and re . findall ( r'^\d+' , dnload ) [ 0 ] in self . tax_ids ] return files_to_download , ftp
Get file list from ftp server filtered by taxon
        :return: Tuple of (Generator object with Tuple(
            file name, info object), ftp object)