From 044d2960fdc47e6c60d5224a852bfbca075fe8f8 Mon Sep 17 00:00:00 2001 From: Daniel Blankenberg Date: Tue, 15 Sep 2009 10:15:42 -0400 Subject: [PATCH] Fix maf_utilities compatibility with python 2.4; STRING.startswith() accepting a tuple was introduced in python 2.5. --- lib/galaxy/tools/util/maf_utilities.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tools/util/maf_utilities.py b/lib/galaxy/tools/util/maf_utilities.py index 09ef49d0f8b..cbc52604136 100644 --- a/lib/galaxy/tools/util/maf_utilities.py +++ b/lib/galaxy/tools/util/maf_utilities.py @@ -403,7 +403,7 @@ def fill_region_alignment( alignment, index, primary_species, chrom, start, end, 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 @@ def fill_region_alignment( alignment, index, primary_species, chrom, start, end, #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: