5326: Revert r18842
svn: r18848
This commit is contained in:
@@ -30,8 +30,7 @@ class DocGenPlugin(Plugin):
|
||||
"""
|
||||
This class represents a plugin for generating documents from Gramps
|
||||
"""
|
||||
def __init__(self, name, description, basedoc, paper, style, index,
|
||||
extension):
|
||||
def __init__(self, name, description, basedoc, paper, style, extension):
|
||||
"""
|
||||
@param name: A friendly name to call this plugin.
|
||||
Example: "Plain Text"
|
||||
@@ -48,10 +47,6 @@ class DocGenPlugin(Plugin):
|
||||
@param style: Indicates whether the plugin uses styles or not.
|
||||
True = use styles; False = do not use styles
|
||||
@type style: bool
|
||||
@param index: Indicates whether the plugin supports an Alphabetical
|
||||
Index and Table of Contents or not.
|
||||
True = supports indexing; False = does not support indexing
|
||||
@type index: bool
|
||||
@param extension: The extension for the output file.
|
||||
Example: "txt"
|
||||
@type extension: str
|
||||
@@ -61,7 +56,6 @@ class DocGenPlugin(Plugin):
|
||||
self.__basedoc = basedoc
|
||||
self.__paper = paper
|
||||
self.__style = style
|
||||
self.__index = index
|
||||
self.__extension = extension
|
||||
|
||||
def get_basedoc(self):
|
||||
@@ -88,14 +82,6 @@ class DocGenPlugin(Plugin):
|
||||
"""
|
||||
return self.__style
|
||||
|
||||
def get_index_support(self):
|
||||
"""
|
||||
Get the index flag for this plugin.
|
||||
|
||||
@return: bool - True = index support; False = no index support
|
||||
"""
|
||||
return self.__index
|
||||
|
||||
def get_extension(self):
|
||||
"""
|
||||
Get the file extension for the output file.
|
||||
@@ -120,4 +106,4 @@ class DocGenPlugin(Plugin):
|
||||
@return: bool: True if DrawDoc is supported; False if DrawDoc is not
|
||||
supported.
|
||||
"""
|
||||
return bool(issubclass(self.__basedoc, DrawDoc))
|
||||
return bool(issubclass(self.__basedoc, DrawDoc))
|
||||
@@ -533,7 +533,6 @@ class BasePluginManager(object):
|
||||
basedoc = getattr(mod, pdata.basedocclass),
|
||||
paper = pdata.paper,
|
||||
style = pdata.style,
|
||||
index = pdata.index,
|
||||
extension = pdata.extension )
|
||||
self.__docgen_plugins.append(dgp)
|
||||
|
||||
|
||||
@@ -268,9 +268,6 @@ class PluginData(object):
|
||||
bool, Indicates whether the plugin uses paper or not, default=True
|
||||
.. attribute :: style
|
||||
bool, Indicates whether the plugin uses styles or not, default=True
|
||||
.. attribute :: index
|
||||
bool, Indicates whether the plugin supports an Alphabetical Index and
|
||||
Table of Contents or not, default=False
|
||||
|
||||
Attribute for DOCGEN, EXPORT plugins
|
||||
.. attribute :: extension
|
||||
@@ -379,7 +376,6 @@ class PluginData(object):
|
||||
self._basedocclass = None
|
||||
self._paper = True
|
||||
self._style = True
|
||||
self._index = False
|
||||
self._extension = ''
|
||||
#QUICKREPORT attr
|
||||
self._runfunc = None
|
||||
@@ -707,16 +703,6 @@ class PluginData(object):
|
||||
def _get_style(self):
|
||||
return self._style
|
||||
|
||||
def _set_index(self, index):
|
||||
if not self._ptype == DOCGEN:
|
||||
raise ValueError, 'index may only be set for DOCGEN plugins'
|
||||
if not isinstance(index, bool):
|
||||
raise ValueError, 'Plugin must have index=True or False'
|
||||
self._index = index
|
||||
|
||||
def _get_index(self):
|
||||
return self._index
|
||||
|
||||
def _set_extension(self, extension):
|
||||
if not (self._ptype == DOCGEN or self._ptype == EXPORT
|
||||
or self._ptype == IMPORT):
|
||||
@@ -729,8 +715,7 @@ class PluginData(object):
|
||||
|
||||
basedocclass = property(_get_basedocclass, _set_basedocclass)
|
||||
paper = property(_get_paper, _set_paper)
|
||||
style = property(_get_style, _set_style)
|
||||
index = property(_get_index, _set_index)
|
||||
style = property(_get_style, _set_style)
|
||||
extension = property(_get_extension, _set_extension)
|
||||
|
||||
#QUICKREPORT attributes
|
||||
|
||||
@@ -14,7 +14,6 @@ pkgdata_PYTHON = \
|
||||
fontstyle.py \
|
||||
graphdoc.py \
|
||||
graphicstyle.py \
|
||||
indexoptions.py \
|
||||
paperstyle.py \
|
||||
paragraphstyle.py \
|
||||
stylesheet.py \
|
||||
|
||||
@@ -29,7 +29,6 @@ A docgen plugin should fully implement this api for TextDoc or DrawDoc
|
||||
|
||||
from basedoc import BaseDoc
|
||||
from paperstyle import PaperSize, PaperStyle, PAPER_PORTRAIT, PAPER_LANDSCAPE
|
||||
from indexoptions import IndexOptions
|
||||
from fontstyle import FontStyle, FONT_SANS_SERIF, FONT_SERIF, FONT_MONOSPACE
|
||||
from paragraphstyle import ParagraphStyle, PARA_ALIGN_CENTER, PARA_ALIGN_LEFT,\
|
||||
PARA_ALIGN_RIGHT, PARA_ALIGN_JUSTIFY
|
||||
|
||||
@@ -61,7 +61,7 @@ class BaseDoc(object):
|
||||
such as OpenOffice, AbiWord, and LaTeX are derived from this base
|
||||
class, providing a common interface to all document generators.
|
||||
"""
|
||||
def __init__(self, styles, paper_style, index_options):
|
||||
def __init__(self, styles, paper_style):
|
||||
"""
|
||||
Create a BaseDoc instance, which provides a document generation
|
||||
interface. This class should never be instantiated directly, but
|
||||
@@ -71,13 +71,8 @@ class BaseDoc(object):
|
||||
@param paper_style: PaperStyle instance containing information about
|
||||
the paper. If set to None, then the document is not a page
|
||||
oriented document (e.g. HTML)
|
||||
@param index_options: IndexOptions instance containing information
|
||||
about how an alphabetical index and table of contents should be
|
||||
generated. If set to None, then the document is does not support
|
||||
indexing (e.g. HTML)
|
||||
"""
|
||||
self.paper = paper_style
|
||||
self.index_options = index_options
|
||||
self._style_sheet = styles
|
||||
self._creator = ""
|
||||
self.init_called = False
|
||||
|
||||
@@ -358,8 +358,8 @@ class GVDocBase(BaseDoc, GVDoc):
|
||||
inherit from this class will only need to implement the close function.
|
||||
The close function will generate the actual file of the appropriate type.
|
||||
"""
|
||||
def __init__(self, options, paper_style, index_opts):
|
||||
BaseDoc.__init__(self, None, paper_style, index_opts)
|
||||
def __init__(self, options, paper_style):
|
||||
BaseDoc.__init__(self, None, paper_style)
|
||||
|
||||
self._filename = None
|
||||
self._dot = StringIO()
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2012 Nick Hall
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# $Id$
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# IndexOptions
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
class IndexOptions(object):
|
||||
"""
|
||||
Define the options for the alphabetical index and table of contents.
|
||||
"""
|
||||
def __init__(self, include_toc, include_index):
|
||||
self.__include_toc = include_toc
|
||||
self.__include_index = include_index
|
||||
|
||||
def get_include_toc(self):
|
||||
"""
|
||||
Return a boolean indicating if a table of contents should be included.
|
||||
"""
|
||||
return self.__include_toc
|
||||
|
||||
def get_include_index(self):
|
||||
"""
|
||||
Return a boolean indicating if an alphabetical index should be included.
|
||||
"""
|
||||
return self.__include_index
|
||||
@@ -7,11 +7,10 @@ pkgdata_PYTHON = \
|
||||
__init__.py\
|
||||
_bibliography.py\
|
||||
_constants.py\
|
||||
_options.py\
|
||||
_options.py\
|
||||
_paper.py\
|
||||
_reportbase.py\
|
||||
endnotes.py\
|
||||
toc_index.py\
|
||||
utils.py
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/gen/plug/report
|
||||
|
||||
@@ -83,8 +83,6 @@ class OptionList(_options.OptionList):
|
||||
self.margins = [2.54, 2.54, 2.54, 2.54]
|
||||
self.format_name = None
|
||||
self.css_filename = None
|
||||
self.toc = None
|
||||
self.index = None
|
||||
|
||||
def set_style_name(self, style_name):
|
||||
"""
|
||||
@@ -236,38 +234,6 @@ class OptionList(_options.OptionList):
|
||||
"""
|
||||
return self.format_name
|
||||
|
||||
def set_toc(self, toc):
|
||||
"""
|
||||
Set the template name for the OptionList.
|
||||
@param template_name: name of the template to set.
|
||||
@type template_name: str
|
||||
"""
|
||||
self.toc = toc
|
||||
|
||||
def get_toc(self):
|
||||
"""
|
||||
Return the template name of the OptionList.
|
||||
@returns: template name
|
||||
@rtype: str
|
||||
"""
|
||||
return self.toc
|
||||
|
||||
def set_index(self, index):
|
||||
"""
|
||||
Set the template name for the OptionList.
|
||||
@param template_name: name of the template to set.
|
||||
@type template_name: str
|
||||
"""
|
||||
self.index = index
|
||||
|
||||
def get_index(self):
|
||||
"""
|
||||
Return the template name of the OptionList.
|
||||
@returns: template name
|
||||
@rtype: str
|
||||
"""
|
||||
return self.index
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Collection of option lists
|
||||
@@ -290,8 +256,6 @@ class OptionListCollection(_options.OptionListCollection):
|
||||
self.default_custom_paper_size = [29.7, 21.0]
|
||||
self.default_margins = [2.54, 2.54, 2.54, 2.54]
|
||||
self.default_format_name = 'print'
|
||||
self.default_toc = False
|
||||
self.default_index = False
|
||||
|
||||
self.last_paper_metric = self.default_paper_metric
|
||||
self.last_paper_name = self.default_paper_name
|
||||
@@ -300,8 +264,6 @@ class OptionListCollection(_options.OptionListCollection):
|
||||
self.last_margins = copy.copy(self.default_margins)
|
||||
self.last_css_filename = self.default_css_filename
|
||||
self.last_format_name = self.default_format_name
|
||||
self.last_toc = self.default_toc
|
||||
self.last_index = self.default_index
|
||||
self.option_list_map = {}
|
||||
|
||||
def set_last_paper_metric(self, paper_metric):
|
||||
@@ -436,34 +398,6 @@ class OptionListCollection(_options.OptionListCollection):
|
||||
"""
|
||||
return self.last_format_name
|
||||
|
||||
def set_last_toc(self, toc):
|
||||
"""
|
||||
Set the last format used for the any report in this collection.
|
||||
|
||||
format_name: name of the format to set.
|
||||
"""
|
||||
self.last_toc = toc
|
||||
|
||||
def get_last_toc(self):
|
||||
"""
|
||||
Return the last format used for the any report in this collection.
|
||||
"""
|
||||
return self.last_toc
|
||||
|
||||
def set_last_index(self, index):
|
||||
"""
|
||||
Set the last format used for the any report in this collection.
|
||||
|
||||
format_name: name of the format to set.
|
||||
"""
|
||||
self.last_index = index
|
||||
|
||||
def get_last_index(self):
|
||||
"""
|
||||
Return the last format used for the any report in this collection.
|
||||
"""
|
||||
return self.last_index
|
||||
|
||||
def write_common(self, f):
|
||||
f.write('<last-common>\n')
|
||||
if self.get_last_paper_metric() != self.default_paper_metric:
|
||||
@@ -479,10 +413,6 @@ class OptionListCollection(_options.OptionListCollection):
|
||||
f.write(' <format name="%s"/>\n' % escxml(self.get_last_format_name()) )
|
||||
if self.get_last_orientation() != self.default_orientation:
|
||||
f.write(' <orientation value="%d"/>\n' % self.get_last_orientation() )
|
||||
if self.get_last_toc() != self.default_toc:
|
||||
f.write(' <toc include="%d"/>\n' % self.get_last_toc())
|
||||
if self.get_last_index() != self.default_index:
|
||||
f.write(' <index include="%d"/>\n' % self.get_last_index())
|
||||
f.write('</last-common>\n')
|
||||
|
||||
def write_module_common(self, f, option_list):
|
||||
@@ -511,13 +441,6 @@ class OptionListCollection(_options.OptionListCollection):
|
||||
for pos in range(len(margins)):
|
||||
f.write(' <margin number="%s" value="%f"/>\n' %
|
||||
(pos, margins[pos]))
|
||||
if option_list.get_format_name() == 'pdf':
|
||||
if option_list.get_toc():
|
||||
f.write(' <toc include="%s"/>\n' %
|
||||
'True' if option_list.get_toc() else False)
|
||||
if option_list.get_index():
|
||||
f.write(' <index include="%s"/>\n' %
|
||||
'True' if option_list.get_index() else False)
|
||||
|
||||
if option_list.get_style_name():
|
||||
f.write(' <style name="%s"/>\n' %
|
||||
@@ -599,22 +522,13 @@ class OptionParser(_options.OptionParser):
|
||||
self.collection.set_last_custom_paper_size([width, height])
|
||||
else:
|
||||
self.option_list.set_custom_paper_size([width, height])
|
||||
|
||||
elif tag == "margin":
|
||||
pos, value = int(attrs['number']), float(attrs['value'])
|
||||
if self.common:
|
||||
self.collection.set_last_margin(pos, value)
|
||||
else:
|
||||
self.option_list.set_margin(pos, value)
|
||||
elif tag == "toc":
|
||||
if self.common:
|
||||
self.collection.set_last_toc(attrs['include'] == 'True')
|
||||
else:
|
||||
self.option_list.set_toc(attrs['include'] == 'True')
|
||||
elif tag == "index":
|
||||
if self.common:
|
||||
self.collection.set_last_index(attrs['include'] == 'True')
|
||||
else:
|
||||
self.option_list.set_index(attrs['include'] == 'True')
|
||||
else:
|
||||
# Tag is not report-specific, so we let the base class handle it.
|
||||
_options.OptionParser.startElement(self, tag, attrs)
|
||||
@@ -683,8 +597,6 @@ class OptionHandler(_options.OptionHandler):
|
||||
self.css_filename = self.option_list_collection.get_last_css_filename()
|
||||
self.margins = self.option_list_collection.get_last_margins()
|
||||
self.format_name = self.option_list_collection.get_last_format_name()
|
||||
self.toc = self.option_list_collection.get_last_toc()
|
||||
self.index = self.option_list_collection.get_last_index()
|
||||
|
||||
def set_common_options(self):
|
||||
if self.saved_option_list.get_style_name():
|
||||
@@ -703,10 +615,6 @@ class OptionHandler(_options.OptionHandler):
|
||||
self.paper_name = self.saved_option_list.get_paper_name()
|
||||
if self.saved_option_list.get_format_name():
|
||||
self.format_name = self.saved_option_list.get_format_name()
|
||||
if self.saved_option_list.get_toc():
|
||||
self.toc = self.saved_option_list.get_toc()
|
||||
if self.saved_option_list.get_index():
|
||||
self.index = self.saved_option_list.get_index()
|
||||
|
||||
def save_options(self):
|
||||
"""
|
||||
@@ -735,8 +643,6 @@ class OptionHandler(_options.OptionHandler):
|
||||
self.saved_option_list.set_paper_name(self.paper_name)
|
||||
self.saved_option_list.set_css_filename(self.css_filename)
|
||||
self.saved_option_list.set_format_name(self.format_name)
|
||||
self.saved_option_list.set_toc(self.toc)
|
||||
self.saved_option_list.set_index(self.index)
|
||||
self.option_list_collection.set_option_list(self.module_name,
|
||||
self.saved_option_list)
|
||||
|
||||
@@ -748,8 +654,6 @@ class OptionHandler(_options.OptionHandler):
|
||||
self.option_list_collection.set_last_paper_name(self.paper_name)
|
||||
self.option_list_collection.set_last_css_filename(self.css_filename)
|
||||
self.option_list_collection.set_last_format_name(self.format_name)
|
||||
self.option_list_collection.set_last_toc(self.toc)
|
||||
self.option_list_collection.set_last_index(self.index)
|
||||
|
||||
def get_stylesheet_savefile(self):
|
||||
"""Where to save user defined styles for this report."""
|
||||
@@ -816,18 +720,6 @@ class OptionHandler(_options.OptionHandler):
|
||||
def set_margins(self,margins):
|
||||
self.margins = copy.copy(margins)
|
||||
|
||||
def get_toc(self):
|
||||
return copy.copy(self.toc)
|
||||
|
||||
def set_toc(self, toc):
|
||||
self.toc = copy.copy(toc)
|
||||
|
||||
def get_index(self):
|
||||
return copy.copy(self.index)
|
||||
|
||||
def set_index(self, index):
|
||||
self.index = copy.copy(index)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Base Options class
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2011 Nick Hall
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
Provide utilities for generating a table of contents and alphabetical index in
|
||||
text reports.
|
||||
"""
|
||||
from gen.plug.docgen import (FontStyle, ParagraphStyle, TableStyle,
|
||||
TableCellStyle, FONT_SANS_SERIF)
|
||||
from gen.ggettext import gettext as _
|
||||
|
||||
def add_toc_index_styles(style_sheet):
|
||||
"""
|
||||
Add paragraph styles to a style sheet to be used for displaying a table of
|
||||
contents and alphabetical index.
|
||||
"""
|
||||
font = FontStyle()
|
||||
font.set(face=FONT_SANS_SERIF, size=14)
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_bottom_margin(0.25)
|
||||
para.set_description(_('The style used for the TOC title.'))
|
||||
style_sheet.add_paragraph_style("TOC-Title", para)
|
||||
|
||||
font = FontStyle()
|
||||
font.set(face=FONT_SANS_SERIF, size=14)
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_bottom_margin(0.25)
|
||||
para.set_description(_('The style used for the Index title.'))
|
||||
style_sheet.add_paragraph_style("Index-Title", para)
|
||||
|
||||
table = TableStyle()
|
||||
table.set_width(100)
|
||||
table.set_columns(2)
|
||||
table.set_column_width(0, 80)
|
||||
table.set_column_width(1, 20)
|
||||
style_sheet.add_table_style("TOC-Table", table)
|
||||
|
||||
cell = TableCellStyle()
|
||||
style_sheet.add_cell_style("TOC-Cell", cell)
|
||||
|
||||
font = FontStyle()
|
||||
font.set(face=FONT_SANS_SERIF, size=10)
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_description(_('The style used for the TOC page numbers.'))
|
||||
style_sheet.add_paragraph_style("TOC-Number", para)
|
||||
|
||||
font = FontStyle()
|
||||
font.set(face=FONT_SANS_SERIF, size=10)
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_description(_('The style used for the Index page numbers.'))
|
||||
style_sheet.add_paragraph_style("Index-Number", para)
|
||||
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_description(_('The style used for the TOC first level heading.'))
|
||||
style_sheet.add_paragraph_style("TOC-Heading1", para)
|
||||
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_first_indent(0.5)
|
||||
para.set_description(_('The style used for the TOC second level heading.'))
|
||||
style_sheet.add_paragraph_style("TOC-Heading2", para)
|
||||
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_first_indent(1)
|
||||
para.set_description(_('The style used for the TOC third level heading.'))
|
||||
style_sheet.add_paragraph_style("TOC-Heading3", para)
|
||||
|
||||
def write_toc(toc, doc, offset):
|
||||
"""
|
||||
Write the table of contents.
|
||||
"""
|
||||
if not toc:
|
||||
return
|
||||
|
||||
doc.start_paragraph('TOC-Title')
|
||||
doc.write_text(_('Contents'))
|
||||
doc.end_paragraph()
|
||||
|
||||
doc.start_table('toc', 'TOC-Table')
|
||||
for mark, page_nr in toc:
|
||||
doc.start_row()
|
||||
doc.start_cell('TOC-Cell')
|
||||
if mark.level == 1:
|
||||
style_name = "TOC-Heading1"
|
||||
elif mark.level == 2:
|
||||
style_name = "TOC-Heading2"
|
||||
else:
|
||||
style_name = "TOC-Heading3"
|
||||
doc.start_paragraph(style_name)
|
||||
doc.write_text(mark.key)
|
||||
doc.end_paragraph()
|
||||
doc.end_cell()
|
||||
doc.start_cell('TOC-Cell')
|
||||
doc.start_paragraph('TOC-Number')
|
||||
doc.write_text(str(page_nr + offset + 1))
|
||||
doc.end_paragraph()
|
||||
doc.end_cell()
|
||||
doc.end_row()
|
||||
doc.end_table()
|
||||
|
||||
def write_index(index, doc, offset):
|
||||
"""
|
||||
Write the alphabetical index.
|
||||
"""
|
||||
if not index:
|
||||
return
|
||||
|
||||
doc.start_paragraph('Index-Title')
|
||||
doc.write_text(_('Index'))
|
||||
doc.end_paragraph()
|
||||
|
||||
doc.start_table('index', 'TOC-Table')
|
||||
for key in sorted(index.iterkeys()):
|
||||
doc.start_row()
|
||||
doc.start_cell('TOC-Cell')
|
||||
doc.start_paragraph('Index-Number')
|
||||
doc.write_text(key)
|
||||
doc.end_paragraph()
|
||||
doc.end_cell()
|
||||
doc.start_cell('TOC-Cell')
|
||||
doc.start_paragraph('Index-Number')
|
||||
pages = [str(page_nr + offset + 1) for page_nr in index[key]]
|
||||
doc.write_text(', '.join(pages))
|
||||
doc.end_paragraph()
|
||||
doc.end_cell()
|
||||
doc.end_row()
|
||||
doc.end_table()
|
||||
Reference in New Issue
Block a user