Logo Search packages:      
Sourcecode: calibre version File versions

calibre::ebooks::rtf2xml::sections::Sections Class Reference

List of all members.


Detailed Description

=================
Purpose
=================
Write section tags for a tokenized file. (This module won't be any use to use
to you unless you use it as part of the other modules.)
---------------
logic
---------------
The tags for the first section breaks have already been written.
RTF stores section breaks with the \sect tag. Each time this tag is
encountered, add one to the counter.
When I encounter the \sectd tag, I want to collect all the appropriate tokens
that describe the section. When I reach a \pard, I know I an stop collecting
tokens and write the section tags.
The exception to this method occurs when sections occur in field blocks, such
as the index. Normally, two section break occur within the index and other
field-blocks. (If less or more section breaks occurr, this code may not work.)
I want the sections to occurr outside of the index. That is, the index
should be nested inside one section tag. After the index is complete, a new
section should begin.
In order to write the sections outside of the field blocks, I have to store
all of the field block as a string. When I ecounter the \sect tag, add one to
the section counter, but store this number in a list. Likewise, store the
information describing the section in another list.
When I reach the end of the field block, choose the first item from the
numbered list as the section number. Choose the first item in the description
list as the values and attributes of the section. Enclose the field string
between the section tags.
Start a new section outside the field-block strings. Use the second number in
the list; use the second item in the description list.
CHANGE (2004-04-26) No longer write sections that occurr in field-blocks.
Instead, ingore all section information in a field-block.

Definition at line 20 of file sections.py.


Public Member Functions

def __init__
def make_sections

Private Member Functions

def __attribute_func
def __before_body_func
def __before_first_sec_func
def __body_func
def __end_sec_def_func
def __end_sec_in_field_func
def __end_sec_premature_func
def __found_sec_in_field_func
def __found_section_def_bef_sec_func
def __found_section_def_func
def __found_section_def_in_field_func
def __found_section_func
def __found_section_in_field_func
def __handle_sec_def
def __initiate_values
def __print_field_sec_attributes
def __sec_in_field_func
def __section_def_func
def __section_func
def __write_section

Private Attributes

 __body_dict
 __bug_handler
 __copy
 __field_instruction_string
 __field_num
 __file
 __found_first_sec
 __in_field
 __list_of_sec_values
 __mark_end
 __mark_start
 __run_level
 __sec_in_field_dict
 __sec_in_field_string
 __section_def_dict
 __section_num
 __section_values
 __state
 __state_dict
 __text_string
 __token_info
 __write_obj
 __write_to

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index