Logo Search packages:      
Sourcecode: calibre version File versions

def calibre::ebooks::rtf2xml::paragraph_def::ParagraphDef::__initiate_values (   self  )  [private]

Initiate all values.

Definition at line 75 of file paragraph_def.py.

00075                                :
        """
        Initiate all values.
        """
        # Dictionary needed to convert shortened style names to readable names
        self.__token_dict={
        # paragraph formatting => pf
        'par-end___'    :     'para',
        'par-def___'    :     'paragraph-definition',
        'keep-w-nex'    :     'keep-with-next',
        'widow-cntl'    :     'widow-control',
        'adjust-rgt'    :     'adjust-right',
        'language__'    :     'language',
        'right-inde'    :     'right-indent',
        'fir-ln-ind'    :     'first-line-indent',
        'left-inden'    :     'left-indent',
        'space-befo'    :     'space-before',
        'space-afte'    :     'space-after',
        'line-space'    :     'line-spacing',
        'default-ta'    :     'default-tab',
        'align_____'    :     'align',
        'widow-cntr'    :     'widow-control',
        # stylesheet = > ss
        'style-shet'    :     'stylesheet',
        'based-on__'    :     'based-on-style',
        'next-style'    :     'next-style',
        'char-style'    :     'character-style',
        # this is changed to get a nice attribute
        'para-style'    :     'name',
        # graphics => gr
        'picture___'    :     'pict',
        'obj-class_'    :     'obj_class',
        'mac-pic___'    :     'mac-pict',
        # section => sc
        'section___'    :     'section-new',
        'sect-defin'    :     'section-reset',
        'sect-note_'    :     'endnotes-in-section',
        # list=> ls
        'list-text_'    :     'list-text',
        # this line must be wrong because it duplicates an earlier one
        'list-text_'    :     'list-text',
        'list______'    :     'list',
        'list-lev-d'    :     'list-level-definition',
        'list-cardi'    :     'list-cardinal-numbering',
        'list-decim'    :     'list-decimal-numbering',
        'list-up-al'    :     'list-uppercase-alphabetic-numbering',
        'list-up-ro'    :     'list-uppercae-roman-numbering',
        'list-ord__'    :     'list-ordinal-numbering',
        'list-ordte'    :     'list-ordinal-text-numbering',
        'list-bulli'    :     'list-bullet',
        'list-simpi'    :     'list-simple',
        'list-conti'    :     'list-continue',
        'list-hang_'    :     'list-hang',
        # 'list-tebef'    :   'list-text-before',
        'list-level'    :     'level',
        'list-id___'    :     'list-id',
        'list-start'    :     'list-start',
        'nest-level'    :     'nest-level',
        # duplicate
        'list-level'    :     'list-level',
        # notes => nt
        'footnote__'    :     'footnote',
        'type______'    :     'type',
        # anchor => an
        'toc_______'    :     'anchor-toc',
        'book-mk-st'    :     'bookmark-start',
        'book-mk-en'    :     'bookmark-end',
        'index-mark'    :     'anchor-index',
        'place_____'    :     'place',
        # field => fd
        'field_____'    :     'field',
        'field-inst'    :     'field-instruction',
        'field-rslt'    :     'field-result',
        'datafield_'    :     'data-field',
        # info-tables => it
        'font-table'    :     'font-table',
        'colr-table'    :     'color-table',
        'lovr-table'    :     'list-override-table',
        'listtable_'    :     'list-table',
        'revi-table'    :     'revision-table',
        # character info => ci
        'hidden____'    :     'hidden',
        'italics___'    :     'italics',
        'bold______'    :     'bold',
        'strike-thr'   :      'strike-through',
        'shadow____'   :      'shadow',
        'outline___'   :      'outline',
        'small-caps'   :      'small-caps',
        'caps______'   :       'caps',
        'dbl-strike'   :      'double-strike-through',
        'emboss____'    :     'emboss',
        'engrave___'    :     'engrave',
        'subscript_'    :     'subscript',
        'superscrip'    :     'superscipt',
        'font-style'    :     'font-style',
        'font-color'    :     'font-color',
        'font-size_'    :     'font-size',
        'font-up___'    :     'superscript',
        'font-down_'    :     'subscript',
        'red_______'    :     'red',
        'blue______'    :     'blue',
        'green_____'    :     'green',
        # table => tb
        'row-def___'    :     'row-definition',
        'cell______'    :     'cell',
        'row_______'    :     'row',
        'in-table__'    :     'in-table',
        'columns___'    :     'columns',
        'row-pos-le'    :     'row-position-left',
        'cell-posit'    :     'cell-position',
        # preamble => pr
        # underline
        'underlined'    :     'underlined',
        # border => bd
        'bor-t-r-hi'    :     'border-table-row-horizontal-inside',
        'bor-t-r-vi'    :     'border-table-row-vertical-inside',
        'bor-t-r-to'    :     'border-table-row-top',
        'bor-t-r-le'    :     'border-table-row-left',
        'bor-t-r-bo'    :     'border-table-row-bottom',
        'bor-t-r-ri'    :     'border-table-row-right',
        'bor-cel-bo'    :     'border-cell-bottom',
        'bor-cel-to'    :     'border-cell-top',
        'bor-cel-le'    :     'border-cell-left',
        'bor-cel-ri'    :     'border-cell-right',
        'bor-par-bo'    :     'border-paragraph-bottom',
        'bor-par-to'    :     'border-paragraph-top',
        'bor-par-le'    :     'border-paragraph-left',
        'bor-par-ri'    :     'border-paragraph-right',
        'bor-par-bo'    :     'border-paragraph-box',
        'bor-for-ev'    :     'border-for-every-paragraph',
        'bor-outsid'    :     'border-outisde',
        'bor-none__'    :     'border',
        # border type => bt
        'bdr-single'    :     'single',
        'bdr-doubtb'    :     'double-thickness-border',
        'bdr-shadow'    :     'shadowed-border',
        'bdr-double'    :     'double-border',
        'bdr-dotted'    :     'dotted-border',
        'bdr-dashed'    :     'dashed',
        'bdr-hair__'    :     'hairline',
        'bdr-inset_'    :     'inset',
        'bdr-das-sm'    :     'dash-small',
        'bdr-dot-sm'    :     'dot-dash',
        'bdr-dot-do'    :     'dot-dot-dash',
        'bdr-outset'    :     'outset',
        'bdr-trippl'    :     'tripple',
        'bdr-thsm__'    :     'thick-thin-small',
        'bdr-htsm__'    :     'thin-thick-small',
        'bdr-hthsm_'    :     'thin-thick-thin-small',
        'bdr-thm__'     :     'thick-thin-medium',
        'bdr-htm__'     :     'thin-thick-medium',
        'bdr-hthm_'     :     'thin-thick-thin-medium',
        'bdr-thl__'     :     'thick-thin-large',
        'bdr-hthl_'     :     'think-thick-think-large',
        'bdr-wavy_'     :     'wavy',
        'bdr-d-wav'     :     'double-wavy',
        'bdr-strip'     :     'striped',
        'bdr-embos'     :     'emboss',
        'bdr-engra'     :     'engrave',
        'bdr-frame'     :     'frame',
        'bdr-li-wid'    :     'line-width',
        }
        self.__tabs_dict = {
        'cw<pf<tab-stop__'  :   self.__tab_stop_func,
        'cw<pf<tab-center'  :   self.__tab_type_func,
        'cw<pf<tab-right_'  :   self.__tab_type_func,
        'cw<pf<tab-dec___'  :   self.__tab_type_func,
        'cw<pf<leader-dot'  :   self.__tab_leader_func,
        'cw<pf<leader-hyp'  :   self.__tab_leader_func,
        'cw<pf<leader-und'  :   self.__tab_leader_func,
        'cw<pf<tab-bar-st'  :   self.__tab_bar_func,
        }
        self.__tab_type_dict = {
        'cw<pf<tab-center'  :   'center',
        'cw<pf<tab-right_'  :   'right',
        'cw<pf<tab-dec___'  :   'decimal',
        'cw<pf<leader-dot'  :   'leader-dot',
        'cw<pf<leader-hyp'  :   'leader-hyphen',
        'cw<pf<leader-und'  :   'leader-underline',
        }
        self.__border_obj = border_parse.BorderParse()
        self.__style_num_strings = []
        self.__body_style_strings = []
        self.__state = 'before_1st_para_def'
        self.__att_val_dict = {}
        self.__start_marker =  'mi<mk<pard-start\n' # outside para tags
        self.__start2_marker = 'mi<mk<pardstart_\n' # inside para tags
        self.__end2_marker =   'mi<mk<pardend___\n' # inside para tags
        self.__end_marker =    'mi<mk<pard-end__\n' # outside para tags
        self.__text_string = ''
        self.__state_dict = {
        'before_1st_para_def'   : self.__before_1st_para_def_func,
        'collect_tokens'        : self.__collect_tokens_func,
        'after_para_def'        : self.__after_para_def_func,
        'in_paragraphs'         : self.__in_paragraphs_func,
        'after_para_end'        : self.__after_para_end_func,
        }
        self.__collect_tokens_dict = {
        'mi<mk<para-start'  :  self.__end_para_def_func,
        'cw<pf<par-def___'  :  self.__para_def_in_para_def_func,
        'cw<tb<cell______'  : self.__empty_table_element_func,
        'cw<tb<row_______'  : self.__empty_table_element_func,
        }
        self.__after_para_def_dict = {
        'mi<mk<para-start'  :   self.__start_para_after_def_func,
        'cw<pf<par-def___'  :   self.__found_para_def_func,
        'cw<tb<cell______'  :   self.__empty_table_element_func,
        'cw<tb<row_______'  :   self.__empty_table_element_func,
        }
        self.__in_paragraphs_dict = {
        'mi<mk<para-end__'      : self.__found_para_end_func,
        }
        self.__after_para_end_dict = {
        'mi<mk<para-start'      : self.__continue_block_func,
        'mi<mk<para-end__'      : self.__continue_block_func,
        'cw<pf<par-def___'      : self.__new_para_def_func,
        'mi<mk<body-close'      : self.__stop_block_func,
        'mi<mk<par-in-fld'      : self.__stop_block_func,
        'cw<tb<cell______'      : self.__stop_block_func,
        'cw<tb<row-def___'      : self.__stop_block_func,
        'cw<tb<row_______'      : self.__stop_block_func,
        'mi<mk<sect-close'      : self.__stop_block_func,
        'mi<mk<sect-start'      : self.__stop_block_func,
        'mi<mk<header-beg'      : self.__stop_block_func,
        'mi<mk<header-end'      : self.__stop_block_func,
        'mi<mk<head___clo'      : self.__stop_block_func,
        'mi<mk<fldbk-end_'      : self.__stop_block_func,
        'mi<mk<lst-txbeg_'      : self.__stop_block_func,
        }
    def __before_1st_para_def_func(self, line):


Generated by  Doxygen 1.6.0   Back to index