def tables_sheet_data(self): t_header = ['ID', 'label/caption', 'table/graphic'] r = [] for t in self.article.tables: row = {} row['ID'] = t.graphic_parent.id row['label/caption'] = t.graphic_parent.label + '/' + t.graphic_parent.caption row['table/graphic'] = t.table + html_reports.thumb_image('{IMG_PATH}') r.append(row) return (t_header, ['label/caption', 'table/graphic'], r)
def tables_sheet_data(self, path): t_header = ['ID', 'label/caption', 'table/graphic'] r = [] for t in self.article.tables: row = {} row['ID'] = t.graphic_parent.id row['label/caption'] = t.graphic_parent.label + '/' + t.graphic_parent.caption #row['table/graphic'] = t.table + t.graphic_parent.graphic.display('file:///' + path) row['table/graphic'] = t.table + html_reports.thumb_image('file:///' + path) r.append(row) return (t_header, ['label/caption', 'table/graphic'], r)
def tables(self): r = '<!-- no tables -->' if len(self.article.tables) > 0: r = html_reports.tag('p', 'Tables:', 'label') for t in self.article.tables: #print(t) header = html_reports.tag('h3', t.id) table_data = '' table_data += html_reports.display_labeled_value('label', t.label, 'label') table_data += html_reports.display_labeled_value('caption', t.caption, 'label') table_data += html_reports.tag('p', 'table-wrap/table (xml)', 'label') table_data += html_reports.tag('div', html_reports.format_html_data(t.table), 'xml') if t.table: table_data += html_reports.tag('p', 'table-wrap/table', 'label') table_data += html_reports.tag('div', t.table, 'element-table') if t.graphic: #table_data += html_reports.display_labeled_value('table-wrap/graphic', t.graphic.display('file:///' + self.xml_path), 'value') table_data += html_reports.display_labeled_value('table-wrap/graphic', html_reports.thumb_image('{IMG_PATH}'), 'value') r += header + html_reports.tag('div', table_data, 'block') return r