| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/reportlab/platypus/__pycache__/ |
Upload File : |
�
~G�bS � � � d Z dZddlmZ ddlmZmZmZmZm Z m
Z
mZ ddlm
Z
mZ ddlmZ ddlmZ ddlmZ dd lmZmZ dd
lmZ ddlmZ ddlmZ dd
lZddl m!Z! d� Z" e# n# G d� de$� � Z#Y nxY wd#d�Z%dez Z&dez Z' e
deddde'�� � gZ( eg d�� � Z) G d� de� � Z*d� Z+ G d� de� � Z,e,Z-d � Z. G d!� d"e� � Z/d
S )$z3.5.32a Experimental class to generate Tables of Contents easily
This module defines a single TableOfContents() class that can be used to
create automatically a table of tontents for Platypus documents like
this:
story = []
toc = TableOfContents()
story.append(toc)
# some heading paragraphs here...
doc = MyTemplate(path)
doc.multiBuild(story)
The data needed to create the table is a list of (level, text, pageNum)
triplets, plus some paragraph styles for each level of the table itself.
The triplets will usually be created in a document template's method
like afterFlowable(), making notification calls using the notify()
method with appropriate data like this:
(level, text, pageNum) = ...
self.notify('TOCEntry', (level, text, pageNum))
Optionally the list can contain four items in which case the last item
is a destination key which the entry should point to. A bookmark
with this key needs to be created first like this:
key = 'ch%s' % self.seq.nextf('chapter')
self.canv.bookmarkPage(key)
self.notify('TOCEntry', (level, text, pageNum, key))
As the table of contents need at least two passes over the Platypus
story which is why the multiBuild() method must be called.
The level<NUMBER>ParaStyle variables are the paragraph styles used
to format the entries in the table of contents. Their indentation
is calculated like this: each entry starts at a multiple of some
constant named delta. If one entry spans more than one line, all
lines after the first are indented by the same constant named
epsilon.
� )�cm)�
commasplit�
escapeOnce�encode_label�decode_label�strTypes� asUnicode�asNative)�ParagraphStyle�
_baseFontName)� sequencer)� Paragraph)�IndexingFlowable)�
TableStyle�Table)�Spacer)�stringWidth��canvasN)�literal_evalc �, � ddl m} || ddd�� � S )Nr )�unescape�'�")z'z")�xml.sax.saxutilsr )�txtr s �D/usr/lib/python3/dist-packages/reportlab/platypus/tableofcontents.py�unquoter <