~ubuntu-branches/ubuntu/trusty/python-biopython/trusty-proposed

« back to all changes in this revision

Viewing changes to Bio/Blast/NCBIXML.py

  • Committer: Bazaar Package Importer
  • Author(s): Philipp Benner
  • Date: 2009-08-24 09:29:27 UTC
  • mfrom: (1.3.3 upstream) (4.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090824092927-2wwh36vwnfgn98kl
Tags: 1.51final-2
Merged patch from ubuntu to make the package ready for
python2.6 (Closes: #543236).

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
                    print "NCBIXML: Ignored: " + method
77
77
                self._debug_ignore_list.append(method)
78
78
 
 
79
        #We don't care about white space in parent tags like Hsp,
 
80
        #but that white space doesn't belong to child tags like Hsp_midline
 
81
        if self._value.strip() :
 
82
            raise ValueError("What should we do with %s before the %s tag?" \
 
83
                             % (repr(self._value), name))
 
84
        self._value = ""
 
85
 
79
86
    def characters(self, ch):
80
87
        """Found some text
81
88
 
88
95
 
89
96
        name -- tag name
90
97
        """
91
 
        # Strip character buffer
92
 
        self._value = self._value.strip()
 
98
        # DON'T strip any white space, we may need it e.g. the hsp-midline
93
99
        
94
100
        # Try to call a method (defined in subclasses)
95
101
        method = self._secure_name('_end_' + name)
510
516
    def _end_Hsp_midline(self):
511
517
        """Formatting middle line as normally seen in BLAST report
512
518
        """
513
 
        self._hsp.match = self._value
 
519
        self._hsp.match = self._value # do NOT strip spaces!
 
520
        assert len(self._hsp.match)==len(self._hsp.query)
 
521
        assert len(self._hsp.match)==len(self._hsp.sbjct)
514
522
 
515
523
    # Statistics
516
524
    def _end_Statistics_db_num(self):