From aaaf0d55318deb64a0fb844dab007ccf40e387c4 Mon Sep 17 00:00:00 2001 From: Aroon Chande Date: Tue, 5 Mar 2019 07:56:45 -0500 Subject: [PATCH] Escape the species name to be safe --- setup.cfg | 2 +- setup.py | 59 ++++++++++++++++++++++++++++----------------------- stringMLST.py | 7 ++---- 3 files changed, 36 insertions(+), 32 deletions(-) diff --git a/setup.cfg b/setup.cfg index 5aef279..b88034e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,2 @@ [metadata] -description-file = README.rst +description-file = README.md diff --git a/setup.py b/setup.py index ef3ecfb..e88193b 100644 --- a/setup.py +++ b/setup.py @@ -1,26 +1,33 @@ -#!/usr/bin/env python -try: - import os - from setuptools import setup, find_packages -except ImportError: - from distutils.core import setup -from os import path -here = path.abspath(path.dirname(__file__)) -long_description="Fast k-mer based tool for alignment and assembly-free multi locus sequence typing (MLST) directly from genome sequencing reads." - -setup( - name = 'stringMLST', - scripts = ['stringMLST.py'], - version = '0.5.2', - description = 'Fast k-mer based tool for alignment and assembly-free multi locus sequence typing (MLST) directly from genome sequencing reads.', - long_description=long_description, - author = 'Jordan Lab', - author_email = 'pypi@atc.io', - url = 'https://github.com/jordanlab/stringMLST', - keywords = ['MLST', 'kmer', "NGS", "stringMSLT"], - classifiers = [ - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.5', - ], - install_requires=['lxml','pyfaidx'], -) +#!/usr/bin/env python +try: + import os + from setuptools import setup, find_packages +except ImportError: + from distutils.core import setup +from os import path +here = path.abspath(path.dirname(__file__)) +try: + with open("README.md", "r") as fh: + long_description = fh.read() + except: + pass + else: + long_description = 'Fast k-mer based tool for alignment and assembly-free multi locus sequence typing (MLST) directly from genome sequencing reads.' + +setup( + name = 'stringMLST', + scripts = ['stringMLST.py'], + version = '0.6', + description = 'Fast k-mer based tool for alignment and assembly-free multi locus sequence typing (MLST) directly from genome sequencing reads.', + long_description=long_description, + long_description_content_type="text/markdown", + author = 'Jordan Lab', + author_email = 'pypi@atc.io', + url = 'https://github.com/jordanlab/stringMLST', + keywords = ['MLST', 'kmer', "NGS", "stringMSLT"], + classifiers = [ + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.5', + ], + install_requires=['lxml','pyfaidx'], +) diff --git a/stringMLST.py b/stringMLST.py index 22f2e60..3ddba0e 100755 --- a/stringMLST.py +++ b/stringMLST.py @@ -15,7 +15,7 @@ except ImportError: from urllib import urlopen, urlretrieve import argparse -version = """ stringMLST v0.5.2 (updated : January, 7 2018) """ +version = """ stringMLST v0.6 (updated : March, 5 2019) """ """ stringMLST free for academic users and requires permission before any commercial @@ -259,13 +259,11 @@ def get_links(xmlData, savePath, speciesName): lociList = {} for species in xmlData: - if re.search(speciesName, species.text, re.IGNORECASE): + if re.search(re.escape(speciesName), species.text, re.IGNORECASE, ): for mlst in species: for database in mlst: for child in database: - print(child.text) if child.tag == "profiles": - print(child[1].text) profileURL = child[1].text if child.tag == "loci": for locus in child: @@ -1545,7 +1543,6 @@ def checkParams(buildDB, predict, config, k, listMode, list, batch, dir, fastq1, else: filePrefix = dbPrefix config = filePrefix + "_config.txt" - print("Get URLs") profileURL, loci = get_links(dbRoot, filePrefix, species) get_files(filePrefix, loci, profileURL, species)