changeset 101:5bfaa3ee1f27

better warning message
author Jan Kanis <jan.code@jankanis.nl>
date Tue, 01 Jul 2014 16:51:38 +0200
parents be7c94e29cd8
children 87c5402e0ba8
files blast2html.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/blast2html.py	Tue Jul 01 16:23:29 2014 +0200
+++ b/blast2html.py	Tue Jul 01 16:51:38 2014 +0200
@@ -382,8 +382,9 @@
 def read_genelinks(dir):
     links = {}
     # blastdb.loc, blastdb_p.loc, blastdb_d.loc, etc.
-    # sort reversed, so blastdb.loc will take precedence
-    for f in sorted(glob.glob(path.join(dir, 'blastdb*.loc')), reverse=True): 
+    files = sorted(glob.glob(path.join(dir, 'blastdb*.loc')))
+    # reversed, so blastdb.loc will take precedence
+    for f in reversed(files):
         try:
             f = open(path.join(dir, f))
             for l in f.readlines():
@@ -398,7 +399,7 @@
         except OSError:
             continue
     if not links:
-        warnings.warn("No gene bank link templates found")
+        warnings.warn("No gene bank link templates found in {0}".format(', '.join(files))
     return links