From: W. Trevor King Date: Sat, 16 Apr 2011 01:25:05 +0000 (-0400) Subject: Capitalize global constants in entrez.py. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1fdfb871d9eb815161af877e28d01ec9fa36e10c;p=blog.git Capitalize global constants in entrez.py. --- diff --git a/posts/entrez/entrez.py b/posts/entrez/entrez.py index e83a26e..30a6566 100755 --- a/posts/entrez/entrez.py +++ b/posts/entrez/entrez.py @@ -64,10 +64,10 @@ if _POSIX: # Entrez access points -einfo_url = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi' -esearch_url = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi' -efetch_url = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi' -elink_url = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi' +EINFO_URL = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi' +ESEARCH_URL = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi' +EFETCH_URL = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi' +ELINK_URL = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi' # Entrez-requested tracking information TOOL = 'entrezpy' @@ -222,8 +222,8 @@ def _query_einfo(db=None): 'tool': TOOL, 'email': EMAIL}) - LOG.info("getting einfo from '%s?%s'" % (einfo_url, params)) - f = urllib.urlopen ("%s?%s" % (einfo_url, params)) + LOG.info("getting einfo from '%s?%s'" % (EINFO_URL, params)) + f = urllib.urlopen ("%s?%s" % (EINFO_URL, params)) string = f.read() f.close() LOG.debug('got:\n%s' % string) @@ -431,8 +431,8 @@ def _query_esearch(term, db='pubmed', field=None, 'rettype': rettype, 'sort': sort}) - LOG.info("getting esearch from '%s?%s'" % (esearch_url, params)) - f = urllib.urlopen ("%s?%s" % (esearch_url, params)) + LOG.info("getting esearch from '%s?%s'" % (ESEARCH_URL, params)) + f = urllib.urlopen ("%s?%s" % (ESEARCH_URL, params)) string = f.read() f.close() LOG.debug('got:\n%s' % string) @@ -523,8 +523,8 @@ def _query_efetch(id, db='pubmed', 'retmode': retmode, 'rettype': rettype}) - LOG.info("getting efetch from '%s?%s'" % (efetch_url, params)) - f = urllib.urlopen ("%s?%s" % (efetch_url, params)) + LOG.info("getting efetch from '%s?%s'" % (EFETCH_URL, params)) + f = urllib.urlopen ("%s?%s" % (EFETCH_URL, params)) string = f.read() f.close() LOG.debug('got:\n%s' % string) @@ -630,8 +630,8 @@ def _query_elink(id, term=None, db='all', dbfrom='pubmed', 'datetype': datetype, 'retmode': retmode}) - LOG.info("getting elink from '%s?%s'" % (elink_url, params)) - f = urllib.urlopen ("%s?%s" % (elink_url, params)) + LOG.info("getting elink from '%s?%s'" % (ELINK_URL, params)) + f = urllib.urlopen ("%s?%s" % (ELINK_URL, params)) if cmd == 'prlinks' and retmode == 'ref': # Just get the link, we don't need the provider's webpage HTML.