Repository 'blast2html'
hg clone https://toolshed.g2.bx.psu.edu/repos/jankanis/blast2html

Changeset 122:5f104d05aa23 (2014-07-31)
Previous changeset 120:2729c2326235 (2014-07-31) Next changeset 123:720efb818f1b (2014-07-31)
Commit message:
fix python 2.6 issue with array type codes
modified:
blast2html.py
b
diff -r 2729c2326235 -r 5f104d05aa23 blast2html.py
--- a/blast2html.py Thu Jul 31 16:14:36 2014 +0200
+++ b/blast2html.py Thu Jul 31 17:24:10 2014 +0200
[
@@ -328,9 +328,10 @@
         for hit in hits(result):
             hsps = hit.Hit_hsps.Hsp
 
-            cover = array('B', [0]) * query_length
+            # In python 2.6 array doesn't accept unicode type codes, but in 3.4 it requires them
+            cover = array(str('B'), [0]) * query_length
             for hsp in hsps:
-                cover[hsp['Hsp_query-from']-1 : int(hsp['Hsp_query-to'])] = array('B', [1]) * blastxml_len(hsp)
+                cover[hsp['Hsp_query-from']-1 : int(hsp['Hsp_query-to'])] = array(str('B'), [1]) * blastxml_len(hsp)
             cover_count = cover.count(1)
 
             best_hsp = max(hsps, key=lambda h: h['Hsp_bit-score'])