Commits

Georg Brandl  committed 64e5e8e

Code style fixes.

  • Participants
  • Parent commits b153607

Comments (0)

Files changed (2)

File sphinx/writers/latex.py

         self.table.rowcount += 1
 
     def visit_entry(self, node):
-        if self.remember_multirow.has_key('0') and self.remember_multirow['0'] > 1:
+        if self.remember_multirow.get(0, 0) > 1:
             self.body.append(' & ')
         if self.table.col > 0:
             self.body.append(' & ')
             self.body.append(str(node.get('morerows') + 1))
             self.body.append('}{*}{')
             self.context.append('}')
-            self.remember_multirow[str(self.table.col)] = node.get('morerows') + 1;
+            self.remember_multirow[self.table.col] = node.get('morerows') + 1
         if 'morecols' in node:
             self.body.append(' \multicolumn{')
             self.body.append(str(node.get('morecols') + 1))
         if isinstance(node.parent.parent, nodes.thead):
             self.body.append('\\textbf{')
             self.context.append('}')
-        if self.remember_multirow.has_key(str(self.table.col + 1)) and self.remember_multirow[str(self.table.col + 1)] > 1:
-            self.remember_multirow[str(self.table.col + 1)] -= 1
+        if self.remember_multirow.get(self.table.col + 1, 0) > 1:
+            self.remember_multirow[self.table.col + 1] -= 1
             self.context.append(' & ')
     def depart_entry(self, node):
         self.body.append(self.context.pop()) # header

File tests/root/markup.txt

    | 2  | Empty cells:   |    |
    +----+----------------+----+
 
+Table with multicol:
+
+   +----+---------------------+
+   | 1  | test!               |
+   +----+---------+------+----+
+   | 2  | col     | col  | c  |
+   | y  +---------+------+----+
+   | x  | test                |
+   +----+---------------------+
+
 
 Figures
 -------