~ubuntu-branches/ubuntu/hardy/python-docutils/hardy

« back to all changes in this revision

Viewing changes to docutils/parsers/rst/tableparser.py

  • Committer: Bazaar Package Importer
  • Author(s): martin f. krafft
  • Date: 2006-07-10 11:45:05 UTC
  • mfrom: (2.1.4 edgy)
  • Revision ID: james.westby@ubuntu.com-20060710114505-otkhqcslevewxmz5
Tags: 0.4-3
Added build dependency on python-central (closes: #377580).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Author: David Goodger
2
2
# Contact: goodger@users.sourceforge.net
3
 
# Revision: $Revision: 1.9 $
4
 
# Date: $Date: 2003/07/05 22:38:28 $
 
3
# Revision: $Revision: 4152 $
 
4
# Date: $Date: 2005-12-08 00:46:30 +0100 (Thu, 08 Dec 2005) $
5
5
# Copyright: This module has been placed in the public domain.
6
6
 
7
7
"""
39
39
    head_body_separator_pat = None
40
40
    """Matches the row separator between head rows and body rows."""
41
41
 
 
42
    double_width_pad_char = '\x00'
 
43
    """Padding character for East Asian double-width text."""
 
44
 
42
45
    def parse(self, block):
43
46
        """
44
47
        Analyze the text `block` and return a table data structure.
169
172
            cellblock = self.block.get_2D_block(top + 1, left + 1,
170
173
                                                bottom, right)
171
174
            cellblock.disconnect()      # lines in cell can't sync with parent
 
175
            cellblock.replace(self.double_width_pad_char, '')
172
176
            self.cells.append((top, left, bottom, right, cellblock))
173
177
            corners.extend([(top, right), (bottom, left)])
174
178
            corners.sort()
469
473
            start, end = columns[i]
470
474
            cellblock = lines.get_2D_block(0, start, len(lines), end)
471
475
            cellblock.disconnect()      # lines in cell can't sync with parent
 
476
            cellblock.replace(self.double_width_pad_char, '')
472
477
            row[i][3] = cellblock
473
478
        self.table.append(row)
474
479