Commit aa055ada authored by Mario Jorge Amaral's avatar Mario Jorge Amaral

Put the method getTableMatrix again.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@43691 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d90d6198
......@@ -121,6 +121,22 @@ class OOGranulator(object):
logger.error(e)
return None
def getTableMatrix(self, id):
"""Returns the table as a matrix"""
row_list = self.document.parsed_content.xpath(
'//table:table[@table:name="%s"]/table:table-row' % id,
namespaces=self.document.parsed_content.nsmap)
if len(row_list) == 0:
return None
matrix = []
for row in row_list:
matrix_row = []
for cell in row.iterchildren():
matrix_row.append(''.join(cell.itertext()))
matrix.append(matrix_row)
return matrix
def getColumnItemList(self, table_id):
"""Return the list of columns in the form of (id, title)."""
raise NotImplementedError
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment