Logo Search packages:      
Sourcecode: calibre version File versions

def calibre::ebooks::rtf2xml::styles::Styles::__initiate_values (   self  )  [private]

Initiate all values.

Definition at line 45 of file styles.py.

00045                                :
        """
        Initiate all values.
        """
        self.__border_obj = border_parse.BorderParse()
        self.__styles_dict =  {'par':{}, 'char':{}}
        self.__styles_num = '0'
        self.__type_of_style = 'par'
        self.__text_string = ''
        self.__state = 'before_styles_table'
        self.__state_dict = {
        'before_styles_table': self.__before_styles_func,
        'in_styles_table'    : self.__in_styles_func,
        'in_individual_style' : self.__in_individual_style_func,
        'after_styles_table'  : self.__after_styles_func,
        'mi<mk<styles-beg'  : self.__found_styles_table_func,
        'mi<mk<styles-end'  : self.__found_end_styles_table_func,
        'mi<mk<stylei-beg'  : self.__found_beg_ind_style_func,
        'mi<mk<stylei-end'  : self.__found_end_ind_style_func,
        'cw<ss<para-style'  : self.__para_style_func,
        'cw<ss<char-style'  : self.__char_style_func,
        }
        # A separate dictionary for parsing the body text
        self.__body_dict = {
        'cw<ss<para-style'  : (self.__para_style_in_body_func, 'par'),
        'cw<ss<char-style'  : (self.__para_style_in_body_func, 'char'),
        }
        # 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',
        # page fomratting mixed in! (Just in older RTF?)
        'margin-lef'    :       'left-indent',
        'margin-rig'    :       'right-indent',
        'margin-bot'    :       'space-after',
        'margin-top'    :       'space-before',
        # stylesheet = > ss
        'style-shet'    :     'stylesheet',
        'based-on__'    :     'based-on-style',
        'next-style'    :     'next-style',
        'char-style'    :     'character-style',
        'para-style'    :     'paragraph-style',
        # 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',
        'dbl-strike'   :      'double-strike-through',
        'emboss____'    :     'emboss',
        'engrave___'    :     'engrave',
        'subscript_'    :     'subscript',
        'superscrip'    :     'superscript',
        'plain_____'    :     'plain',
        'font-style'    :     'font-style',
        'font-color'    :     'font-color',
        'font-size_'    :     'font-size',
        'font-up___'    :     'superscript',
        'font-down_'    :     'subscript',
        'red_______'    :     'red',
        'blue______'    :     'blue',
        'green_____'    :     'green',
        'caps______'    :       'caps',
        # 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',
        # tabs
        'tab-center'  :   'center',
        'tab-right_'  :   'right',
        'tab-dec___'  :   'decimal',
        'leader-dot'  :   'leader-dot',
        'leader-hyp'  :   'leader-hyphen',
        'leader-und'  :   'leader-underline',
        }
        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.__ignore_list = [
        'list-tebef',
            ]
        self.__tabs_list = self.__tabs_dict.keys()
        self.__tab_type = 'left'
        self.__leader_found = 0
    def __in_individual_style_func(self, line):


Generated by  Doxygen 1.6.0   Back to index