[hg] galaxy 2692: Fix maf_utilities compatibility with python 2....
details: http://www.bx.psu.edu/hg/galaxy/rev/ba884f1a6b81 changeset: 2692:ba884f1a6b81 user: Dan Blankenberg <dan@bx.psu.edu> date: Tue Sep 15 10:15:42 2009 -0400 description: Fix maf_utilities compatibility with python 2.4; STRING.startswith() accepting a tuple was introduced in python 2.5. 1 file(s) affected in this change: lib/galaxy/tools/util/maf_utilities.py diffs (23 lines): diff -r 40c5e1853a66 -r ba884f1a6b81 lib/galaxy/tools/util/maf_utilities.py --- a/lib/galaxy/tools/util/maf_utilities.py Mon Sep 14 17:03:17 2009 -0400 +++ b/lib/galaxy/tools/util/maf_utilities.py Tue Sep 15 10:15:42 2009 -0400 @@ -403,7 +403,7 @@ else: blocks.append( ( score, idx, offset ) ) - gap_chars_tuple = tuple( GAP_CHARS ) + #gap_chars_tuple = tuple( GAP_CHARS ) gap_chars_str = ''.join( GAP_CHARS ) #Loop through ordered blocks and layer by increasing score for block_dict in blocks: for block in iter_blocks_split_by_species( block_dict[1].get_at_offset( block_dict[2] ) ): #need to handle each occurance of sequence in block seperately @@ -415,7 +415,8 @@ #we should trim gaps from both sides, since these are not positions in this species genome (sequence) text = text.rstrip( gap_chars_str ) gap_offset = 0 - while text.startswith( gap_chars_tuple ): + while True in [ text.startswith( gap_char ) for gap_char in GAP_CHARS ]: #python2.4 doesn't accept a tuple for .startswith() + #while text.startswith( gap_chars_tuple ): gap_offset += 1 text = text[1:] if not text:
participants (1)
-
Nate Coraor